|
7.u
vc_parse_format
7.1 uvc格式描述符
struct uvc_format_desc { //uvc格式描述符
char *name; //uvc格式描述符名字
__u8 guid[16];//全局唯一ID
__u32 fcc; //压缩格式
};
7.2 uvc解析1个格式描述符
static int uvc_parse_format(struct uvc_device *dev,struct uvc_streaming *streaming, struct uvc_format *format,__u32 **intervals, unsigned char *buffer, int buflen)
{
struct usb_interface *intf = streaming->intf; //获取usb接口
struct usb_host_interface *alts = intf->cur_altsetting; //获取usb_host_interface
struct uvc_format_desc *fmtdesc; //uvc格式描述符
struct uvc_frame *frame; //uvc帧
const unsigned char *start = buffer;
unsigned int interval;
unsigned int i, n;
__u8 ftype;
format->type = buffer[2]; //uvc格式类型
format->index = buffer[3]; //uvc格式索引
switch (buffer[2]) { //uvc格式类型
case UVC_VS_FORMAT_UNCOMPRESSED:
|