【USB】USB video class (UVC)相关概念学习

IAD

全称Interface Association Descriptor

This is used to describe that two or more interfaces are associated to the same function. An ‘association’ includes two or more interfaces and all of their alternate setting interfaces.

  • IAD用来描述由两个或者多个接口联合组成的一个功能。
  • 每个视频功能,由一个视频控制接口(VideoControl interface)和多个视频流接口(VideoStreaming interfaces)组成。
    • IAD用来描述由视频控制接口和视频流接口组成的集合。
  • 如果这个设备使用了IAD那么它的设备描述符中的bDeviceClass, bDeviceSubClass, bDeviceProtocol字段应该分别被设置为 0xEF, 0x02 and 0x01
  • IAD组成:
    在这里插入图片描述
    • 示例如下:
      -  saafd
      • 首先是描述符长度,包含bLength字段,总长为8。
      • 描述符类型bDescriptorType,可以参考下表:
        • 在这里插入图片描述
        • 11 代表接口关联描述符
      • bFirstInterface指的是这个接口关联描述符,所包含的接口的起始接口号。接口关联描述符表示的是一个功能,比如说视频是一个功能,音频是一个功能。而视频这个功能有可能包含多个接口(interface)。IAD规定了,同一个IAD中包含的接口号(bInterfaceNumber)必须是连续的。这样就可以通过起始接口号,以及接口数量来确定该IAD中所包含的所有接口。
      • bInterfaceCount如上所属,表示该IAD包含的接口数量。

      The preferred implementation, for existing device classes, is to use the interface class, subclass and protocol field values from the first interface in the list of associated interfaces.

      • bFunctionClass,bFunctionSubClass, bFunctionProtocol建议使用IAD所包含的第一个接口对应的值。
      • iFunction该IAD对应的字符串描述符的索引。

描述符

设备描述符

  • 分两种情况,一种对外只暴露一个视频控制接口,另一种暴露视频接口集合(IAD)。我们主要讨论第二种,暴露IAD的。
  • 暴露IAD的设备表明,class信息在interface级别才能找到。所以其 bDeviceClass, bDeviceSubClass, bDeviceProtocol字段应该分别被设置为 0xEF, 0x02 and 0x01。关于这些字段的详细解释可以在USB Interface Association Descriptor
    Device Class Code and Use Model
    中找到。示例如下:
    在这里插入图片描述

配置描述符

UVC的配置描述符和标准USB设备的配置描述符是一致的。

接口关联描述符(IAD, Interface Association Descriptor)

If the VideoControl interface is part of a Video Interface Collection, the iFunction field in the
IAD and the iInterface field in the Standard VC interface descriptor for this Video Interface
Collection must be equal.

  • 如果视频控制接口是IAD的一部分,那么IAD的iFunction字段必须和视频控制接口的iInterface 字段相等,如下:
  • 在这里插入图片描述

VideoControl Interface Descriptors

Standard VC Interface Descriptor

标准的视频控制接口描述符,和USB标准接口描述符一样,如下,bInterfaceProtocol字段协议和示例有差异
在这里插入图片描述
在这里插入图片描述

Class-Specific VC Interface Descriptor

  • 类型相关的描述符,其bDescriptorType字段为36代表它是类型相关的接口描述符

参考资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值