libuvc
|
Support for finding, inspecting and opening UVC devices. More...
Typedefs | |
typedef void() | uvc_status_callback_t(enum uvc_status_class status_class, int event, int selector, enum uvc_status_attribute status_attribute, void *data, size_t data_len, void *user_ptr) |
A callback function to accept status updates. | |
typedef void() | uvc_button_callback_t(int button, int state, void *user_ptr) |
A callback function to accept button events. | |
Functions | |
uvc_error_t | uvc_find_device (uvc_context_t *ctx, uvc_device_t **dev, int vid, int pid, const char *sn) |
Finds a camera identified by vendor, product and/or serial number. More... | |
uvc_error_t | uvc_find_devices (uvc_context_t *ctx, uvc_device_t ***devs, int vid, int pid, const char *sn) |
Finds all cameras identified by vendor, product and/or serial number. More... | |
uint8_t | uvc_get_bus_number (uvc_device_t *dev) |
Get the number of the bus to which the device is attached. | |
uint8_t | uvc_get_device_address (uvc_device_t *dev) |
Get the number assigned to the device within its bus. | |
uvc_error_t | uvc_open (uvc_device_t *dev, uvc_device_handle_t **devh) |
Open a UVC device. More... | |
uvc_error_t | uvc_get_device_descriptor (uvc_device_t *dev, uvc_device_descriptor_t **desc) |
Get a descriptor that contains the general information about a device. More... | |
void | uvc_free_device_descriptor (uvc_device_descriptor_t *desc) |
Frees a device descriptor created with uvc_get_device_descriptor. More... | |
uvc_error_t | uvc_get_device_list (uvc_context_t *ctx, uvc_device_t ***list) |
Get a list of the UVC devices attached to the system. More... | |
void | uvc_free_device_list (uvc_device_t **list, uint8_t unref_devices) |
Frees a list of device structures created with uvc_get_device_list. More... | |
uvc_device_t * | uvc_get_device (uvc_device_handle_t *devh) |
Get the uvc_device_t corresponding to an open device. More... | |
libusb_device_handle * | uvc_get_libusb_handle (uvc_device_handle_t *devh) |
Get the underlying libusb device handle for an open device. More... | |
void | uvc_ref_device (uvc_device_t *dev) |
Increment the reference count for a device. More... | |
void | uvc_close (uvc_device_handle_t *devh) |
Close a device. More... | |
void | uvc_set_status_callback (uvc_device_handle_t *devh, uvc_status_callback_t cb, void *user_ptr) |
Set a callback function to receive status updates. | |
void | uvc_set_button_callback (uvc_device_handle_t *devh, uvc_button_callback_t cb, void *user_ptr) |
Set a callback function to receive button events. | |
Support for finding, inspecting and opening UVC devices.
uvc_error_t uvc_find_device | ( | uvc_context_t * | ctx, |
uvc_device_t ** | dev, | ||
int | vid, | ||
int | pid, | ||
const char * | sn | ||
) |
Finds a camera identified by vendor, product and/or serial number.
[in] | ctx | UVC context in which to search for the camera |
[out] | dev | Reference to the camera, or NULL if not found |
[in] | vid | Vendor ID number, optional |
[in] | pid | Product ID number, optional |
[in] | sn | Serial number or NULL |
uvc_error_t uvc_find_devices | ( | uvc_context_t * | ctx, |
uvc_device_t *** | devs, | ||
int | vid, | ||
int | pid, | ||
const char * | sn | ||
) |
Finds all cameras identified by vendor, product and/or serial number.
[in] | ctx | UVC context in which to search for the camera |
[out] | devs | List of matching cameras |
[in] | vid | Vendor ID number, optional |
[in] | pid | Product ID number, optional |
[in] | sn | Serial number or NULL |
uvc_error_t uvc_open | ( | uvc_device_t * | dev, |
uvc_device_handle_t ** | devh | ||
) |
Open a UVC device.
dev | Device to open | |
[out] | devh | Handle on opened device |
uvc_error_t uvc_get_device_descriptor | ( | uvc_device_t * | dev, |
uvc_device_descriptor_t ** | desc | ||
) |
Get a descriptor that contains the general information about a device.
Free *desc with uvc_free_device_descriptor when you're done.
dev | Device to fetch information about | |
[out] | desc | Descriptor structure |
void uvc_free_device_descriptor | ( | uvc_device_descriptor_t * | desc | ) |
Frees a device descriptor created with uvc_get_device_descriptor.
desc | Descriptor to free |
uvc_error_t uvc_get_device_list | ( | uvc_context_t * | ctx, |
uvc_device_t *** | list | ||
) |
Get a list of the UVC devices attached to the system.
ctx | UVC context in which to list devices |
list | List of uvc_device structures |
void uvc_free_device_list | ( | uvc_device_t ** | list, |
uint8_t | unref_devices | ||
) |
Frees a list of device structures created with uvc_get_device_list.
list | Device list to free |
unref_devices | Decrement the reference counter for each device in the list, and destroy any entries that end up with zero references |
uvc_device_t* uvc_get_device | ( | uvc_device_handle_t * | devh | ) |
Get the uvc_device_t corresponding to an open device.
devh | Device handle to an open UVC device |
libusb_device_handle* uvc_get_libusb_handle | ( | uvc_device_handle_t * | devh | ) |
Get the underlying libusb device handle for an open device.
This can be used to access other interfaces on the same device, e.g. a webcam microphone.
devh | UVC device handle to an open device |
void uvc_ref_device | ( | uvc_device_t * | dev | ) |
Increment the reference count for a device.
dev | Device to reference |
void uvc_close | ( | uvc_device_handle_t * | devh | ) |
Close a device.
Ends any stream that's in progress.
The device handle and frame structures will be invalidated.