4 static const unsigned long long GAIN_VAL = 42;
13 namespace oni {
namespace driver {
19 rsTraceFunc(
"propertyId=%d dataSize=%d", propertyId, dataSize);
23 case ONI_STREAM_PROPERTY_VIDEO_MODE:
25 if (data && (dataSize ==
sizeof(OniVideoMode)))
27 OniVideoMode*
mode = (OniVideoMode*)data;
28 rsLogDebug(
"set video mode: %dx%d @%d format=%d",
29 (
int)mode->resolutionX, (
int)mode->resolutionY, (
int)mode->fps, (
int)mode->pixelFormat);
40 case ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE:
42 if (data && dataSize ==
sizeof(OniBool) &&
m_oniType == ONI_SENSOR_COLOR)
47 if (e.
success())
return ONI_STATUS_OK;
52 case ONI_STREAM_PROPERTY_AUTO_EXPOSURE:
54 if (data && dataSize ==
sizeof(OniBool) &&
m_oniType == ONI_SENSOR_COLOR)
59 if (e.
success())
return ONI_STATUS_OK;
64 case ONI_STREAM_PROPERTY_EXPOSURE:
66 if (data && dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_COLOR)
71 if (e.
success())
return ONI_STATUS_OK;
76 case ONI_STREAM_PROPERTY_GAIN:
78 if (data && dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_COLOR)
83 if (e.
success())
return ONI_STATUS_OK;
88 case XN_STREAM_PROPERTY_S2D_TABLE:
90 if (data &&
m_oniType == ONI_SENSOR_DEPTH)
100 case XN_STREAM_PROPERTY_D2S_TABLE:
102 if (data &&
m_oniType == ONI_SENSOR_DEPTH)
106 return ONI_STATUS_OK;
114 #if defined(RS2_TRACE_NOT_SUPPORTED_PROPS) 115 rsTraceError(
"Not supported: propertyId=%d", propertyId);
117 return ONI_STATUS_NOT_SUPPORTED;
121 rsTraceError(
"propertyId=%d dataSize=%d", propertyId, dataSize);
122 return ONI_STATUS_ERROR;
131 case ONI_STREAM_PROPERTY_CROPPING:
133 if (data && dataSize && *dataSize ==
sizeof(OniCropping))
136 value.enabled =
false;
141 *((OniCropping*)data) =
value;
142 return ONI_STATUS_OK;
147 case ONI_STREAM_PROPERTY_HORIZONTAL_FOV:
149 if (data && dataSize && *dataSize ==
sizeof(
float))
151 *((
float*)data) =
m_fovX * 0.01745329251994329576923690768489f;
152 return ONI_STATUS_OK;
157 case ONI_STREAM_PROPERTY_VERTICAL_FOV:
159 if (data && dataSize && *dataSize ==
sizeof(
float))
161 *((
float*)data) =
m_fovY * 0.01745329251994329576923690768489f;
162 return ONI_STATUS_OK;
167 case ONI_STREAM_PROPERTY_VIDEO_MODE:
169 if (data && dataSize && *dataSize ==
sizeof(OniVideoMode))
172 return ONI_STATUS_OK;
177 case ONI_STREAM_PROPERTY_MAX_VALUE:
179 if (data && dataSize && *dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_DEPTH)
182 return ONI_STATUS_OK;
187 case ONI_STREAM_PROPERTY_MIN_VALUE:
189 if (data && dataSize && *dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_DEPTH)
192 return ONI_STATUS_OK;
197 case ONI_STREAM_PROPERTY_STRIDE:
199 if (data && dataSize && *dataSize ==
sizeof(
int))
202 return ONI_STATUS_OK;
207 case ONI_STREAM_PROPERTY_MIRRORING:
209 if (data && dataSize && *dataSize ==
sizeof(OniBool))
211 *((OniBool*)data) =
false;
212 return ONI_STATUS_OK;
217 case ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE:
219 if (data && dataSize && *dataSize ==
sizeof(OniBool) &&
m_oniType == ONI_SENSOR_COLOR)
225 *((OniBool*)data) = (int)value ?
true :
false;
226 return ONI_STATUS_OK;
232 case ONI_STREAM_PROPERTY_AUTO_EXPOSURE:
234 if (data && dataSize && *dataSize ==
sizeof(OniBool) &&
m_oniType == ONI_SENSOR_COLOR)
240 *((OniBool*)data) = (int)value ?
true :
false;
241 return ONI_STATUS_OK;
247 case ONI_STREAM_PROPERTY_EXPOSURE:
249 if (data && dataSize && *dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_COLOR)
255 *((
int*)data) = (int)value;
256 return ONI_STATUS_OK;
262 case ONI_STREAM_PROPERTY_GAIN:
264 if (data && dataSize && *dataSize ==
sizeof(
int) &&
m_oniType == ONI_SENSOR_COLOR)
270 *((
int*)data) = (int)value;
271 return ONI_STATUS_OK;
277 case XN_STREAM_PROPERTY_GAIN:
279 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
281 *((
unsigned long long*)data) =
GAIN_VAL;
282 return ONI_STATUS_OK;
287 case XN_STREAM_PROPERTY_CONST_SHIFT:
289 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
292 return ONI_STATUS_OK;
297 case XN_STREAM_PROPERTY_MAX_SHIFT:
299 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
302 return ONI_STATUS_OK;
307 case XN_STREAM_PROPERTY_PARAM_COEFF:
309 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
312 return ONI_STATUS_OK;
317 case XN_STREAM_PROPERTY_SHIFT_SCALE:
319 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
322 return ONI_STATUS_OK;
327 case XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE:
329 if (data && dataSize && *dataSize ==
sizeof(
unsigned long long) &&
m_oniType == ONI_SENSOR_DEPTH)
332 return ONI_STATUS_OK;
337 case XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE:
339 if (data && dataSize && *dataSize ==
sizeof(
double) &&
m_oniType == ONI_SENSOR_DEPTH)
342 return ONI_STATUS_OK;
347 case XN_STREAM_PROPERTY_EMITTER_DCMOS_DISTANCE:
349 if (data && dataSize && *dataSize ==
sizeof(
double) &&
m_oniType == ONI_SENSOR_DEPTH)
352 return ONI_STATUS_OK;
357 case XN_STREAM_PROPERTY_S2D_TABLE:
359 if (data && dataSize &&
m_oniType == ONI_SENSOR_DEPTH)
363 return ONI_STATUS_OK;
369 case XN_STREAM_PROPERTY_D2S_TABLE:
371 if (data && dataSize &&
m_oniType == ONI_SENSOR_DEPTH)
375 return ONI_STATUS_OK;
383 #if defined(RS2_TRACE_NOT_SUPPORTED_PROPS) 384 rsTraceError(
"Not supported: propertyId=%d", propertyId);
386 return ONI_STATUS_NOT_SUPPORTED;
390 rsTraceError(
"propertyId=%d dataSize=%d", propertyId, *dataSize);
391 return ONI_STATUS_ERROR;
398 case ONI_STREAM_PROPERTY_CROPPING:
399 case ONI_STREAM_PROPERTY_HORIZONTAL_FOV:
400 case ONI_STREAM_PROPERTY_VERTICAL_FOV:
401 case ONI_STREAM_PROPERTY_VIDEO_MODE:
402 case ONI_STREAM_PROPERTY_MAX_VALUE:
403 case ONI_STREAM_PROPERTY_MIN_VALUE:
404 case ONI_STREAM_PROPERTY_STRIDE:
405 case ONI_STREAM_PROPERTY_MIRRORING:
409 case ONI_STREAM_PROPERTY_NUMBER_OF_FRAMES:
412 case ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE:
413 case ONI_STREAM_PROPERTY_AUTO_EXPOSURE:
414 case ONI_STREAM_PROPERTY_EXPOSURE:
415 case ONI_STREAM_PROPERTY_GAIN:
418 case XN_STREAM_PROPERTY_GAIN:
419 case XN_STREAM_PROPERTY_CONST_SHIFT:
420 case XN_STREAM_PROPERTY_MAX_SHIFT:
421 case XN_STREAM_PROPERTY_PARAM_COEFF:
422 case XN_STREAM_PROPERTY_SHIFT_SCALE:
423 case XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE:
424 case XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE:
425 case XN_STREAM_PROPERTY_EMITTER_DCMOS_DISTANCE:
426 case XN_STREAM_PROPERTY_S2D_TABLE:
427 case XN_STREAM_PROPERTY_D2S_TABLE:
float rs2_get_option(const rs2_options *options, rs2_option option, rs2_error **error)
bool setTable(const void *src, int size, std::vector< uint16_t > &table)
std::vector< uint16_t > m_d2s
static const unsigned long long PARAM_COEFF_VAL
bool getTable(void *dst, int *size, const std::vector< uint16_t > &table)
virtual OniStatus setProperty(int propertyId, const void *data, int dataSize)
#define rsTraceError(format,...)
int getPixelFormatBytes(rs2_format type)
static const unsigned long long ZERO_PLANE_DISTANCE_VAL
static const double EMITTER_DCMOS_DISTANCE_VAL
static const double ZERO_PLANE_PIXEL_SIZE_VAL
static const unsigned long long SHIFT_SCALE_VAL
#define rsLogDebug(format,...)
#define rsTraceFunc(format,...)
static const unsigned long long CONST_SHIFT_VAL
virtual OniBool isPropertySupported(int propertyId)
static const unsigned long long GAIN_VAL
void rs2_set_option(const rs2_options *options, rs2_option option, float value, rs2_error **error)
static const unsigned long long MAX_SHIFT_VAL
std::vector< uint16_t > m_s2d
OniPixelFormat convertPixelFormat(rs2_format type)
virtual OniStatus getProperty(int propertyId, void *data, int *dataSize)
bool isVideoModeSupported(OniVideoMode *reqMode)