Typedefs | Functions
Device handling and enumeration

Support for finding, inspecting and opening UVC devices. More...

Typedefs

typedef voiduvc_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)
 

Functions

void uvc_close (uvc_device_handle_t *devh)
 Close a device. More...
 
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...
 
void uvc_free_device_descriptor (uvc_device_descriptor_t *desc)
 Frees a device descriptor created with uvc_get_device_descriptor. 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...
 
uint8_t uvc_get_bus_number (uvc_device_t *dev)
 Get the number of the bus to which the device is attached. More...
 
uvc_device_tuvc_get_device (uvc_device_handle_t *devh)
 Get the uvc_device_t corresponding to an open device. More...
 
uint8_t uvc_get_device_address (uvc_device_t *dev)
 Get the number assigned to the device within its bus. 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 deviceFree *desc with uvc_free_device_descriptor when you're done. 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...
 
libusb_device_handle * uvc_get_libusb_handle (uvc_device_handle_t *devh)
 Get the underlying libusb device handle for an open deviceThis can be used to access other interfaces on the same device, e.g. a webcam microphone. More...
 
uvc_error_t uvc_open (uvc_device_t *dev, uvc_device_handle_t **devh)
 Open a UVC device, defaulting to the first interface found. More...
 
uvc_error_t uvc_open2 (uvc_device_t *dev, uvc_device_handle_t **devh, int camera_number)
 Open a UVC device, specifying the camera number, zero-based. More...
 
void uvc_ref_device (uvc_device_t *dev)
 Increment the reference count for 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. More...
 

Detailed Description

Support for finding, inspecting and opening UVC devices.

Typedef Documentation

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

Definition at line 335 of file libuvc.h.

Function Documentation

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.

Definition at line 1412 of file dev.c.

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.

Parameters
[in]ctxUVC context in which to search for the camera
[out]devReference to the camera, or NULL if not found
[in]vidVendor ID number, optional
[in]pidProduct ID number, optional
[in]snSerial number or NULL
Returns
Error finding device or UVC_SUCCESS

Definition at line 126 of file dev.c.

void uvc_free_device_descriptor ( uvc_device_descriptor_t desc)

Frees a device descriptor created with uvc_get_device_descriptor.

Parameters
descDescriptor to free

Definition at line 504 of file dev.c.

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.

Parameters
listDevice list to free
unref_devicesDecrement the reference counter for each device in the list, and destroy any entries that end up with zero references

Definition at line 643 of file dev.c.

uint8_t uvc_get_bus_number ( uvc_device_t dev)

Get the number of the bus to which the device is attached.

Definition at line 180 of file dev.c.

uvc_device_t* uvc_get_device ( uvc_device_handle_t devh)

Get the uvc_device_t corresponding to an open device.

Note
Unref the uvc_device_t when you're done with it
Parameters
devhDevice handle to an open UVC device

Definition at line 668 of file dev.c.

uint8_t uvc_get_device_address ( uvc_device_t dev)

Get the number assigned to the device within its bus.

Definition at line 187 of file dev.c.

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 deviceFree *desc with uvc_free_device_descriptor when you're done.

Parameters
devDevice to fetch information about
[out]descDescriptor structure
Returns
Error if unable to fetch information, else SUCCESS

Definition at line 444 of file dev.c.

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.

Note
Free the list with uvc_free_device_list when you're done.
Parameters
ctxUVC context in which to list devices
listList of uvc_device structures
Returns
Error if unable to list devices, else SUCCESS

Definition at line 532 of file dev.c.

libusb_device_handle* uvc_get_libusb_handle ( uvc_device_handle_t devh)

Get the underlying libusb device handle for an open deviceThis can be used to access other interfaces on the same device, e.g. a webcam microphone.

Note
The libusb device handle is only valid while the UVC device is open; it will be invalidated upon calling uvc_close.
Parameters
devhUVC device handle to an open device

Definition at line 685 of file dev.c.

uvc_error_t uvc_open ( uvc_device_t dev,
uvc_device_handle_t **  devh 
)

Open a UVC device, defaulting to the first interface found.

Parameters
devDevice to open
[out]devhHandle on opened device
Returns
Error opening device or SUCCESS

Definition at line 200 of file dev.c.

uvc_error_t uvc_open2 ( uvc_device_t dev,
uvc_device_handle_t **  devh,
int  camera_number 
)

Open a UVC device, specifying the camera number, zero-based.

Parameters
devDevice to open
[out]devhHandle on opened device
camera_numberCamera to open
Returns
Error opening device or SUCCESS

Definition at line 215 of file dev.c.

void uvc_ref_device ( uvc_device_t dev)

Increment the reference count for a device.

Parameters
devDevice to reference

Definition at line 747 of file dev.c.

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.

Definition at line 1595 of file dev.c.



librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Fri Mar 13 2020 03:16:19