当前位置:编程学习 > C/C++ >>

uvc摄像头代码解析4

7.uvc_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: 

 


补充:软件开发 , C++ ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,