UVC 负载格式描述符(数据格式)
2020-10-20
2301
0
UVC已经定义的数据格式类型见下表(以VS_FORMAT开头):
描述符类型 | 值 |
---|---|
VS_UNDEFINED | 0x00 |
VS_INPUT_HEADER | 0x01 |
VS_OUTPUT_HEADER | 0x02 |
VS_STILL_IMAGE_FRAME | 0x03 |
VS_FORMAT_UNCOMPRESSED | 0x04 |
VS_FRAME_UNCOMPRESSED | 0x05 |
VS_FORMAT_MJPEG | 0x06 |
VS_FRAME_MJPEG | 0x07 |
Reserved | 0x08 |
Reserved | 0x09 |
VS_FORMAT_MPEG2TS | 0x0A |
Reserved | 0x0B |
VS_FORMAT_DV | 0x0C |
VS_COLORFORMAT | 0x0D |
Reserved | 0x0E |
Reserved | 0x0F |
VS_FORMAT_FRAME_BASED | 0x10 |
VS_FRAME_FRAME_BASED | 0x11 |
VS_FORMAT_STREAM_BASED | 0x12 |
VS_FORMAT_H264 | 0x13 |
VS_FRAME_H264 | 0x14 |
VS_FORMAT_H264_SIMULCAST | 0x15 |
VS_FORMAT_VP8 | 0x16 |
VS_FRAME_VP8 | 0x17 |
VS_FORMAT_VP8_SIMULCAST | 0x18 |
如我们支持MJPG数据格式:
bLength: 0x0B
bDescriptorType: 0x24
bDescriptorSubtype: 0x06
bFormatIndex: 0x01
bNumFrameDescriptors: 0x03
bmFlags: 0x00 -> Sample Size is Not Fixed
bDefaultFrameIndex: 0x03
bAspectRatioX: 0x00
bAspectRatioY: 0x00
bmInterlaceFlags: 0x00
D00 = 0 non-Interlaced stream or variable
D01 = 0 2 fields per frame
D02 = 0 Field 1 not first
D03 = 0 Reserved
D4..5 = 0 Field patterns -> Field 1 only
D6..7 = 0 Display Mode -> Bob only
bCopyProtect: 0x00 -> Duplication Unrestricted
如bDescriptorSubtype=VS_FORMAT_MJPEG表示数据帧格式为MJPG。关于同数据格式但帧格式不同(如分辨率不同),可见下节视频帧格式。
关于不同格式的数据帧相关的详细,可在https://www.usb.org/sites/default/files/USB_Video_Class_1_5.zip 处下载对应的文档。
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936