8 #include <stdio.h> // FILE
11 #include <libuvc/libuvc_config.h>
13 struct libusb_context;
14 struct libusb_device_handle;
16 /** UVC error types, based on libusb errors
19 typedef enum uvc_error {
20 /** Success (no error) */
22 /** Input/output error */
24 /** Invalid parameter */
25 UVC_ERROR_INVALID_PARAM = -2,
27 UVC_ERROR_ACCESS = -3,
29 UVC_ERROR_NO_DEVICE = -4,
30 /** Entity not found */
31 UVC_ERROR_NOT_FOUND = -5,
34 /** Operation timed out */
35 UVC_ERROR_TIMEOUT = -7,
37 UVC_ERROR_OVERFLOW = -8,
40 /** System call interrupted */
41 UVC_ERROR_INTERRUPTED = -10,
42 /** Insufficient memory */
43 UVC_ERROR_NO_MEM = -11,
44 /** Operation not supported */
45 UVC_ERROR_NOT_SUPPORTED = -12,
46 /** Device is not UVC-compliant */
47 UVC_ERROR_INVALID_DEVICE = -50,
48 /** Mode not supported */
49 UVC_ERROR_INVALID_MODE = -51,
50 /** Resource has a callback (can't use polling and async) */
51 UVC_ERROR_CALLBACK_EXISTS = -52,
52 /** Undefined error */
56 /** Color coding of stream, transport-independent
59 enum uvc_frame_format {
60 UVC_FRAME_FORMAT_UNKNOWN = 0,
61 /** Any supported format */
62 UVC_FRAME_FORMAT_ANY = 0,
63 UVC_FRAME_FORMAT_UNCOMPRESSED,
64 UVC_FRAME_FORMAT_COMPRESSED,
65 /** YUYV/YUV2/YUV422: YUV encoding with one luminance value per pixel and
66 * one UV (chrominance) pair for every two pixels.
68 UVC_FRAME_FORMAT_YUYV,
69 UVC_FRAME_FORMAT_UYVY,
73 /** Motion-JPEG (or JPEG) encoded images */
74 UVC_FRAME_FORMAT_MJPEG,
75 /** Greyscale images */
76 UVC_FRAME_FORMAT_GRAY8,
77 UVC_FRAME_FORMAT_GRAY16,
78 /* Raw colour mosaic images */
80 UVC_FRAME_FORMAT_BA81,
81 UVC_FRAME_FORMAT_SGRBG8,
82 UVC_FRAME_FORMAT_SGBRG8,
83 UVC_FRAME_FORMAT_SRGGB8,
84 UVC_FRAME_FORMAT_SBGGR8,
85 /** Number of formats understood */
86 UVC_FRAME_FORMAT_COUNT,
89 /* UVC_COLOR_FORMAT_* have been replaced with UVC_FRAME_FORMAT_*. Please use
90 * UVC_FRAME_FORMAT_* instead of using these. */
91 #define UVC_COLOR_FORMAT_UNKNOWN UVC_FRAME_FORMAT_UNKNOWN
92 #define UVC_COLOR_FORMAT_UNCOMPRESSED UVC_FRAME_FORMAT_UNCOMPRESSED
93 #define UVC_COLOR_FORMAT_COMPRESSED UVC_FRAME_FORMAT_COMPRESSED
94 #define UVC_COLOR_FORMAT_YUYV UVC_FRAME_FORMAT_YUYV
95 #define UVC_COLOR_FORMAT_UYVY UVC_FRAME_FORMAT_UYVY
96 #define UVC_COLOR_FORMAT_RGB UVC_FRAME_FORMAT_RGB
97 #define UVC_COLOR_FORMAT_BGR UVC_FRAME_FORMAT_BGR
98 #define UVC_COLOR_FORMAT_MJPEG UVC_FRAME_FORMAT_MJPEG
99 #define UVC_COLOR_FORMAT_GRAY8 UVC_FRAME_FORMAT_GRAY8
100 #define UVC_COLOR_FORMAT_GRAY16 UVC_FRAME_FORMAT_GRAY16
102 /** VideoStreaming interface descriptor subtype (A.6) */
103 enum uvc_vs_desc_subtype {
104 UVC_VS_UNDEFINED = 0x00,
105 UVC_VS_INPUT_HEADER = 0x01,
106 UVC_VS_OUTPUT_HEADER = 0x02,
107 UVC_VS_STILL_IMAGE_FRAME = 0x03,
108 UVC_VS_FORMAT_UNCOMPRESSED = 0x04,
109 UVC_VS_FRAME_UNCOMPRESSED = 0x05,
110 UVC_VS_FORMAT_MJPEG = 0x06,
111 UVC_VS_FRAME_MJPEG = 0x07,
112 UVC_VS_FORMAT_MPEG2TS = 0x0a,
113 UVC_VS_FORMAT_DV = 0x0c,
114 UVC_VS_COLORFORMAT = 0x0d,
115 UVC_VS_FORMAT_FRAME_BASED = 0x10,
116 UVC_VS_FRAME_FRAME_BASED = 0x11,
117 UVC_VS_FORMAT_STREAM_BASED = 0x12
120 struct uvc_format_desc;
121 struct uvc_frame_desc;
125 * A "frame" is a configuration of a streaming format
126 * for a particular image size at one of possibly several
127 * available frame rates.
129 typedef struct uvc_frame_desc {
130 struct uvc_format_desc *parent;
131 struct uvc_frame_desc *prev, *next;
132 /** Type of frame, such as JPEG frame or uncompressed frme */
133 enum uvc_vs_desc_subtype bDescriptorSubtype;
134 /** Index of the frame within the list of specs available for this format */
136 uint8_t bmCapabilities;
141 /** Bitrate of corresponding stream at minimal frame rate */
142 uint32_t dwMinBitRate;
143 /** Bitrate of corresponding stream at maximal frame rate */
144 uint32_t dwMaxBitRate;
145 /** Maximum number of bytes for a video frame */
146 uint32_t dwMaxVideoFrameBufferSize;
147 /** Default frame interval (in 100ns units) */
148 uint32_t dwDefaultFrameInterval;
149 /** Minimum frame interval for continuous mode (100ns units) */
150 uint32_t dwMinFrameInterval;
151 /** Maximum frame interval for continuous mode (100ns units) */
152 uint32_t dwMaxFrameInterval;
153 /** Granularity of frame interval range for continuous mode (100ns) */
154 uint32_t dwFrameIntervalStep;
155 /** Frame intervals */
156 uint8_t bFrameIntervalType;
157 /** number of bytes per line */
158 uint32_t dwBytesPerLine;
159 /** Available frame rates, zero-terminated (in 100ns units) */
163 /** Format descriptor
165 * A "format" determines a stream's image type (e.g., raw YUYV or JPEG)
166 * and includes many "frame" configurations.
168 typedef struct uvc_format_desc {
169 struct uvc_streaming_interface *parent;
170 struct uvc_format_desc *prev, *next;
171 /** Type of image stream, such as JPEG or uncompressed. */
172 enum uvc_vs_desc_subtype bDescriptorSubtype;
173 /** Identifier of this format within the VS interface's format list */
174 uint8_t bFormatIndex;
175 uint8_t bNumFrameDescriptors;
176 /** Format specifier */
178 uint8_t guidFormat[16];
179 uint8_t fourccFormat[4];
181 /** Format-specific data */
183 /** BPP for uncompressed stream */
184 uint8_t bBitsPerPixel;
185 /** Flags for JPEG stream */
188 /** Default {uvc_frame_desc} to choose given this format */
189 uint8_t bDefaultFrameIndex;
190 uint8_t bAspectRatioX;
191 uint8_t bAspectRatioY;
192 uint8_t bmInterlaceFlags;
193 uint8_t bCopyProtect;
194 uint8_t bVariableSize;
195 /** Available frame specifications for this format */
196 struct uvc_frame_desc *frame_descs;
199 /** UVC request code (A.8) */
201 UVC_RC_UNDEFINED = 0x00,
212 enum uvc_device_power_mode {
213 UVC_VC_VIDEO_POWER_MODE_FULL = 0x000b,
214 UVC_VC_VIDEO_POWER_MODE_DEVICE_DEPENDENT = 0x001b,
217 /** Camera terminal control selector (A.9.4) */
218 enum uvc_ct_ctrl_selector {
219 UVC_CT_CONTROL_UNDEFINED = 0x00,
220 UVC_CT_SCANNING_MODE_CONTROL = 0x01,
221 UVC_CT_AE_MODE_CONTROL = 0x02,
222 UVC_CT_AE_PRIORITY_CONTROL = 0x03,
223 UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,
224 UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,
225 UVC_CT_FOCUS_ABSOLUTE_CONTROL = 0x06,
226 UVC_CT_FOCUS_RELATIVE_CONTROL = 0x07,
227 UVC_CT_FOCUS_AUTO_CONTROL = 0x08,
228 UVC_CT_IRIS_ABSOLUTE_CONTROL = 0x09,
229 UVC_CT_IRIS_RELATIVE_CONTROL = 0x0a,
230 UVC_CT_ZOOM_ABSOLUTE_CONTROL = 0x0b,
231 UVC_CT_ZOOM_RELATIVE_CONTROL = 0x0c,
232 UVC_CT_PANTILT_ABSOLUTE_CONTROL = 0x0d,
233 UVC_CT_PANTILT_RELATIVE_CONTROL = 0x0e,
234 UVC_CT_ROLL_ABSOLUTE_CONTROL = 0x0f,
235 UVC_CT_ROLL_RELATIVE_CONTROL = 0x10,
236 UVC_CT_PRIVACY_CONTROL = 0x11,
237 UVC_CT_FOCUS_SIMPLE_CONTROL = 0x12,
238 UVC_CT_DIGITAL_WINDOW_CONTROL = 0x13,
239 UVC_CT_REGION_OF_INTEREST_CONTROL = 0x14
242 /** Processing unit control selector (A.9.5) */
243 enum uvc_pu_ctrl_selector {
244 UVC_PU_CONTROL_UNDEFINED = 0x00,
245 UVC_PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,
246 UVC_PU_BRIGHTNESS_CONTROL = 0x02,
247 UVC_PU_CONTRAST_CONTROL = 0x03,
248 UVC_PU_GAIN_CONTROL = 0x04,
249 UVC_PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,
250 UVC_PU_HUE_CONTROL = 0x06,
251 UVC_PU_SATURATION_CONTROL = 0x07,
252 UVC_PU_SHARPNESS_CONTROL = 0x08,
253 UVC_PU_GAMMA_CONTROL = 0x09,
254 UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0a,
255 UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0b,
256 UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0c,
257 UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0d,
258 UVC_PU_DIGITAL_MULTIPLIER_CONTROL = 0x0e,
259 UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0f,
260 UVC_PU_HUE_AUTO_CONTROL = 0x10,
261 UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL = 0x11,
262 UVC_PU_ANALOG_LOCK_STATUS_CONTROL = 0x12,
263 UVC_PU_CONTRAST_AUTO_CONTROL = 0x13
266 /** USB terminal type (B.1) */
268 UVC_TT_VENDOR_SPECIFIC = 0x0100,
269 UVC_TT_STREAMING = 0x0101
272 /** Input terminal type (B.2) */
274 UVC_ITT_VENDOR_SPECIFIC = 0x0200,
275 UVC_ITT_CAMERA = 0x0201,
276 UVC_ITT_MEDIA_TRANSPORT_INPUT = 0x0202
279 /** Output terminal type (B.3) */
281 UVC_OTT_VENDOR_SPECIFIC = 0x0300,
282 UVC_OTT_DISPLAY = 0x0301,
283 UVC_OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302
286 /** External terminal type (B.4) */
288 UVC_EXTERNAL_VENDOR_SPECIFIC = 0x0400,
289 UVC_COMPOSITE_CONNECTOR = 0x0401,
290 UVC_SVIDEO_CONNECTOR = 0x0402,
291 UVC_COMPONENT_CONNECTOR = 0x0403
294 /** Context, equivalent to libusb's contexts.
296 * May either own a libusb context or use one that's already made.
298 * Always create these with uvc_get_context.
301 typedef struct uvc_context uvc_context_t;
305 * Get this from uvc_get_device_list() or uvc_find_device().
308 typedef struct uvc_device uvc_device_t;
310 /** Handle on an open UVC device.
312 * Get one of these from uvc_open(). Once you uvc_close()
313 * it, it's no longer valid.
315 struct uvc_device_handle;
316 typedef struct uvc_device_handle uvc_device_handle_t;
318 /** Handle on an open UVC stream.
320 * Get one of these from uvc_stream_open*().
321 * Once you uvc_stream_close() it, it will no longer be valid.
323 struct uvc_stream_handle;
324 typedef struct uvc_stream_handle uvc_stream_handle_t;
326 /** Representation of the interface that brings data into the UVC device */
327 typedef struct uvc_input_terminal {
328 struct uvc_input_terminal *prev, *next;
329 /** Index of the terminal within the device */
331 /** Type of terminal (e.g., camera) */
332 enum uvc_it_type wTerminalType;
333 uint16_t wObjectiveFocalLengthMin;
334 uint16_t wObjectiveFocalLengthMax;
335 uint16_t wOcularFocalLength;
336 /** Camera controls (meaning of bits given in {uvc_ct_ctrl_selector}) */
338 } uvc_input_terminal_t;
340 typedef struct uvc_output_terminal {
341 struct uvc_output_terminal *prev, *next;
343 } uvc_output_terminal_t;
345 /** Represents post-capture processing functions */
346 typedef struct uvc_processing_unit {
347 struct uvc_processing_unit *prev, *next;
348 /** Index of the processing unit within the device */
350 /** Index of the terminal from which the device accepts images */
352 /** Processing controls (meaning of bits given in {uvc_pu_ctrl_selector}) */
354 } uvc_processing_unit_t;
356 /** Represents selector unit to connect other units */
357 typedef struct uvc_selector_unit {
358 struct uvc_selector_unit *prev, *next;
359 /** Index of the selector unit within the device */
361 } uvc_selector_unit_t;
363 /** Custom processing or camera-control functions */
364 typedef struct uvc_extension_unit {
365 struct uvc_extension_unit *prev, *next;
366 /** Index of the extension unit within the device */
368 /** GUID identifying the extension unit */
369 uint8_t guidExtensionCode[16];
370 /** Bitmap of available controls (manufacturer-dependent) */
372 } uvc_extension_unit_t;
374 enum uvc_status_class {
375 UVC_STATUS_CLASS_CONTROL = 0x10,
376 UVC_STATUS_CLASS_CONTROL_CAMERA = 0x11,
377 UVC_STATUS_CLASS_CONTROL_PROCESSING = 0x12,
380 enum uvc_status_attribute {
381 UVC_STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00,
382 UVC_STATUS_ATTRIBUTE_INFO_CHANGE = 0x01,
383 UVC_STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02,
384 UVC_STATUS_ATTRIBUTE_UNKNOWN = 0xff
387 /** A callback function to accept status updates
390 typedef void(uvc_status_callback_t)(enum uvc_status_class status_class,
393 enum uvc_status_attribute status_attribute,
394 void *data, size_t data_len,
397 /** A callback function to accept button events
400 typedef void(uvc_button_callback_t)(int button,
404 /** Structure representing a UVC device descriptor.
406 * (This isn't a standard structure.)
408 typedef struct uvc_device_descriptor {
413 /** UVC compliance level, e.g. 0x0100 (1.0), 0x0110 */
415 /** Serial number (null if unavailable) */
416 const char *serialNumber;
417 /** Device-reported manufacturer name (or null) */
418 const char *manufacturer;
419 /** Device-reporter product name (or null) */
421 } uvc_device_descriptor_t;
423 /** An image frame received from the UVC device
426 typedef struct uvc_frame {
427 /** Image data for this frame */
429 /** Size of image data buffer */
431 /** Width of image in pixels */
433 /** Height of image in pixels */
435 /** Pixel data format */
436 enum uvc_frame_format frame_format;
437 /** Number of bytes per horizontal line (undefined for compressed format) */
439 /** Frame number (may skip, but is strictly monotonically increasing) */
441 /** Estimate of system time when the device started capturing the image */
442 struct timeval capture_time;
443 /** Handle on the device that produced the image.
444 * @warning You must not call any uvc_* functions during a callback. */
445 uvc_device_handle_t *source;
446 /** Is the data buffer owned by the library?
447 * If 1, the data buffer can be arbitrarily reallocated by frame conversion
449 * If 0, the data buffer will not be reallocated or freed by the library.
450 * Set this field to zero if you are supplying the buffer.
452 uint8_t library_owns_data;
455 /** A callback function to handle incoming assembled UVC frames
458 typedef void(uvc_frame_callback_t)(struct uvc_frame *frame, void *user_ptr);
460 /** Streaming mode, includes all information needed to select stream
463 typedef struct uvc_stream_ctrl {
465 uint8_t bFormatIndex;
467 uint32_t dwFrameInterval;
468 uint16_t wKeyFrameRate;
469 uint16_t wPFrameRate;
470 uint16_t wCompQuality;
471 uint16_t wCompWindowSize;
473 uint32_t dwMaxVideoFrameSize;
474 uint32_t dwMaxPayloadTransferSize;
475 uint32_t dwClockFrequency;
476 uint8_t bmFramingInfo;
477 uint8_t bPreferredVersion;
480 uint8_t bInterfaceNumber;
483 uvc_error_t uvc_init(uvc_context_t **ctx, struct libusb_context *usb_ctx);
484 void uvc_exit(uvc_context_t *ctx);
486 uvc_error_t uvc_get_device_list(
488 uvc_device_t ***list);
489 void uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices);
491 uvc_error_t uvc_get_device_descriptor(
493 uvc_device_descriptor_t **desc);
494 void uvc_free_device_descriptor(
495 uvc_device_descriptor_t *desc);
497 uint8_t uvc_get_bus_number(uvc_device_t *dev);
498 uint8_t uvc_get_device_address(uvc_device_t *dev);
500 uvc_error_t uvc_find_device(
503 int vid, int pid, const char *sn);
505 uvc_error_t uvc_find_devices(
507 uvc_device_t ***devs,
508 int vid, int pid, const char *sn);
510 uvc_error_t uvc_get_device_with_fd(uvc_context_t *ctx, uvc_device_t **device,
511 int vid, int pid, const char *serial, int fd, int busnum, int devaddr);
513 uvc_error_t uvc_open(
515 uvc_device_handle_t **devh);
516 void uvc_close(uvc_device_handle_t *devh);
518 uvc_device_t *uvc_get_device(uvc_device_handle_t *devh);
519 struct libusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh);
521 void uvc_ref_device(uvc_device_t *dev);
522 void uvc_unref_device(uvc_device_t *dev);
524 void uvc_set_status_callback(uvc_device_handle_t *devh,
525 uvc_status_callback_t cb,
528 void uvc_set_button_callback(uvc_device_handle_t *devh,
529 uvc_button_callback_t cb,
532 const uvc_input_terminal_t *uvc_get_camera_terminal(uvc_device_handle_t *devh);
533 const uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh);
534 const uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh);
535 const uvc_selector_unit_t *uvc_get_selector_units(uvc_device_handle_t *devh);
536 const uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh);
537 const uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh);
539 uvc_error_t uvc_get_stream_ctrl_format_size(
540 uvc_device_handle_t *devh,
541 uvc_stream_ctrl_t *ctrl,
542 enum uvc_frame_format format,
543 int width, int height,
547 const uvc_format_desc_t *uvc_get_format_descs(uvc_device_handle_t* );
549 uvc_error_t uvc_probe_stream_ctrl(
550 uvc_device_handle_t *devh,
551 uvc_stream_ctrl_t *ctrl);
553 uvc_error_t uvc_start_streaming(
554 uvc_device_handle_t *devh,
555 uvc_stream_ctrl_t *ctrl,
556 uvc_frame_callback_t *cb,
560 uvc_error_t uvc_start_iso_streaming(
561 uvc_device_handle_t *devh,
562 uvc_stream_ctrl_t *ctrl,
563 uvc_frame_callback_t *cb,
566 void uvc_stop_streaming(uvc_device_handle_t *devh);
568 uvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh, uvc_stream_handle_t **strmh, uvc_stream_ctrl_t *ctrl);
569 uvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl);
570 uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
571 uvc_frame_callback_t *cb,
574 uvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,
575 uvc_frame_callback_t *cb,
577 uvc_error_t uvc_stream_get_frame(
578 uvc_stream_handle_t *strmh,
582 uvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh);
583 void uvc_stream_close(uvc_stream_handle_t *strmh);
585 int uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl);
586 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);
587 int uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len);
589 uvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode *mode, enum uvc_req_code req_code);
590 uvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode mode);
592 /* AUTO-GENERATED control accessors! Update them with the output of `ctrl-gen.py decl`. */
593 uvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
594 uvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, uint8_t mode);
596 uvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, uint8_t* mode, enum uvc_req_code req_code);
597 uvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, uint8_t mode);
599 uvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t* priority, enum uvc_req_code req_code);
600 uvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority);
602 uvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, uint32_t* time, enum uvc_req_code req_code);
603 uvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, uint32_t time);
605 uvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int8_t* step, enum uvc_req_code req_code);
606 uvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int8_t step);
608 uvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, uint16_t* focus, enum uvc_req_code req_code);
609 uvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, uint16_t focus);
611 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);
612 uvc_error_t uvc_set_focus_rel(uvc_device_handle_t *devh, int8_t focus_rel, uint8_t speed);
614 uvc_error_t uvc_get_focus_simple_range(uvc_device_handle_t *devh, uint8_t* focus, enum uvc_req_code req_code);
615 uvc_error_t uvc_set_focus_simple_range(uvc_device_handle_t *devh, uint8_t focus);
617 uvc_error_t uvc_get_focus_auto(uvc_device_handle_t *devh, uint8_t* state, enum uvc_req_code req_code);
618 uvc_error_t uvc_set_focus_auto(uvc_device_handle_t *devh, uint8_t state);
620 uvc_error_t uvc_get_iris_abs(uvc_device_handle_t *devh, uint16_t* iris, enum uvc_req_code req_code);
621 uvc_error_t uvc_set_iris_abs(uvc_device_handle_t *devh, uint16_t iris);
623 uvc_error_t uvc_get_iris_rel(uvc_device_handle_t *devh, uint8_t* iris_rel, enum uvc_req_code req_code);
624 uvc_error_t uvc_set_iris_rel(uvc_device_handle_t *devh, uint8_t iris_rel);
626 uvc_error_t uvc_get_zoom_abs(uvc_device_handle_t *devh, uint16_t* focal_length, enum uvc_req_code req_code);
627 uvc_error_t uvc_set_zoom_abs(uvc_device_handle_t *devh, uint16_t focal_length);
629 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);
630 uvc_error_t uvc_set_zoom_rel(uvc_device_handle_t *devh, int8_t zoom_rel, uint8_t digital_zoom, uint8_t speed);
632 uvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int32_t* pan, int32_t* tilt, enum uvc_req_code req_code);
633 uvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int32_t pan, int32_t tilt);
635 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);
636 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);
638 uvc_error_t uvc_get_roll_abs(uvc_device_handle_t *devh, int16_t* roll, enum uvc_req_code req_code);
639 uvc_error_t uvc_set_roll_abs(uvc_device_handle_t *devh, int16_t roll);
641 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);
642 uvc_error_t uvc_set_roll_rel(uvc_device_handle_t *devh, int8_t roll_rel, uint8_t speed);
644 uvc_error_t uvc_get_privacy(uvc_device_handle_t *devh, uint8_t* privacy, enum uvc_req_code req_code);
645 uvc_error_t uvc_set_privacy(uvc_device_handle_t *devh, uint8_t privacy);
647 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);
648 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);
650 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);
651 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);
653 uvc_error_t uvc_get_backlight_compensation(uvc_device_handle_t *devh, uint16_t* backlight_compensation, enum uvc_req_code req_code);
654 uvc_error_t uvc_set_backlight_compensation(uvc_device_handle_t *devh, uint16_t backlight_compensation);
656 uvc_error_t uvc_get_brightness(uvc_device_handle_t *devh, int16_t* brightness, enum uvc_req_code req_code);
657 uvc_error_t uvc_set_brightness(uvc_device_handle_t *devh, int16_t brightness);
659 uvc_error_t uvc_get_contrast(uvc_device_handle_t *devh, uint16_t* contrast, enum uvc_req_code req_code);
660 uvc_error_t uvc_set_contrast(uvc_device_handle_t *devh, uint16_t contrast);
662 uvc_error_t uvc_get_contrast_auto(uvc_device_handle_t *devh, uint8_t* contrast_auto, enum uvc_req_code req_code);
663 uvc_error_t uvc_set_contrast_auto(uvc_device_handle_t *devh, uint8_t contrast_auto);
665 uvc_error_t uvc_get_gain(uvc_device_handle_t *devh, uint16_t* gain, enum uvc_req_code req_code);
666 uvc_error_t uvc_set_gain(uvc_device_handle_t *devh, uint16_t gain);
668 uvc_error_t uvc_get_power_line_frequency(uvc_device_handle_t *devh, uint8_t* power_line_frequency, enum uvc_req_code req_code);
669 uvc_error_t uvc_set_power_line_frequency(uvc_device_handle_t *devh, uint8_t power_line_frequency);
671 uvc_error_t uvc_get_hue(uvc_device_handle_t *devh, int16_t* hue, enum uvc_req_code req_code);
672 uvc_error_t uvc_set_hue(uvc_device_handle_t *devh, int16_t hue);
674 uvc_error_t uvc_get_hue_auto(uvc_device_handle_t *devh, uint8_t* hue_auto, enum uvc_req_code req_code);
675 uvc_error_t uvc_set_hue_auto(uvc_device_handle_t *devh, uint8_t hue_auto);
677 uvc_error_t uvc_get_saturation(uvc_device_handle_t *devh, uint16_t* saturation, enum uvc_req_code req_code);
678 uvc_error_t uvc_set_saturation(uvc_device_handle_t *devh, uint16_t saturation);
680 uvc_error_t uvc_get_sharpness(uvc_device_handle_t *devh, uint16_t* sharpness, enum uvc_req_code req_code);
681 uvc_error_t uvc_set_sharpness(uvc_device_handle_t *devh, uint16_t sharpness);
683 uvc_error_t uvc_get_gamma(uvc_device_handle_t *devh, uint16_t* gamma, enum uvc_req_code req_code);
684 uvc_error_t uvc_set_gamma(uvc_device_handle_t *devh, uint16_t gamma);
686 uvc_error_t uvc_get_white_balance_temperature(uvc_device_handle_t *devh, uint16_t* temperature, enum uvc_req_code req_code);
687 uvc_error_t uvc_set_white_balance_temperature(uvc_device_handle_t *devh, uint16_t temperature);
689 uvc_error_t uvc_get_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t* temperature_auto, enum uvc_req_code req_code);
690 uvc_error_t uvc_set_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t temperature_auto);
692 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);
693 uvc_error_t uvc_set_white_balance_component(uvc_device_handle_t *devh, uint16_t blue, uint16_t red);
695 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);
696 uvc_error_t uvc_set_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t white_balance_component_auto);
698 uvc_error_t uvc_get_digital_multiplier(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
699 uvc_error_t uvc_set_digital_multiplier(uvc_device_handle_t *devh, uint16_t multiplier_step);
701 uvc_error_t uvc_get_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t* multiplier_step, enum uvc_req_code req_code);
702 uvc_error_t uvc_set_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t multiplier_step);
704 uvc_error_t uvc_get_analog_video_standard(uvc_device_handle_t *devh, uint8_t* video_standard, enum uvc_req_code req_code);
705 uvc_error_t uvc_set_analog_video_standard(uvc_device_handle_t *devh, uint8_t video_standard);
707 uvc_error_t uvc_get_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t* status, enum uvc_req_code req_code);
708 uvc_error_t uvc_set_analog_video_lock_status(uvc_device_handle_t *devh, uint8_t status);
710 uvc_error_t uvc_get_input_select(uvc_device_handle_t *devh, uint8_t* selector, enum uvc_req_code req_code);
711 uvc_error_t uvc_set_input_select(uvc_device_handle_t *devh, uint8_t selector);
712 /* end AUTO-GENERATED control accessors */
714 void uvc_perror(uvc_error_t err, const char *msg);
715 const char* uvc_strerror(uvc_error_t err);
716 void uvc_print_diag(uvc_device_handle_t *devh, FILE *stream);
717 void uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream);
719 uvc_frame_t *uvc_allocate_frame(size_t data_bytes);
720 void uvc_free_frame(uvc_frame_t *frame);
722 uvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out);
724 uvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out);
725 uvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out);
726 uvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out);
728 uvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out);
729 uvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out);
730 uvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out);
732 uvc_error_t uvc_yuyv2y(uvc_frame_t *in, uvc_frame_t *out);
733 uvc_error_t uvc_yuyv2uv(uvc_frame_t *in, uvc_frame_t *out);
735 #ifdef LIBUVC_HAS_JPEG
736 uvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out);
743 #endif // !def(LIBUVC_H)