[camera][v4l2][第五话]: UVC协议学习

1.  USB Video Camera Topology
 

a. T 代表terminal, U 代表unit (在程序里Unit/Terminal都称为entity)

 

b. 有两大interface

## VideoControl Interface :is used to control the inner workings of
the function // VC里含有多个Unit/Terminal等功能模块,可以通过访问这些模块进行控制,比如调亮度

ret = uvc_query_ctrl(dev  /* 哪一个USB设备 */, SET_CUR, ctrl->entity->id  /* 哪一个unit/terminal */,
dev->intfnum /* 哪一个接口: VC interface */, ctrl->info->selector,
uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
ctrl->info->size);
 


## VideoStreaming Interface: handles the data traffic received
from the camera video subsystem // 读视频数据

 ret = uvc_query_ctrl(video->dev /* 哪一个USB设备 */, SET_CUR, 0,
    video->streaming->intfnum  /* 哪一个接口: VS */,
    probe ? VS_PROBE_CONTROL : VS_COMMIT_CONTROL, data, size,
    uvc_timeout_param);

2. USB Video Camera Descriptor Hierarchy

a. 注意两大interface

## VideoControl Interface

## VideoStreaming Interface

b. ## VideoStreaming Interface 可以有多个 Alt.Setting, 然后每个Setting里可以有多个format,format里又可以有多种frame(比如分辨率不同等)

c. 可以用lsusb -v -d 0x1e4e(vendor id) 来查看所有的Descriptor

Device Descriptor:
  Configuration Descriptor:
    Interface Descriptor:
      VideoControl Interface Descriptor:

      VideoControl Interface Descriptor:
      VideoControl Interface Descriptor:
      VideoControl Interface Descriptor:
      VideoControl Interface Descriptor:
      Endpoint Descriptor:
    Interface Descriptor:
      VideoStreaming Interface Descriptor:

      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:
      VideoStreaming Interface Descriptor:

 


版权声明:本文为baidu_36250852原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。