USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
UVC - USB Video Class (webcam)
+ Collaboration diagram for UVC - USB Video Class (webcam):

Files

file  uvc.h
 USB Video Class (webcam) device class, app API.
 

Data Structures

struct  uvc_opts
 UVC configuration: frame geometry, advertised formats, and a frame source. More...
 

Macros

#define UVC_HAS_YUYV
 opts.formats bit: advertise packed YUYV
 
#define UVC_HAS_MJPEG
 opts.formats bit: advertise MJPEG
 

Typedefs

typedef struct uvc_cam uvc_cam
 One UVC camera function: a single instance of the class on a device.
 

Functions

uvc_camuvc_add (usbip_device *dev, const uvc_opts *opts)
 Add a UVC camera interface to a device.
 
void uvc_color_bars_yuyv (uint8_t *buf, int width, int height, uint32_t index)
 Render one frame of the built-in animated color-bar test pattern (packed YUYV).
 

Variables

const usbip_device_class usbip_device_uvc
 The UVC video class, for usbip_device_add_class()
 

Detailed Description

Macro Definition Documentation

◆ UVC_HAS_YUYV

#define UVC_HAS_YUYV

opts.formats bit: advertise packed YUYV

◆ UVC_HAS_MJPEG

#define UVC_HAS_MJPEG

opts.formats bit: advertise MJPEG

Typedef Documentation

◆ uvc_cam

typedef struct uvc_cam uvc_cam

One UVC camera function: a single instance of the class on a device.

Opaque - create one with uvc_add() and use the functions below. Distinct from the other classes' handles, so mixing them up is a compile error rather than a misread state block.

Function Documentation

◆ uvc_add()

uvc_cam * uvc_add ( usbip_device dev,
const uvc_opts opts 
)

Add a UVC camera interface to a device.

Sets the device class to USB_CLASS_MISC / USB_SUBCLASS_COMMON / USB_PROTOCOL_IAD (0xEF/0x02/0x01).

Parameters
devthe device.
optsframe geometry, advertised formats and a frame source (see uvc_opts).
Returns
the new function, or NULL on error.

◆ uvc_color_bars_yuyv()

void uvc_color_bars_yuyv ( uint8_t *  buf,
int  width,
int  height,
uint32_t  index 
)

Render one frame of the built-in animated color-bar test pattern (packed YUYV).

Exposed so an app's next_frame can build pixels to encode (e.g. to MJPEG).

Parameters
bufoutput buffer (>= width * height * 2 bytes).
widthframe width in pixels.
heightframe height in pixels.
indexrunning frame counter (animates the bars).

Variable Documentation

◆ usbip_device_uvc

const usbip_device_class usbip_device_uvc
extern

The UVC video class, for usbip_device_add_class()