libuvc.h
Go to the documentation of this file.
00001 #ifndef LIBUVC_H
00002 #define LIBUVC_H
00003 
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00008 #include <stdio.h> // FILE
00009 #include <errno.h>
00010 #include <libusb.h>
00011 #include <sys/time.h> // timeval
00012 #include "libuvc_config.h"
00013     
00017 typedef enum uvc_error {
00019   UVC_SUCCESS = 0,
00021   UVC_ERROR_IO = -1,
00023   UVC_ERROR_INVALID_PARAM = -2,
00025   UVC_ERROR_ACCESS = -3,
00027   UVC_ERROR_NO_DEVICE = -4,
00029   UVC_ERROR_NOT_FOUND = -5,
00031   UVC_ERROR_BUSY = -6,
00033   UVC_ERROR_TIMEOUT = -7,
00035   UVC_ERROR_OVERFLOW = -8,
00037   UVC_ERROR_PIPE = -9,
00039   UVC_ERROR_INTERRUPTED = -10,
00041   UVC_ERROR_NO_MEM = -11,
00043   UVC_ERROR_NOT_SUPPORTED = -12,
00045   UVC_ERROR_INVALID_DEVICE = -50,
00047   UVC_ERROR_INVALID_MODE = -51,
00049   UVC_ERROR_CALLBACK_EXISTS = -52,
00051   UVC_ERROR_OTHER = -99
00052 } uvc_error_t;
00053 
00055 enum uvc_vs_desc_subtype {
00056   UVC_VS_UNDEFINED = 0x00,
00057   UVC_VS_INPUT_HEADER = 0x01,
00058   UVC_VS_OUTPUT_HEADER = 0x02,
00059   UVC_VS_STILL_IMAGE_FRAME = 0x03,
00060   UVC_VS_FORMAT_UNCOMPRESSED = 0x04,
00061   UVC_VS_FRAME_UNCOMPRESSED = 0x05,
00062   UVC_VS_FORMAT_MJPEG = 0x06,
00063   UVC_VS_FRAME_MJPEG = 0x07,
00064   UVC_VS_FORMAT_MPEG2TS = 0x0a,
00065   UVC_VS_FORMAT_DV = 0x0c,
00066   UVC_VS_COLORFORMAT = 0x0d,
00067   UVC_VS_FORMAT_FRAME_BASED = 0x10,
00068   UVC_VS_FRAME_FRAME_BASED = 0x11,
00069   UVC_VS_FORMAT_STREAM_BASED = 0x12
00070 };
00071 
00072 struct uvc_format_desc;
00073 struct uvc_frame_desc;
00074 
00081 typedef struct uvc_frame_desc {
00082   struct uvc_format_desc *parent;
00083   struct uvc_frame_desc *prev, *next;
00085   enum uvc_vs_desc_subtype bDescriptorSubtype;
00087   uint8_t bFrameIndex;
00088   uint8_t bmCapabilities;
00090   uint16_t wWidth;
00092   uint16_t wHeight;
00094   uint32_t dwMinBitRate;
00096   uint32_t dwMaxBitRate;
00098   uint32_t dwMaxVideoFrameBufferSize;
00100   uint32_t dwDefaultFrameInterval;
00102   uint32_t dwMinFrameInterval;
00104   uint32_t dwMaxFrameInterval;
00106   uint32_t dwFrameIntervalStep;
00108   uint8_t bFrameIntervalType;
00110   uint32_t dwBytesPerLine;
00112   uint32_t *intervals;
00113 } uvc_frame_desc_t;
00114 
00120 typedef struct uvc_format_desc {
00121   struct uvc_streaming_interface *parent;
00122   struct uvc_format_desc *prev, *next;
00124   enum uvc_vs_desc_subtype bDescriptorSubtype;
00126   uint8_t bFormatIndex;
00127   uint8_t bNumFrameDescriptors;
00129   union {
00130     uint8_t guidFormat[16];
00131     uint8_t fourccFormat[4];
00132   };
00134   union {
00136     uint8_t bBitsPerPixel;
00138     uint8_t bmFlags;
00139   };
00141   uint8_t bDefaultFrameIndex;
00142   uint8_t bAspectRatioX;
00143   uint8_t bAspectRatioY;
00144   uint8_t bmInterlaceFlags;
00145   uint8_t bCopyProtect;
00146   uint8_t bVariableSize;
00148   struct uvc_frame_desc *frame_descs;
00149 } uvc_format_desc_t;
00150 
00152 enum uvc_req_code {
00153   UVC_RC_UNDEFINED = 0x00,
00154   UVC_SET_CUR = 0x01,
00155   UVC_GET_CUR = 0x81,
00156   UVC_GET_MIN = 0x82,
00157   UVC_GET_MAX = 0x83,
00158   UVC_GET_RES = 0x84,
00159   UVC_GET_LEN = 0x85,
00160   UVC_GET_INFO = 0x86,
00161   UVC_GET_DEF = 0x87
00162 };
00163 
00164 enum uvc_device_power_mode {
00165   UVC_VC_VIDEO_POWER_MODE_FULL = 0x000b,
00166   UVC_VC_VIDEO_POWER_MODE_DEVICE_DEPENDENT = 0x001b,
00167 };
00168 
00170 enum uvc_ct_ctrl_selector {
00171   UVC_CT_CONTROL_UNDEFINED = 0x00,
00172   UVC_CT_SCANNING_MODE_CONTROL = 0x01,
00173   UVC_CT_AE_MODE_CONTROL = 0x02,
00174   UVC_CT_AE_PRIORITY_CONTROL = 0x03,
00175   UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,
00176   UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,
00177   UVC_CT_FOCUS_ABSOLUTE_CONTROL = 0x06,
00178   UVC_CT_FOCUS_RELATIVE_CONTROL = 0x07,
00179   UVC_CT_FOCUS_AUTO_CONTROL = 0x08,
00180   UVC_CT_IRIS_ABSOLUTE_CONTROL = 0x09,
00181   UVC_CT_IRIS_RELATIVE_CONTROL = 0x0a,
00182   UVC_CT_ZOOM_ABSOLUTE_CONTROL = 0x0b,
00183   UVC_CT_ZOOM_RELATIVE_CONTROL = 0x0c,
00184   UVC_CT_PANTILT_ABSOLUTE_CONTROL = 0x0d,
00185   UVC_CT_PANTILT_RELATIVE_CONTROL = 0x0e,
00186   UVC_CT_ROLL_ABSOLUTE_CONTROL = 0x0f,
00187   UVC_CT_ROLL_RELATIVE_CONTROL = 0x10,
00188   UVC_CT_PRIVACY_CONTROL = 0x11,
00189   UVC_CT_FOCUS_SIMPLE_CONTROL = 0x12,
00190   UVC_CT_DIGITAL_WINDOW_CONTROL = 0x13,
00191   UVC_CT_REGION_OF_INTEREST_CONTROL = 0x14
00192 };
00193 
00195 enum uvc_pu_ctrl_selector {
00196   UVC_PU_CONTROL_UNDEFINED = 0x00,
00197   UVC_PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,
00198   UVC_PU_BRIGHTNESS_CONTROL = 0x02,
00199   UVC_PU_CONTRAST_CONTROL = 0x03,
00200   UVC_PU_GAIN_CONTROL = 0x04,
00201   UVC_PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,
00202   UVC_PU_HUE_CONTROL = 0x06, 
00203   UVC_PU_SATURATION_CONTROL = 0x07,
00204   UVC_PU_SHARPNESS_CONTROL = 0x08,
00205   UVC_PU_GAMMA_CONTROL = 0x09,
00206   UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0a,
00207   UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0b,
00208   UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0c,
00209   UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0d,
00210   UVC_PU_DIGITAL_MULTIPLIER_CONTROL = 0x0e,
00211   UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0f,
00212   UVC_PU_HUE_AUTO_CONTROL = 0x10,
00213   UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL = 0x11,
00214   UVC_PU_ANALOG_LOCK_STATUS_CONTROL = 0x12,
00215   UVC_PU_CONTRAST_AUTO_CONTROL = 0x13
00216 };
00217 
00219 enum uvc_term_type {
00220   UVC_TT_VENDOR_SPECIFIC = 0x0100,
00221   UVC_TT_STREAMING = 0x0101
00222 };
00223 
00225 enum uvc_it_type {
00226   UVC_ITT_VENDOR_SPECIFIC = 0x0200,
00227   UVC_ITT_CAMERA = 0x0201,
00228   UVC_ITT_MEDIA_TRANSPORT_INPUT = 0x0202
00229 };
00230 
00232 enum uvc_ot_type {
00233   UVC_OTT_VENDOR_SPECIFIC = 0x0300,
00234   UVC_OTT_DISPLAY = 0x0301,
00235   UVC_OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302
00236 };
00237 
00239 enum uvc_et_type {
00240   UVC_EXTERNAL_VENDOR_SPECIFIC = 0x0400,
00241   UVC_COMPOSITE_CONNECTOR = 0x0401,
00242   UVC_SVIDEO_CONNECTOR = 0x0402,
00243   UVC_COMPONENT_CONNECTOR = 0x0403
00244 };
00245 
00252 struct uvc_context;
00253 typedef struct uvc_context uvc_context_t;
00254 
00259 struct uvc_device;
00260 typedef struct uvc_device uvc_device_t;
00261 
00267 struct uvc_device_handle;
00268 typedef struct uvc_device_handle uvc_device_handle_t;
00269 
00275 struct uvc_stream_handle;
00276 typedef struct uvc_stream_handle uvc_stream_handle_t;
00277 
00279 typedef struct uvc_input_terminal {
00280   struct uvc_input_terminal *prev, *next;
00282   uint8_t bTerminalID;
00284   enum uvc_it_type wTerminalType;
00285   uint16_t wObjectiveFocalLengthMin;
00286   uint16_t wObjectiveFocalLengthMax;
00287   uint16_t wOcularFocalLength;
00289   uint64_t bmControls;
00290 } uvc_input_terminal_t;
00291 
00292 typedef struct uvc_output_terminal {
00293   struct uvc_output_terminal *prev, *next;
00295 } uvc_output_terminal_t;
00296 
00298 typedef struct uvc_processing_unit {
00299   struct uvc_processing_unit *prev, *next;
00301   uint8_t bUnitID;
00303   uint8_t bSourceID;
00305   uint64_t bmControls;
00306 } uvc_processing_unit_t;
00307 
00309 typedef struct uvc_extension_unit {
00310   struct uvc_extension_unit *prev, *next;
00312   uint8_t bUnitID;
00314   uint8_t guidExtensionCode[16];
00316   uint64_t bmControls;
00317 } uvc_extension_unit_t;
00318 
00319 enum uvc_status_class {
00320   UVC_STATUS_CLASS_CONTROL = 0x10,
00321   UVC_STATUS_CLASS_CONTROL_CAMERA = 0x11,
00322   UVC_STATUS_CLASS_CONTROL_PROCESSING = 0x12,
00323 };
00324 
00325 enum uvc_status_attribute {
00326   UVC_STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00,
00327   UVC_STATUS_ATTRIBUTE_INFO_CHANGE = 0x01,
00328   UVC_STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02,
00329   UVC_STATUS_ATTRIBUTE_UNKNOWN = 0xff
00330 };
00331 
00335 typedef void(uvc_status_callback_t)(enum uvc_status_class status_class,
00336                                     int event,
00337                                     int selector,
00338                                     enum uvc_status_attribute status_attribute,
00339                                     void *data, size_t data_len,
00340                                     void *user_ptr);
00341 
00346 typedef struct uvc_device_descriptor {
00348   uint16_t idVendor;
00350   uint16_t idProduct;
00352   uint16_t bcdUVC;
00354   const char *serialNumber;
00356   const char *manufacturer;
00358   const char *product;
00359 } uvc_device_descriptor_t;
00360 
00364 typedef struct uvc_frame {
00366   void *data;
00368   size_t data_bytes;
00370   uint32_t width;
00372   uint32_t height;
00374   uint32_t fourcc;
00376   size_t step;
00378   uint32_t sequence;
00380   struct timeval capture_time;
00383   uvc_device_handle_t *source;
00390   uint8_t library_owns_data;
00391 } uvc_frame_t;
00392 
00396 typedef void(uvc_frame_callback_t)(struct uvc_frame *frame, void *user_ptr);
00397 
00401 typedef struct uvc_stream_ctrl {
00402   uint16_t bmHint;
00403   uint8_t bFormatIndex;
00404   uint8_t bFrameIndex;
00405   uint32_t dwFrameInterval;
00406   uint16_t wKeyFrameRate;
00407   uint16_t wPFrameRate;
00408   uint16_t wCompQuality;
00409   uint16_t wCompWindowSize;
00410   uint16_t wDelay;
00411   uint32_t dwMaxVideoFrameSize;
00412   uint32_t dwMaxPayloadTransferSize;
00413   uint32_t dwClockFrequency;
00414   uint8_t bmFramingInfo;
00415   uint8_t bPreferredVersion;
00416   uint8_t bMinVersion;
00417   uint8_t bMaxVersion;
00418   uint8_t bInterfaceNumber;
00419   uvc_stream_handle_t *handle;
00420 } uvc_stream_ctrl_t;
00421 
00422 uvc_error_t uvc_init(uvc_context_t **ctx, struct libusb_context *usb_ctx);
00423 void uvc_exit(uvc_context_t *ctx);
00424 
00425 uvc_error_t uvc_get_device_list(
00426     uvc_context_t *ctx,
00427     uvc_device_t ***list);
00428 void uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices);
00429 
00430 uvc_error_t uvc_get_device_descriptor(
00431     uvc_device_t *dev,
00432     uvc_device_descriptor_t **desc);
00433 void uvc_free_device_descriptor(
00434     uvc_device_descriptor_t *desc);
00435 
00436 uint8_t uvc_get_bus_number(uvc_device_t *dev);
00437 uint8_t uvc_get_device_address(uvc_device_t *dev);
00438 
00439 uvc_error_t uvc_find_device(
00440     uvc_context_t *ctx,
00441     uvc_device_t **dev,
00442     int vid, int pid, const char *sn);
00443 
00444 uvc_error_t uvc_open(
00445     uvc_device_t *dev,
00446     uvc_device_handle_t **devh);
00447 
00448 uvc_error_t uvc_open2(
00449     uvc_device_t *dev,
00450     uvc_device_handle_t **devh,
00451     int camera_number);
00452 
00453 void uvc_close(uvc_device_handle_t *devh);
00454 
00455 uvc_device_t *uvc_get_device(uvc_device_handle_t *devh);
00456 libusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh);
00457 
00458 void uvc_ref_device(uvc_device_t *dev);
00459 void uvc_unref_device(uvc_device_t *dev);
00460 
00461 void uvc_set_status_callback(uvc_device_handle_t *devh,
00462                              uvc_status_callback_t cb,
00463                              void *user_ptr);
00464 
00465 const uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh);
00466 const uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh);
00467 const uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh);
00468 const uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh);
00469 
00470 uvc_error_t uvc_get_stream_ctrl_format_size(
00471     uvc_device_handle_t *devh,
00472     uvc_stream_ctrl_t *ctrl,
00473     uint32_t fourcc,
00474     int width, int height,
00475     int fps
00476     );
00477 
00478 const uvc_format_desc_t *uvc_get_format_descs(uvc_device_handle_t* );
00479 
00480 uvc_error_t uvc_probe_stream_ctrl(
00481     uvc_device_handle_t *devh,
00482     uvc_stream_ctrl_t *ctrl);
00483 
00484 uvc_error_t uvc_start_streaming(
00485     uvc_device_handle_t *devh,
00486     uvc_stream_ctrl_t *ctrl,
00487     uvc_frame_callback_t *cb,
00488     void *user_ptr,
00489     uint8_t flags,
00490     int num_transfer_buffers);
00491 
00492 uvc_error_t uvc_start_iso_streaming(
00493     uvc_device_handle_t *devh,
00494     uvc_stream_ctrl_t *ctrl,
00495     uvc_frame_callback_t *cb,
00496     void *user_ptr);
00497 
00498 void uvc_stop_streaming(uvc_device_handle_t *devh);
00499 
00500 uvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh, uvc_stream_handle_t **strmh, uvc_stream_ctrl_t *ctrl);
00501 uvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl);
00502 uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
00503     uvc_frame_callback_t *cb,
00504     void *user_ptr,
00505     uint8_t flags,
00506     int num_transfer_buffers);
00507 uvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,
00508     uvc_frame_callback_t *cb,
00509     void *user_ptr);
00510 uvc_error_t uvc_stream_get_frame(
00511     uvc_stream_handle_t *strmh,
00512     uvc_frame_t **frame,
00513     int32_t timeout_us
00514 );
00515 uvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh);
00516 void uvc_stream_close(uvc_stream_handle_t *strmh);
00517 
00518 int uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl);
00519 int uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len, enum uvc_req_code req_code);
00520 int uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len);
00521 
00522 uvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode *mode, enum uvc_req_code req_code);
00523 uvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode mode);
00524 
00525 /* AUTO-GENERATED control accessors! Update them with the output of `ctrl-gen.py decl`. */
00526 uvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
00527 uvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, uint8_t mode);
00528 
00529 uvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
00530 uvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, uint8_t mode);
00531 
00532 uvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t* priority, enum uvc_req_code req_code);
00533 uvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority);
00534 
00535 uvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, uint32_t* time, enum uvc_req_code req_code);
00536 uvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, uint32_t time);
00537 
00538 uvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int8_t* step, enum uvc_req_code req_code);
00539 uvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int8_t step);
00540 
00541 uvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, uint16_t* focus, enum uvc_req_code req_code);
00542 uvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, uint16_t focus);
00543 
00544 uvc_error_t uvc_get_focus_rel(uvc_device_handle_t *devh, int8_t* focus_rel, uint8_t* speed, enum uvc_req_code req_code);
00545 uvc_error_t uvc_set_focus_rel(uvc_device_handle_t *devh, int8_t focus_rel, uint8_t speed);
00546 
00547 uvc_error_t uvc_get_focus_simple_range(uvc_device_handle_t *devh, uint8_t* focus, enum uvc_req_code req_code);
00548 uvc_error_t uvc_set_focus_simple_range(uvc_device_handle_t *devh, uint8_t focus);
00549 
00550 uvc_error_t uvc_get_focus_auto(uvc_device_handle_t *devh, uint8_t* state, enum uvc_req_code req_code);
00551 uvc_error_t uvc_set_focus_auto(uvc_device_handle_t *devh, uint8_t state);
00552 
00553 uvc_error_t uvc_get_iris_abs(uvc_device_handle_t *devh, uint16_t* iris, enum uvc_req_code req_code);
00554 uvc_error_t uvc_set_iris_abs(uvc_device_handle_t *devh, uint16_t iris);
00555 
00556 uvc_error_t uvc_get_iris_rel(uvc_device_handle_t *devh, uint8_t* iris_rel, enum uvc_req_code req_code);
00557 uvc_error_t uvc_set_iris_rel(uvc_device_handle_t *devh, uint8_t iris_rel);
00558 
00559 uvc_error_t uvc_get_zoom_abs(uvc_device_handle_t *devh, uint16_t* focal_length, enum uvc_req_code req_code);
00560 uvc_error_t uvc_set_zoom_abs(uvc_device_handle_t *devh, uint16_t focal_length);
00561 
00562 uvc_error_t uvc_get_zoom_rel(uvc_device_handle_t *devh, int8_t* zoom_rel, uint8_t* digital_zoom, uint8_t* speed, enum uvc_req_code req_code);
00563 uvc_error_t uvc_set_zoom_rel(uvc_device_handle_t *devh, int8_t zoom_rel, uint8_t digital_zoom, uint8_t speed);
00564 
00565 uvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int32_t* pan, int32_t* tilt, enum uvc_req_code req_code);
00566 uvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int32_t pan, int32_t tilt);
00567 
00568 uvc_error_t uvc_get_pantilt_rel(uvc_device_handle_t *devh, int8_t* pan_rel, uint8_t* pan_speed, int8_t* tilt_rel, uint8_t* tilt_speed, enum uvc_req_code req_code);
00569 uvc_error_t uvc_set_pantilt_rel(uvc_device_handle_t *devh, int8_t pan_rel, uint8_t pan_speed, int8_t tilt_rel, uint8_t tilt_speed);
00570 
00571 uvc_error_t uvc_get_roll_abs(uvc_device_handle_t *devh, int16_t* roll, enum uvc_req_code req_code);
00572 uvc_error_t uvc_set_roll_abs(uvc_device_handle_t *devh, int16_t roll);
00573 
00574 uvc_error_t uvc_get_roll_rel(uvc_device_handle_t *devh, int8_t* roll_rel, uint8_t* speed, enum uvc_req_code req_code);
00575 uvc_error_t uvc_set_roll_rel(uvc_device_handle_t *devh, int8_t roll_rel, uint8_t speed);
00576 
00577 uvc_error_t uvc_get_privacy(uvc_device_handle_t *devh, uint8_t* privacy, enum uvc_req_code req_code);
00578 uvc_error_t uvc_set_privacy(uvc_device_handle_t *devh, uint8_t privacy);
00579 
00580 uvc_error_t uvc_get_digital_window(uvc_device_handle_t *devh, uint16_t* window_top, uint16_t* window_left, uint16_t* window_bottom, uint16_t* window_right, uint16_t* num_steps, uint16_t* num_steps_units, enum uvc_req_code req_code);
00581 uvc_error_t uvc_set_digital_window(uvc_device_handle_t *devh, uint16_t window_top, uint16_t window_left, uint16_t window_bottom, uint16_t window_right, uint16_t num_steps, uint16_t num_steps_units);
00582 
00583 uvc_error_t uvc_get_digital_roi(uvc_device_handle_t *devh, uint16_t* roi_top, uint16_t* roi_left, uint16_t* roi_bottom, uint16_t* roi_right, uint16_t* auto_controls, enum uvc_req_code req_code);
00584 uvc_error_t uvc_set_digital_roi(uvc_device_handle_t *devh, uint16_t roi_top, uint16_t roi_left, uint16_t roi_bottom, uint16_t roi_right, uint16_t auto_controls);
00585 
00586 uvc_error_t uvc_get_backlight_compensation(uvc_device_handle_t *devh, uint16_t* backlight_compensation, enum uvc_req_code req_code);
00587 uvc_error_t uvc_set_backlight_compensation(uvc_device_handle_t *devh, uint16_t backlight_compensation);
00588 
00589 uvc_error_t uvc_get_brightness(uvc_device_handle_t *devh, int16_t* brightness, enum uvc_req_code req_code);
00590 uvc_error_t uvc_set_brightness(uvc_device_handle_t *devh, int16_t brightness);
00591 
00592 uvc_error_t uvc_get_contrast(uvc_device_handle_t *devh, uint16_t* contrast, enum uvc_req_code req_code);
00593 uvc_error_t uvc_set_contrast(uvc_device_handle_t *devh, uint16_t contrast);
00594 
00595 uvc_error_t uvc_get_contrast_auto(uvc_device_handle_t *devh, uint8_t* contrast_auto, enum uvc_req_code req_code);
00596 uvc_error_t uvc_set_contrast_auto(uvc_device_handle_t *devh, uint8_t contrast_auto);
00597 
00598 uvc_error_t uvc_get_gain(uvc_device_handle_t *devh, uint16_t* gain, enum uvc_req_code req_code);
00599 uvc_error_t uvc_set_gain(uvc_device_handle_t *devh, uint16_t gain);
00600 
00601 uvc_error_t uvc_get_power_line_frequency(uvc_device_handle_t *devh, uint8_t* power_line_frequency, enum uvc_req_code req_code);
00602 uvc_error_t uvc_set_power_line_frequency(uvc_device_handle_t *devh, uint8_t power_line_frequency);
00603 
00604 uvc_error_t uvc_get_hue(uvc_device_handle_t *devh, int16_t* hue, enum uvc_req_code req_code);
00605 uvc_error_t uvc_set_hue(uvc_device_handle_t *devh, int16_t hue);
00606 
00607 uvc_error_t uvc_get_hue_auto(uvc_device_handle_t *devh, uint8_t* hue_auto, enum uvc_req_code req_code);
00608 uvc_error_t uvc_set_hue_auto(uvc_device_handle_t *devh, uint8_t hue_auto);
00609 
00610 uvc_error_t uvc_get_saturation(uvc_device_handle_t *devh, uint16_t* saturation, enum uvc_req_code req_code);
00611 uvc_error_t uvc_set_saturation(uvc_device_handle_t *devh, uint16_t saturation);
00612 
00613 uvc_error_t uvc_get_sharpness(uvc_device_handle_t *devh, uint16_t* sharpness, enum uvc_req_code req_code);
00614 uvc_error_t uvc_set_sharpness(uvc_device_handle_t *devh, uint16_t sharpness);
00615 
00616 uvc_error_t uvc_get_gamma(uvc_device_handle_t *devh, uint16_t* gamma, enum uvc_req_code req_code);
00617 uvc_error_t uvc_set_gamma(uvc_device_handle_t *devh, uint16_t gamma);
00618 
00619 uvc_error_t uvc_get_white_balance_temperature(uvc_device_handle_t *devh, uint16_t* temperature, enum uvc_req_code req_code);
00620 uvc_error_t uvc_set_white_balance_temperature(uvc_device_handle_t *devh, uint16_t temperature);
00621 
00622 uvc_error_t uvc_get_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t* temperature_auto, enum uvc_req_code req_code);
00623 uvc_error_t uvc_set_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t temperature_auto);
00624 
00625 uvc_error_t uvc_get_white_balance_component(uvc_device_handle_t *devh, uint16_t* blue, uint16_t* red, enum uvc_req_code req_code);
00626 uvc_error_t uvc_set_white_balance_component(uvc_device_handle_t *devh, uint16_t blue, uint16_t red);
00627 
00628 uvc_error_t uvc_get_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t* white_balance_component_auto, enum uvc_req_code req_code);
00629 uvc_error_t uvc_set_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t white_balance_component_auto);
00630 
00631 uvc_error_t uvc_get_digital_multiplier(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
00632 uvc_error_t uvc_set_digital_multiplier(uvc_device_handle_t *devh, uint16_t multiplier_step);
00633 
00634 uvc_error_t uvc_get_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
00635 uvc_error_t uvc_set_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t multiplier_step);
00636 
00637 uvc_error_t uvc_get_analog_video_standard(uvc_device_handle_t *devh, uint8_t* video_standard, enum uvc_req_code req_code);
00638 uvc_error_t uvc_set_analog_video_standard(uvc_device_handle_t *devh, uint8_t video_standard);
00639 
00640 uvc_error_t uvc_get_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t* status, enum uvc_req_code req_code);
00641 uvc_error_t uvc_set_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t status);
00642 
00643 uvc_error_t uvc_get_input_select(uvc_device_handle_t *devh, uint8_t* selector, enum uvc_req_code req_code);
00644 uvc_error_t uvc_set_input_select(uvc_device_handle_t *devh, uint8_t selector);
00645 /* end AUTO-GENERATED control accessors */
00646 
00647 void uvc_perror(uvc_error_t err, const char *msg);
00648 const char* uvc_strerror(uvc_error_t err);
00649 void uvc_print_diag(uvc_device_handle_t *devh, FILE *stream);
00650 void uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream);
00651 
00652 uvc_frame_t *uvc_allocate_frame(size_t data_bytes);
00653 void uvc_free_frame(uvc_frame_t *frame);
00654 
00655 uvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out);
00656 
00657 #ifdef __cplusplus
00658 }
00659 #endif
00660 
00661 #endif // !def(LIBUVC_H)
00662 


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:39