嵌入式Lee

文章数:196 被阅读:578672

datasheet推荐 换一换
随便看看
账号入驻

USB系列之-UVC支持的非压缩帧格式及其实例分享:UVC+UAC+CDC实例的RGB888+NV12+Y800帧格式

最新更新时间:2024-04-29
    阅读数:

. 前言

本文介绍 UVC 的非压缩帧格式 , 并分享测试实例。分享支持NV12和RGB888和Y800的实例,同时分享整个UVC+UAC+CDC的实例的配置描述符。

.UVC 规范支持的未压缩帧格式

规格书 USB_Video_Payload_Uncompressed_1.5.pdf: Universal Serial Bus Device Class Definition for Video Devices: Uncompressed Payload Revision 1.5 August 9, 2012 》中 ,

描述未压缩视频负载规范支持任何 YUV 格式。推荐的 YUV 格式是以下四种 :

Format

GUID

YUY2

32595559-0000-0010-8000-00AA00389B71

NV12

3231564E-0000-0010-8000-00AA00389B71

M420

3032344D-0000-0010-8000-00AA00389B71

I420

30323449-0000-0010-8000-00AA00389B71

Uncompressed Video Format Descriptor 描述符描述格式信息 , 其中 guidFormat 字段用于表示具体的格式 , 完整的描述符如下 :

Offset

Field

Size

Value

Description

0

bLength

1

Number

Size of this descriptor in bytes: 27

1

bDescriptorType

1

Constant

CS_INTERFACE descriptor type

2

bDescriptorSubtype

1

Constant

VS_FORMAT_UNCOMPRESSED
descriptor subtype

3

bFormatIndex

1

Number

Index of this format descriptor

4

bNumFrameDescriptors

1

Number

Number of frame descriptors following
that correspond to this format

5

guidFormat

16

GUID

Globally Unique Identifier used to
identify stream-encoding format

21

bBitsPerPixel

1

Number

Number of bits per pixel used to
specify color in the decoded video
frame

22

bDefaultFrameIndex

1

Number

Optimum Frame Index (used to select
resolution) for this stream

23

bAspectRatioX

1

Number

The X dimension of the picture aspect
ratio.

24

bAspectRatioY

1

Number

The Y dimension of the picture aspect
ratio.

25

bmInterlaceFlags

1

Bitmap

Specifies interlace information. If the
scanning mode control in the Camera
Terminal is supported for this stream,
this field shall reflect the field format
used in interlaced mode.
(Top field in PAL is field 1, top field in
NTSC is field 2.):
D0: Interlaced stream or variable. 1 =
Yes
D1: Fields per frame. 0= 2 fields, 1 = 1
field
D2: Field 1 first. 1 = Yes
D3: Reserved
D5..4: Field pattern
00 = Field 1 only
01 = Field 2 only
10 = Regular pattern of fields 1 and 2
11 = Random pattern of fields 1 and 2
D7..6: Reserved. Do not use.

26

bCopyProtect

1

Boolean

Specifies whether duplication of the
video stream is restricted:
0: No restrictions
1: Restrict duplication

Uncompressed Frame Descriptor 描述符描述帧信息 , 完整描述符如下 :

Offset

Field

Size

Value

Description

0

bLength

1

Number

Size of this descriptor in bytes when
bFrameIntervalType is 0: 38
Size of this descriptor in bytes when
bFrameIntervalType > 0: 26+(4*n)

1

bDescriptorType

1

Constant

CS_INTERFACE descriptor type

2

bDescriptorSubtype

1

Constant

VS_FRAME_UNCOMPRESSED
descriptor subtype

3

bFrameIndex

1

Number

Index of this frame descriptor

4

bmCapabilities

1

Number

D0: Still image supported
Specifies whether still images are
supported at this frame setting. This is
only applicable for VS interfaces with
an IN video endpoint using Still
Image Capture Method 1, and should
be set to 0 in all other cases.
D1: Fixed frame-rate
Specifies whether the device provides
a fixed frame rate on a stream
associated with this frame descriptor.

Set to 1 if fixed rate is enabled;

otherwise, set to 0.

D7..2: Reserved, set to 0.

5

wWidth

2

Number

Width of decoded bitmap frame in
pixels

7

wHeight

2

Number

Height of decoded bitmap frame in
pixels

9

dwMinBitRate

4

Number

Specifies the minimum bit rate at the
longest frame interval in units of bps
at which the data can be transmitted.

13

dwMaxBitRate

4

Number

Specifies the maximum bit rate at the
shortest frame interval in units of bps
at which the data can be transmitted.

17

dwMaxVideoFrameBuffe
rSize

4

Number

Use of this field has been deprecated.
Specifies the maximum number of
bytes that the compressor will produce
for a video frame or still image.
The dwMaxVideoFrameSize field of
the Video Probe and Commit control
replaces this descriptor field. A value
for this field shall be chosen for
compatibility with host software that
implements an earlier version of this
specification.

21

dwDefaultFrameInterval

4

Number

Specifies the frame interval the device
would like to indicate for use as a
default. This must be a valid frame
interval described in the fields below.

25

bFrameIntervalType

1

Number

Indicates how the frame interval can
be programmed:
0: Continuous frame interval
1..255: The number of discrete frame
intervals supported (n)

26…

See the following frame interval
tables.




Offset

Field

Size

Value

Description

26

dwMinFrameInterval

4

Number

Shortest frame interval supported (at
highest frame rate), in 100 ns units.

30

dwMaxFrameInterval

4

Number

Longest frame interval supported (at
lowest frame rate), in 100 ns units.

34

dwFrameIntervalStep

4

Number

Indicates granularity of frame interval
range, in 100 ns units.

Offset

Field

Size

Value

Description

26

dwFrameInterval (1)

4

Number

Shortest frame interval supported (at
highest frame rate), in 100 ns units.

26+(4*
n)-4

dwFrameInterval (n)

4

Number

Longest frame interval supported (at
lowest frame rate), in 100 ns units.

UVC 1.5 Class specification.pdf 》的 P83,Color Matching Descriptor 描述符用于描述颜色信息 , 一种格式后只能有一个该描述符 , 必须放在所有 Uncompressed Frame Descriptor 后。

Offset

Field

Size

Value

Description

0

bLength

1

Constant

6

1

bDescriptorType

1

Number

CS_INTERFACE type

2

bDescriptorSubtype

1

Number

VS_COLORFORMAT

3

bColorPrimaries

1

Number

This defines the color primaries
and the reference white.
0: Unspecified (Image
characteristics unknown)
1: BT.709, sRGB (default)
2: BT.470-2 (M)
3: BT.470-2 (B, G)
4: SMPTE 170M
5: SMPTE 240M
6-255: Reserved

4

bTransferCharacteristics

1

Number

This field defines the opto
electronic transfer characteristic of
the source picture also called the
gamma function.
0: Unspecified (Image
characteristics unknown)

1: BT.709 (default)
2: BT.470-2 M
3: BT.470-2 B, G
4: SMPTE 170M
5: SMPTE 240M
6: Linear (V = Lc)
7: sRGB (very similar to BT.709)
8-255: Reserved

5

bMatrixCoefficients

1

Number

Matrix used to compute luma and
chroma values from the color
primaries.
0: Unspecified (Image
characteristics unknown)
1: BT. 709
2: FCC
3: BT.470-2 B, G
4: SMPTE 170M (BT.601,
default)
5: SMPTE 240M
6-255: Reserved

比如如下是一个描述符拓扑 , 红色部分 Y800 的相关描述符 :

.Linux 下支持的格式

源码 root/include/linux/usb/uvc.h (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/usb/uvc.h?h=v6.9-rc5) 定义了支持的格式的 16 字节的 GUID.

/* SPDX-License-Identifier: GPL-2.0-or-later *//* *  v4l2 uvc internal API header * *  Some commonly needed functions for uvc drivers */
#ifndef __LINUX_V4L2_UVC_H#define __LINUX_V4L2_UVC_H
/* ------------------------------------------------------------------------ * GUIDs */#define UVC_GUID_UVC_CAMERA \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}#define UVC_GUID_UVC_OUTPUT \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}#define UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}#define UVC_GUID_UVC_PROCESSING \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01}#define UVC_GUID_UVC_SELECTOR \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02}#define UVC_GUID_EXT_GPIO_CONTROLLER \ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03}
#define UVC_GUID_FORMAT_MJPEG \ { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_YUY2 \ { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_YUY2_ISIGHT \ { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_NV12 \ { 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_YV12 \ { 'Y', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_I420 \ { 'I', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_UYVY \ { 'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y800 \ { 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y8 \ { 'Y', '8', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y10 \ { 'Y', '1', '0', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y12 \ { 'Y', '1', '2', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y16 \ { 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_BY8 \ { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_BA81 \ { 'B', 'A', '8', '1', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_GBRG \ { 'G', 'B', 'R', 'G', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_GRBG \ { 'G', 'R', 'B', 'G', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_RGGB \ { 'R', 'G', 'G', 'B', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_BG16 \ { 'B', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_GB16 \ { 'G', 'B', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_RG16 \ { 'R', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_GR16 \ { 'G', 'R', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_RGBP \ { 'R', 'G', 'B', 'P', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_BGR3 \ { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \ 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}#define UVC_GUID_FORMAT_BGR4 \ { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \ 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}#define UVC_GUID_FORMAT_M420 \ { 'M', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
#define UVC_GUID_FORMAT_H264 \ { 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_H265 \ { 'H', '2', '6', '5', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y8I \ { 'Y', '8', 'I', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Y12I \ { 'Y', '1', '2', 'I', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_Z16 \ { 'Z', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_RW10 \ { 'R', 'W', '1', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_INVZ \ { 'I', 'N', 'V', 'Z', 0x90, 0x2d, 0x58, 0x4a, \ 0x92, 0x0b, 0x77, 0x3f, 0x1f, 0x2c, 0x55, 0x6b}#define UVC_GUID_FORMAT_INZI \ { 'I', 'N', 'Z', 'I', 0x66, 0x1a, 0x42, 0xa2, \ 0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a}#define UVC_GUID_FORMAT_INVI \ { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \ 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f}#define UVC_GUID_FORMAT_CNF4 \ { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
#define UVC_GUID_FORMAT_D3DFMT_L8 \ {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}#define UVC_GUID_FORMAT_KSMEDIA_L8_IR \ {0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
#define UVC_GUID_FORMAT_HEVC \ { 'H', 'E', 'V', 'C', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
struct uvc_format_desc { u8 guid[16]; u32 fcc;};
const struct uvc_format_desc *uvc_format_by_guid(const u8 guid[16]);
#endif /* __LINUX_V4L2_UVC_H */

源码 root/drivers/media/common/uvc.c

(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/common/uvc.c?h=v6.9-rc5)

定义了格式结构体数组 uvc_fmts, .guid 就是前面的 16 字节格式 ,fcc

提供了接口 uvc_format_by_guid 获取格式信息 .

// SPDX-License-Identifier: GPL-2.0-or-later
#include #include #include #include #include #include
/* ------------------------------------------------------------------------ * Video formats */
static const struct uvc_format_desc uvc_fmts[] = { { .guid = UVC_GUID_FORMAT_YUY2, .fcc = V4L2_PIX_FMT_YUYV, }, { .guid = UVC_GUID_FORMAT_YUY2_ISIGHT, .fcc = V4L2_PIX_FMT_YUYV, }, { .guid = UVC_GUID_FORMAT_NV12, .fcc = V4L2_PIX_FMT_NV12, }, { .guid = UVC_GUID_FORMAT_MJPEG, .fcc = V4L2_PIX_FMT_MJPEG, }, { .guid = UVC_GUID_FORMAT_YV12, .fcc = V4L2_PIX_FMT_YVU420, }, { .guid = UVC_GUID_FORMAT_I420, .fcc = V4L2_PIX_FMT_YUV420, }, { .guid = UVC_GUID_FORMAT_M420, .fcc = V4L2_PIX_FMT_M420, }, { .guid = UVC_GUID_FORMAT_UYVY, .fcc = V4L2_PIX_FMT_UYVY, }, { .guid = UVC_GUID_FORMAT_Y800, .fcc = V4L2_PIX_FMT_GREY, }, { .guid = UVC_GUID_FORMAT_Y8, .fcc = V4L2_PIX_FMT_GREY, }, { .guid = UVC_GUID_FORMAT_D3DFMT_L8, .fcc = V4L2_PIX_FMT_GREY, }, { .guid = UVC_GUID_FORMAT_KSMEDIA_L8_IR, .fcc = V4L2_PIX_FMT_GREY, }, { .guid = UVC_GUID_FORMAT_Y10, .fcc = V4L2_PIX_FMT_Y10, }, { .guid = UVC_GUID_FORMAT_Y12, .fcc = V4L2_PIX_FMT_Y12, }, { .guid = UVC_GUID_FORMAT_Y16, .fcc = V4L2_PIX_FMT_Y16, }, { .guid = UVC_GUID_FORMAT_BY8, .fcc = V4L2_PIX_FMT_SBGGR8, }, { .guid = UVC_GUID_FORMAT_BA81, .fcc = V4L2_PIX_FMT_SBGGR8, }, { .guid = UVC_GUID_FORMAT_GBRG, .fcc = V4L2_PIX_FMT_SGBRG8, }, { .guid = UVC_GUID_FORMAT_GRBG, .fcc = V4L2_PIX_FMT_SGRBG8, }, { .guid = UVC_GUID_FORMAT_RGGB, .fcc = V4L2_PIX_FMT_SRGGB8, }, { .guid = UVC_GUID_FORMAT_RGBP, .fcc = V4L2_PIX_FMT_RGB565, }, { .guid = UVC_GUID_FORMAT_BGR3, .fcc = V4L2_PIX_FMT_BGR24, }, { .guid = UVC_GUID_FORMAT_BGR4, .fcc = V4L2_PIX_FMT_XBGR32, }, { .guid = UVC_GUID_FORMAT_H264, .fcc = V4L2_PIX_FMT_H264, }, { .guid = UVC_GUID_FORMAT_H265, .fcc = V4L2_PIX_FMT_HEVC, }, { .guid = UVC_GUID_FORMAT_Y8I, .fcc = V4L2_PIX_FMT_Y8I, }, { .guid = UVC_GUID_FORMAT_Y12I, .fcc = V4L2_PIX_FMT_Y12I, }, { .guid = UVC_GUID_FORMAT_Z16, .fcc = V4L2_PIX_FMT_Z16, }, { .guid = UVC_GUID_FORMAT_RW10, .fcc = V4L2_PIX_FMT_SRGGB10P, }, { .guid = UVC_GUID_FORMAT_BG16, .fcc = V4L2_PIX_FMT_SBGGR16, }, { .guid = UVC_GUID_FORMAT_GB16, .fcc = V4L2_PIX_FMT_SGBRG16, }, { .guid = UVC_GUID_FORMAT_RG16, .fcc = V4L2_PIX_FMT_SRGGB16, }, { .guid = UVC_GUID_FORMAT_GR16, .fcc = V4L2_PIX_FMT_SGRBG16, }, { .guid = UVC_GUID_FORMAT_INVZ, .fcc = V4L2_PIX_FMT_Z16, }, { .guid = UVC_GUID_FORMAT_INVI, .fcc = V4L2_PIX_FMT_Y10, }, { .guid = UVC_GUID_FORMAT_INZI, .fcc = V4L2_PIX_FMT_INZI, }, { .guid = UVC_GUID_FORMAT_CNF4, .fcc = V4L2_PIX_FMT_CNF4, }, { .guid = UVC_GUID_FORMAT_HEVC, .fcc = V4L2_PIX_FMT_HEVC, },};
const struct uvc_format_desc *uvc_format_by_guid(const u8 guid[16]){ unsigned int len = ARRAY_SIZE(uvc_fmts); unsigned int i;
for (i = 0; i < len; ++i) { if (memcmp(guid, uvc_fmts[i].guid, 16) == 0) return &uvc_fmts[i]; }
return NULL;}EXPORT_SYMBOL_GPL(uvc_format_by_guid);
MODULE_LICENSE("GPL");

其中 fcc guid 的前 4 个字节拼成一个 u32 的段标志 ,

v4l2_fourcc 接口实现该功能。

实现见 root/include/uapi/linux/videodev2.h (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/videodev2.h?h=v6.9-rc5)

/*  Four-character-code (FOURCC) */#define v4l2_fourcc(a, b, c, d)\  ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))#define v4l2_fourcc_be(a, b, c, d)  (v4l2_fourcc(a, b, c, d) | (1U << 31))

上述的宏 V4L2_PIX_FMT_YUYV 等也是在该文件中

例如

/* Luminance+Chrominance formats */#define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */#define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */#define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */#define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */#define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */#define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */#define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */#define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */#define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */#define V4L2_PIX_FMT_YUV24   v4l2_fourcc('Y', 'U', 'V', '3') /* 24  YUV-8-8-8     */#define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */#define V4L2_PIX_FMT_AYUV32  v4l2_fourcc('A', 'Y', 'U', 'V') /* 32  AYUV-8-8-8-8  */#define V4L2_PIX_FMT_XYUV32  v4l2_fourcc('X', 'Y', 'U', 'V') /* 32  XYUV-8-8-8-8  */#define V4L2_PIX_FMT_VUYA32  v4l2_fourcc('V', 'U', 'Y', 'A') /* 32  VUYA-8-8-8-8  */#define V4L2_PIX_FMT_VUYX32  v4l2_fourcc('V', 'U', 'Y', 'X') /* 32  VUYX-8-8-8-8  */#define V4L2_PIX_FMT_YUVA32  v4l2_fourcc('Y', 'U', 'V', 'A') /* 32  YUVA-8-8-8-8  */#define V4L2_PIX_FMT_YUVX32  v4l2_fourcc('Y', 'U', 'V', 'X') /* 32  YUVX-8-8-8-8  */#define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */#define V4L2_PIX_FMT_YUV48_12    v4l2_fourcc('Y', '3', '1', '2') /* 48  YUV 4:4:4 12-bit per component */

.Windwos 下支持的格式

D:\Windows Kits\10\Include\10.0.19041.0\shared\uuids.h

比如

// 32315659-0000-0010-8000-00AA00389B71 'YV12' ==  MEDIASUBTYPE_YV12

OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,

0x32315659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)

// 3231564E-0000-0010-8000-00AA00389B71 'NV12' ==  MEDIASUBTYPE_NV12

OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,

0x3231564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)

注意这里都是小端模式 , 比如 NV 在描述符中写为

0x4E,0x56,0x31,0x32,

0x00,0x00,

0x10,0x00,

0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71,

//// DX-VA uncompressed surface formats//
// 32315659-0000-0010-8000-00AA00389B71  'YV12' ==  MEDIASUBTYPE_YV12OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 3231564E-0000-0010-8000-00AA00389B71  'NV12' ==  MEDIASUBTYPE_NV12OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 3131564E-0000-0010-8000-00AA00389B71  'NV11' ==  MEDIASUBTYPE_NV11#ifndef MEDIASUBTYPE_NV11_DEFINED#define MEDIASUBTYPE_NV11_DEFINEDOUR_GUID_ENTRY(MEDIASUBTYPE_NV11,0x3131564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)#endif
// 38303250-0000-0010-8000-00AA00389B71  'P208' ==  MEDIASUBTYPE_P208OUR_GUID_ENTRY(MEDIASUBTYPE_P208,'802P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'P210' ==  MEDIASUBTYPE_P210OUR_GUID_ENTRY(MEDIASUBTYPE_P210,'012P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'P216' ==  MEDIASUBTYPE_P216OUR_GUID_ENTRY(MEDIASUBTYPE_P216,'612P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'P010' ==  MEDIASUBTYPE_P010OUR_GUID_ENTRY(MEDIASUBTYPE_P010,'010P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'P016' ==  MEDIASUBTYPE_P016OUR_GUID_ENTRY(MEDIASUBTYPE_P016,'610P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'Y210' ==  MEDIASUBTYPE_Y210OUR_GUID_ENTRY(MEDIASUBTYPE_Y210,'012Y', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303250-0000-0010-8000-00AA00389B71  'Y216' ==  MEDIASUBTYPE_Y216OUR_GUID_ENTRY(MEDIASUBTYPE_Y216,'612Y', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 38303450-0000-0010-8000-00AA00389B71  'P408' ==  MEDIASUBTYPE_P408OUR_GUID_ENTRY(MEDIASUBTYPE_P408,'804P', 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 3432564E-0000-0010-8000-00AA00389B71  'NV24' ==  MEDIASUBTYPE_NV24OUR_GUID_ENTRY(MEDIASUBTYPE_NV24,0x3432564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 4F303234-0000-0010-8000-00AA00389B71  '420O' ==  MEDIASUBTYPE_420OOUR_GUID_ENTRY(MEDIASUBTYPE_420O,0x4F303234, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 31434D49-0000-0010-8000-00AA00389B71  'IMC1' ==  MEDIASUBTYPE_IMC1OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 32434d49-0000-0010-8000-00AA00389B71  'IMC2' ==  MEDIASUBTYPE_IMC2OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 33434d49-0000-0010-8000-00AA00389B71  'IMC3' ==  MEDIASUBTYPE_IMC3OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 34434d49-0000-0010-8000-00AA00389B71  'IMC4' ==  MEDIASUBTYPE_IMC4OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 30343353-0000-0010-8000-00AA00389B71  'S340' ==  MEDIASUBTYPE_S340OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 32343353-0000-0010-8000-00AA00389B71  'S342' ==  MEDIASUBTYPE_S342OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// e436eb7f-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_OverlayOUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb80-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEGPacketOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb81-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1PayloadOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// 00000050-0000-0010-8000-00AA00389B71         MEDIASUBTYPE_MPEG1AudioPayloadOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71)
// e436eb82-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1SystemStreamOUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// the next consecutive number is assigned to MEDIATYPE_Stream and appears higher up// e436eb84-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1SystemOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb85-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1VideoCDOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb86-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1VideoOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb87-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_MPEG1AudioOUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb88-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_AviOUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// {3DB80F90-9412-11d1-ADED-0000F8754B99}          MEDIASUBTYPE_AsfOUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x0, 0x0, 0xf8, 0x75, 0x4b, 0x99)
// e436eb89-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_QTMovieOUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// 617a7072-0000-0010-8000-00AA00389B71         MEDIASUBTYPE_RpzaOUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 20636d73-0000-0010-8000-00AA00389B71         MEDIASUBTYPE_SmcOUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 20656c72-0000-0010-8000-00AA00389B71        MEDIASUBTYPE_RleOUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 6765706a-0000-0010-8000-00AA00389B71        MEDIASUBTYPE_JpegOUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// e436eb8a-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_PCMAudio_ObsoleteOUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// 00000001-0000-0010-8000-00AA00389B71            MEDIASUBTYPE_PCMOUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71)
// e436eb8b-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_WAVEOUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb8c-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_AUOUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// e436eb8d-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_AIFFOUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)
// 64(d)73(s)76(v)64(d)-0000-0010-8000-00AA00389B71  'dvsd' == MEDIASUBTYPE_dvsdOUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 64(d)68(h)76(v)64(d)-0000-0010-8000-00AA00389B71  'dvhd' == MEDIASUBTYPE_dvhdOUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 6c(l)73(s)76(v)64(d)-0000-0010-8000-00AA00389B71  'dvsl' == MEDIASUBTYPE_dvslOUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 35(5)32(2)76(v)64(d)-0000-0010-8000-00AA00389B71  'dv25' ==  MEDIASUBTYPE_dv25OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 30(0)35(5)76(v)64(d)-0000-0010-8000-00AA00389B71  'dv50' ==  MEDIASUBTYPE_dv50OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 31(1)68(h)76(v)64(d)-0000-0010-8000-00AA00389B71  'dvh1' ==  MEDIASUBTYPE_dvh1OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// 6E8D4A22-310C-11d0-B79A-00AA003767A7         MEDIASUBTYPE_Line21_BytePairOUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7)
// 6E8D4A23-310C-11d0-B79A-00AA003767A7         MEDIASUBTYPE_Line21_GOPPacketOUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7)
// 6E8D4A24-310C-11d0-B79A-00AA003767A7         MEDIASUBTYPE_Line21_VBIRawDataOUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24, 0x310c, 0x11d0, 0xb7, 0x9a, 0x0, 0xaa, 0x0, 0x37, 0x67, 0xa7)
//0AF414BC-4ED2-445e-9839-8F095568AB3C          MEDIASUBTYPE_708_608DataOUR_GUID_ENTRY(MEDIASUBTYPE_708_608Data,0xaf414bc, 0x4ed2, 0x445e, 0x98, 0x39, 0x8f, 0x9, 0x55, 0x68, 0xab, 0x3c)
// F52ADDAA-36F0-43F5-95EA-6D866484262A         MEDIASUBTYPE_DtvCcDataOUR_GUID_ENTRY(MEDIASUBTYPE_DtvCcData,0xF52ADDAA, 0x36F0, 0x43F5, 0x95, 0xEA, 0x6D, 0x86, 0x64, 0x84, 0x26, 0x2A)
// 7EA626DB-54DA-437b-BE9F-F73073ADFA3C         MEDIASUBTYPE_CC_CONTAINEROUR_GUID_ENTRY(MEDIASUBTYPE_CC_CONTAINER,0x7ea626db, 0x54da, 0x437b, 0xbe, 0x9f, 0xf7, 0x30, 0x73, 0xad, 0xfa, 0x3c)
// F72A76E3-EB0A-11D0-ACE4-0000C0CC16BA         MEDIASUBTYPE_TELETEXTOUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba)
// 663DA43C-03E8-4e9a-9CD5-BF11ED0DEF76         MEDIASUBTYPE_VBIOUR_GUID_ENTRY(MEDIASUBTYPE_VBI,0x663da43c, 0x3e8, 0x4e9a, 0x9c, 0xd5, 0xbf, 0x11, 0xed, 0xd, 0xef, 0x76)
// 2791D576-8E7A-466F-9E90-5D3F3083738B         MEDIASUBTYPE_WSSOUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576, 0x8E7A, 0x466F, 0x9E, 0x90, 0x5D, 0x3F, 0x30, 0x83, 0x73, 0x8B)
// 01CA73E3-DCE6-4575-AFE1-2BF1C902CAF3         MEDIASUBTYPE_XDSOUR_GUID_ENTRY(MEDIASUBTYPE_XDS,0x1ca73e3, 0xdce6, 0x4575, 0xaf, 0xe1, 0x2b, 0xf1, 0xc9, 0x2, 0xca, 0xf3)
// A1B3F620-9792-4d8d-81A4-86AF25772090         MEDIASUBTYPE_VPSOUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620, 0x9792, 0x4d8d, 0x81, 0xa4, 0x86, 0xaf, 0x25, 0x77, 0x20, 0x90)
// derived from WAVE_FORMAT_DRM// 00000009-0000-0010-8000-00aa00389b71OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// derived from WAVE_FORMAT_IEEE_FLOAT// 00000003-0000-0010-8000-00aa00389b71OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// derived from WAVE_FORMAT_DOLBY_AC3_SPDIF// 00000092-0000-0010-8000-00aa00389b71OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// derived from WAVE_FORMAT_RAW_SPORT// 00000240-0000-0010-8000-00aa00389b71OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
// derived from wave format tag 0x241, call it SPDIF_TAG_241h for now// 00000241-0000-0010-8000-00aa00389b71OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)

五. 各种格式测试

以下以 GB888 Y800,NV12 为例,其他的格式类似 .

首先需要修改描述符

RGB888

uuids.h 找到 guid

// e436eb7d-524f-11ce-9f53-0020af0ba770            MEDIASUBTYPE_RGB24OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)

Y800

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/usb/uvc.h?h=v6.9-rc5 下找到

#define UVC_GUID_FORMAT_Y800 \  { 'Y',  '8',  '0',  '0', 0x00, 0x00, 0x10, 0x00, \   0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

NV12

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/usb/uvc.h?h=v6.9-rc5 下找到

#define UVC_GUID_FORMAT_NV12 \  { 'N',  'V',  '1',  '2', 0x00, 0x00, 0x10, 0x00, \   0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

Uuids.h 下找到

// 3231564E-0000-0010-8000-00AA00389B71  'NV12' ==  MEDIASUBTYPE_NV12OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)

完整的配置描述符如下,这里是一个 UVC+UAC+CDC 的设备 .

生成测试图片

static uint32_t update_buffer_rgb888(uint8_t* buffer, uint32_t h_size, uint32_t v_size){   static unsigned int index = 0;    uint8_t r = 0;    uint8_t g = 0;    uint8_t b = 0;    uint32_t itemnum = sizeof(color_table)/sizeof(color_table[0]);    int posindex;    uint8_t* p = (uint8_t*)buffer;    if(index >= itemnum)    {        index = 0;    }
    for(uint32_t pos=0; pos    {        posindex = (index + pos)%itemnum;        /* 显示彩色条纹, 条纹开始颜色依次变化 */        r = ((color_table[posindex] >> 16) & 0xFF);        g = ((color_table[posindex] >> 8) & 0xFF);        b = ((color_table[posindex] >> 0) & 0xFF);        for(uint32_t i=0;i        {            *p++ = r;            *p++ = g;            *p++ = b;        }    }    index++;    return h_size*v_size*3;}
/* Y = 0.298R + 0.612G + 0.117B;   [13,235] U = -0.168R - 0.330G + 0.498B + 128; [16,239] V = 0.449R - 0.435G - 0.083B + 128; [16,239]*/static uint32_t update_buffer_nv12(uint8_t* buffer, uint32_t h_size, uint32_t v_size){    uint8_t* py = (uint8_t*)buffer;    uint8_t* puv = (uint8_t*)(buffer+h_size*v_size);    static unsigned int index = 0;    uint8_t y = 0;    uint8_t u = 0;    uint8_t v = 0;    uint8_t r = 0;    uint8_t g = 0;    uint8_t b = 0;    uint8_t itemnum = sizeof(color_table)/sizeof(color_table[0]);    int posindex;    if(index >= itemnum)    {        index = 0;    }
    for(int pos=0; pos    {        posindex = (index + pos)%itemnum;        /* 显示彩色条纹, 条纹开始颜色依次变化 */        r = (color_table[posindex] >> 16) & 0xFF;        g = (color_table[posindex] >> 8) & 0xFF;        b = (color_table[posindex] >> 0) & 0xFF;
        y = (0.298*r + 0.612*g + 0.117*b);        u = (-0.168*r - 0.330*g + 0.498*b + 128);        v = (0.449*r - 0.435*g - 0.083*b + 128);        if(y>235)        {            y=235;        }        if(y<16)        {            y=16;        }        if(u>239)        {            u=239;        }        if(u<16)        {            u=16;        }        if(v>239)        {            v=239;        }        if(v<16)        {            v=16;        }        for(uint32_t i=0;i        {            *py++ = y;        }        for(uint32_t i=0;i<(h_size*v_size/4)/itemnum;i++)        {            *puv++ = u;            *puv++ = v;        }    }    index++;    return h_size*v_size*3/2;}
/* Y = 0.298R + 0.612G + 0.117B;   [13,235] U = -0.168R - 0.330G + 0.498B + 128; [16,239] V = 0.449R - 0.435G - 0.083B + 128; [16,239]*/static uint32_t update_buffer_y800(uint8_t* buffer, uint32_t h_size, uint32_t v_size){    uint8_t* py = (uint8_t*)buffer;    static unsigned int index = 0;    int y = 0;    uint8_t r = 0;    uint8_t g = 0;    uint8_t b = 0;    uint8_t itemnum = sizeof(color_table)/sizeof(color_table[0]);    int posindex;    if(index >= itemnum)    {        index = 0;    }
    for(int pos=0; pos    {        posindex = (index + pos)%itemnum;        /* 显示彩色条纹, 条纹开始颜色依次变化 */        r = (color_table[posindex] >> 16) & 0xFF;        g = (color_table[posindex] >> 8) & 0xFF;        b = (color_table[posindex] >> 0) & 0xFF;
        y = (0.298*r + 0.612*g + 0.117*b);        if(y>235)        {            y=235;        }        if(y<16)        {            y=16;        }        for(uint32_t i=0;i        {            *py++ = y;        }    }    index++;    return h_size*v_size;}

根据当前选择的格式发送不同格式图片

  while(1)    {        int itf;        uint32_t len = 0;        if ((itf = usbd_uvc_get_onoffstate(0)) <= 0)         {             s_uvc_busy_u8 = 0;              /* UVC没有打开则不能传输 */            //printf("uvc off\r\n");        }         else         {            if (s_uvc_busy_u8 == 0)             {                uint8_t format;                uint8_t frame;                if(0 == usbd_uvc_get_format_frame_index(0,&format,&frame))                {                    printf("format:%d,frame:%d\n",format,frame);                }                if(format == 1)                {                    len = update_buffer_rgb888((uint8_t*)DDR_IN_BUFFER_ADDR,H_SIZE, V_SIZE);                }                else if(format == 2)                {                    len = update_buffer_nv12((uint8_t*)DDR_IN_BUFFER_ADDR,H_SIZE, V_SIZE);                }                else if(format == 3)                {                    len = update_buffer_y800((uint8_t*)DDR_IN_BUFFER_ADDR,H_SIZE, V_SIZE);                }                s_uvc_busy_u8 = 1;           /* UVC打开且当前没有在传输则进行传输 */                if (0 != usbd_uvc_sendframe(0, DDR_IN_BUFFER_ADDR), len, uvc_send_cb)                {                    s_uvc_busy_u8 = 0; /* 返回非0,实际并没有发送,此时不能置位标志,否则后面标志无法自动清零 */                }                //while(s_uvc_busy_u8 == 1);            }            else            {                //printf("uvc busy\r\n");                os_delay(10);            }        }      }

切换到格式 3 的的 probe commit 过程如下


Device Address Length Phase Data Description Delta Cmd.Phase.Ofs(rep) Date Time Driver ------ ------------------- -------- ----- ------------------------------------------------------------------------------------------------------ -------------------------------- ----- ------------------ ---------- ------------ ------------ 63.0 CTL 01 0b 01 00 03 00 00 00 SET INTERFACE 6.0sc 1.1.0(2) 2024/04/28 19:16:59.308 usbaudio 63.0 CTL 01 0b 00 00 03 00 00 00 SET INTERFACE 3.7ms 2.1.0(2) 2024/04/28 19:16:59.311 usbaudio 62.0 CTL a1 81 00 01 01 00 1a 00 GET CUR 2.1sc 5.1.0 2024/04/28 19:17:01.491 ntoskrnl 62.0 26 IN 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 94us 5.2.0 2024/04/28 19:17:01.491 62.0 CTL 21 01 00 01 01 00 1a 00 SET CUR 18us 6.1.0 2024/04/28 19:17:01.491 ntoskrnl 62.0 26 OUT 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 112us 6.2.0 2024/04/28 19:17:01.491 62.0 CTL a1 81 00 01 01 00 1a 00 GET CUR 11us 7.1.0 2024/04/28 19:17:01.491 ntoskrnl 62.0 26 IN 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 85us 7.2.0 2024/04/28 19:17:01.491 62.0 CTL a1 83 00 01 01 00 1a 00 GET MAX 10us 8.1.0 2024/04/28 19:17:01.491 ntoskrnl 62.0 26 IN 00 00 01 05 00 35 0c 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 ff 03 00 00 .....5..............?..... 98us 8.2.0 2024/04/28 19:17:01.491 62.0 CTL a1 82 00 01 01 00 1a 00 GET MIN 8us 9.1.0 2024/04/28 19:17:01.491 ntoskrnl 62.0 26 IN 00 00 01 01 80 1a 06 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 ff 03 00 00 ....................?..... 116us 9.2.0 2024/04/28 19:17:01.491 63.0 CTL 01 0b 01 00 03 00 00 00 SET INTERFACE 218ms 10.1.0 2024/04/28 19:17:01.710 usbaudio 62.0 CTL 21 01 00 01 01 00 1a 00 SET CUR 98ms 11.1.0 2024/04/28 19:17:01.809 ntoskrnl 62.0 26 OUT 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 257us 11.2.0 2024/04/28 19:17:01.810 62.0 CTL a1 81 00 01 01 00 1a 00 GET CUR 14us 12.1.0 2024/04/28 19:17:01.810 ntoskrnl 62.0 26 IN 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 97us 12.2.0 2024/04/28 19:17:01.810 62.0 CTL 21 01 00 02 01 00 1a 00 SET CUR 12us 13.1.0 2024/04/28 19:17:01.810 ntoskrnl 62.0 26 OUT 00 00 03 01 9a e9 03 00 00 00 00 00 00 00 00 00 00 00 00 c0 3f 00 00 00 00 00 ....................?..... 120us 13.2.0 2024/04/28 19:17:01.810 62.0 CTL 01 0b 01 00 01 00 00 00 SET INTERFACE 12us 14.1.0 2024/04/28 19:17:01.810 ntoskrnl 62.0 CTL 01 0b 00 00 01 00 00 00 SET INTERFACE 3.1sc 15.1.0 2024/04/28 19:17:05.002 ntoskrnl 63.0 CTL 01 0b 00 00 03 00 00 00 SET INTERFACE 52ms 16.1.0 2024/04/28 19:17:05.055 usbaudio

六. 总结

以上分享了 UVC 的非压缩帧格式 , 除了规格书推荐的几种常见格式 , 实际不同平台的主机系统可能会支持更多的格式 , 当然不同平台支持的格式也可能不一样,以上分享了如何去查找 linux windows 下支持的格式 , 并进行了多帧格式测试。

七. 附录整 个配置描述符

    ------------------ Configuration Descriptor -------------------bLength                  : 0x09 (9 bytes)bDescriptorType          : 0x02 (Configuration Descriptor)wTotalLength             : 0x0287 (647 bytes)bNumInterfaces           : 0x07 (7 Interfaces)bConfigurationValue      : 0x01 (Configuration 1)iConfiguration           : 0x00 (No String Descriptor)bmAttributes             : 0x80 D7: Reserved, set 1     : 0x01 D6: Self Powered        : 0x00 (no) D5: Remote Wakeup       : 0x00 (no) D4..0: Reserved, set 0  : 0x00MaxPower                 : 0xC8 (400 mA)Data (HexDump)           : 09 02 87 02 07 01 00 80 C8 08 0B 00 02 0E 03 00   ................                           05 09 04 00 00 00 0E 01 00 05 0D 24 01 00 01 50   ...........$...P                           00 80 C3 C9 01 01 01 12 24 02 01 01 02 00 00 00   ........$.......                           00 00 00 00 00 03 0A 00 00 0B 24 05 02 01 00 00   ..........$.....                           02 7B 07 00 1D 24 06 03 70 33 F0 28 11 63 2E 4A   .{...$..p3.(.c.J                           BA 2C 68 90 EB 33 40 16 08 01 02 04 FF FF FF FF   .,h..3@.........                           00 09 24 03 05 01 01 00 04 00 09 04 01 00 00 0E   ..$.............                           02 00 00 13 24 01 03 E8 00 81 00 05 00 00 00 02   ....$...........                           00 00 00 00 00 00 1B 24 04 01 01 7D EB 36 E4 4F   .......$...}.6.O                           52 CE 11 9F 53 00 20 AF 0B A7 70 18 01 00 00 00   R...S. ...p.....                           00 26 24 05 01 02 00 05 D0 02 00 00 77 01 00 00   .&$.........w...                           77 01 00 20 1C 00 9A E9 03 00 03 0A 8B 02 00 9A   w.. ............                           E9 03 00 40 42 0F 00 06 24 0D 01 01 04 1B 24 04   ...@B...$.....$.                           02 01 4E 56 31 32 00 00 10 00 80 00 00 AA 00 38   ..NV12.........8                           9B 71 0C 01 00 00 00 00 26 24 05 01 02 00 05 D0   .q......&$......                           02 00 00 77 01 00 00 77 01 00 20 1C 00 9A E9 03   ...w...w.. .....                           00 03 0A 8B 02 00 9A E9 03 00 40 42 0F 00 06 24   ..........@B...$                           0D 01 01 04 1B 24 04 03 01 59 38 30 30 00 00 10   .....$...Y800...                           00 80 00 00 AA 00 38 9B 71 08 01 00 00 00 00 26   ......8.q......&                           24 05 01 02 00 05 D0 02 00 00 77 01 00 00 77 01   $.........w...w.                           00 20 1C 00 9A E9 03 00 03 0A 8B 02 00 9A E9 03   . ..............                           00 40 42 0F 00 06 24 0D 01 01 04 09 04 01 01 01   .@B...$.........                           0E 02 00 00 07 05 81 05 FF 13 01 08 0B 02 03 01   ................                           02 00 07 09 04 02 00 00 01 01 00 07 0A 24 01 00   .............$..                           01 46 00 02 03 04 0C 24 02 01 01 01 00 01 04 00   .F.....$........                           00 00 09 24 06 02 01 01 01 02 00 09 24 03 03 01   ...$........$...                           03 00 02 00 0C 24 02 04 01 02 00 01 00 00 00 00   .....$..........                           09 24 06 05 04 01 43 00 00 07 24 05 07 01 05 00   .$....C...$.....                           09 24 03 06 01 01 02 07 00 09 04 03 00 00 01 02   .$..............                           00 00 09 04 03 01 01 01 02 00 00 07 24 01 01 01   ............$...                           01 00 0B 24 02 01 01 02 10 01 80 3E 00 09 05 02   ...$.......>....                           09 20 00 04 00 00 07 25 01 00 00 00 00 09 04 04   . .....%........                           00 00 01 02 00 00 09 04 04 01 01 01 02 00 00 07   ................                           24 01 06 01 01 00 0B 24 02 01 01 02 10 01 80 3E   $......$.......>                           00 09 05 82 05 20 00 04 00 00 07 25 01 00 00 00   ..... .....%....                           00 08 0B 05 02 02 02 01 00 09 04 05 00 00 02 02   ................                           01 00 05 24 00 10 01 05 24 01 00 01 04 24 02 02   ...$....$....$..                           05 24 06 00 01 09 04 06 00 02 0A 00 00 00 07 05   .$..............                           83 02 00 02 00 07 05 03 02 00 02 00 12 01 00 02   ................                           EF 02 01 40 4A 4C 55 4C 00 01 01 02 00 01 00 00   ...@JLUL........                           0A 06 00 02 EF 02 01                              .......
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x00 (Interface 0)bInterfaceCount : 0x02 (2 Interfaces)bFunctionClass : 0x0E (Video)bFunctionSubClass : 0x03 (Video Interface Collection)bFunctionProtocol : 0x00 (PC_PROTOCOL_UNDEFINED)iFunction : 0x05 (String Descriptor 5) Language 0x0409 : "XXXX USB CAMERA"Data (HexDump) : 08 0B 00 02 0E 03 00 05 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x00 (Interface 0)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x01 (Video Control)bInterfaceProtocol : 0x00iInterface : 0x05 (String Descriptor 5) Language 0x0409 : "XXXX USB CAMERA"Data (HexDump) : 09 04 00 00 00 0E 01 00 05 .........
------- Video Control Interface Header Descriptor -----bLength : 0x0D (13 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x01 (Video Control Header)bcdUVC : 0x0100 (UVC Version 1.00)wTotalLength : 0x0050 (80 bytes)dwClockFreq : 0x01C9C380 (30 MHz)bInCollection : 0x01 (1 VideoStreaming interface)baInterfaceNr[1] : 0x01 (Interface 1)Data (HexDump) : 0D 24 01 00 01 50 00 80 C3 C9 01 01 01 .$...P.......
-------- Video Control Input Terminal Descriptor ------bLength : 0x12 (18 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x01 (1)wTerminalType : 0x0201 (ITT_CAMERA)bAssocTerminal : 0x00 (Not associated with an Output Terminal)iTerminal : 0x00 (No String Descriptor)Camera Input Terminal Data:wObjectiveFocalLengthMin : 0x0000wObjectiveFocalLengthMax : 0x0000wOcularFocalLength : 0x0000bControlSize : 0x03 (3 bytes)bmControls : 0x0A, 0x00, 0x00 D0 : 0 no - Scanning Mode D1 : 1 yes - Auto-Exposure Mode D2 : 0 no - Auto-Exposure Priority D3 : 1 yes - Exposure Time (Absolute) D4 : 0 no - Exposure Time (Relative) D5 : 0 no - Focus (Absolute) D6 : 0 no - Focus (Relative) D7 : 0 no - Iris (Absolute) D8 : 0 no - Iris (Relative) D9 : 0 no - Zoom (Absolute) D10 : 0 no - Zoom (Relative) D11 : 0 no - Pan (Absolute) D12 : 0 no - Pan (Relative) D13 : 0 no - Roll (Absolute) D14 : 0 no - Roll (Relative) D15 : 0 no - Tilt (Absolute) D16 : 0 no - Tilt (Relative) D17 : 0 no - Focus Auto D18 : 0 no - Reserved D19 : 0 no - Reserved D20 : 0 no - Reserved D21 : 0 no - Reserved D22 : 0 no - Reserved D23 : 0 no - ReservedData (HexDump) : 12 24 02 01 01 02 00 00 00 00 00 00 00 00 03 0A .$.............. 00 00 ..
-------- Video Control Processing Unit Descriptor -----bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x05 (Processing Unit)bUnitID : 0x02 (2)bSourceID : 0x01 (1)wMaxMultiplier : 0x0000bControlSize : 0x02 (2 bytes)bmControls : 0x7B, 0x07 D0 : 1 yes - Brightness D1 : 1 yes - Contrast D2 : 0 no - Hue D3 : 1 yes - Saturation D4 : 1 yes - Sharpness D5 : 1 yes - Gamma D6 : 1 yes - White Balance Temperature D7 : 0 no - White Balance Component D8 : 1 yes - Backlight Compensation D9 : 1 yes - Gain D10 : 1 yes - Power Line Frequency D11 : 0 no - Hue, Auto D12 : 0 no - White Balance Temperature, Auto D13 : 0 no - White Balance Component, Auto D14 : 0 no - Digital Multiplier D15 : 0 no - Digital Multiplier LimitiProcessing : 0x00 (No String Descriptor)Data (HexDump) : 0B 24 05 02 01 00 00 02 7B 07 00 .$......{..
--------- Video Control Extension Unit Descriptor -----bLength : 0x1D (29 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x06 (Extension Unit)bUnitID : 0x03 (ID 3)guidExtensionCode : {28F03370-6311-4A2E-BA2C-6890EB334016}bNumControls : 0x08 (8 Controls)bNrInPins : 0x01 (1 Input Pin)baSourceID[1] : 0x02bControlSize : 0x04 (4 bytes)bmControls : 0xFF, 0xFF, 0xFF, 0xFF D0 : 1 yes - Vendor-Specific (Optional) D1 : 1 yes - Vendor-Specific (Optional) D2 : 1 yes - Vendor-Specific (Optional) D3 : 1 yes - Vendor-Specific (Optional) D4 : 1 yes - Vendor-Specific (Optional) D5 : 1 yes - Vendor-Specific (Optional) D6 : 1 yes - Vendor-Specific (Optional) D7 : 1 yes - Vendor-Specific (Optional) D8 : 1 yes - Vendor-Specific (Optional) D9 : 1 yes - Vendor-Specific (Optional) D10 : 1 yes - Vendor-Specific (Optional) D11 : 1 yes - Vendor-Specific (Optional) D12 : 1 yes - Vendor-Specific (Optional) D13 : 1 yes - Vendor-Specific (Optional) D14 : 1 yes - Vendor-Specific (Optional) D15 : 1 yes - Vendor-Specific (Optional) D16 : 1 yes - Vendor-Specific (Optional) D17 : 1 yes - Vendor-Specific (Optional) D18 : 1 yes - Vendor-Specific (Optional) D19 : 1 yes - Vendor-Specific (Optional) D20 : 1 yes - Vendor-Specific (Optional) D21 : 1 yes - Vendor-Specific (Optional) D22 : 1 yes - Vendor-Specific (Optional) D23 : 1 yes - Vendor-Specific (Optional) D24 : 1 yes - Vendor-Specific (Optional) D25 : 1 yes - Vendor-Specific (Optional) D26 : 1 yes - Vendor-Specific (Optional) D27 : 1 yes - Vendor-Specific (Optional) D28 : 1 yes - Vendor-Specific (Optional) D29 : 1 yes - Vendor-Specific (Optional) D30 : 1 yes - Vendor-Specific (Optional) D31 : 1 yes - Vendor-Specific (Optional)iExtension : 0x00 (No String Descriptor)Data (HexDump) : 1D 24 06 03 70 33 F0 28 11 63 2E 4A BA 2C 68 90 .$..p3.(.c.J.,h. EB 33 40 16 08 01 02 04 FF FF FF FF 00 .3@..........
------- Video Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Video Control Interface)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x05 (5)wTerminalType : 0x0101 (TT_STREAMING)bAssocTerminal : 0x00 (Not associated with an Input Terminal)bSourceID : 0x04 (4)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 05 01 01 00 04 00 .$.......
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x01 (Interface 1)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x02 (Video Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 01 00 00 0E 02 00 00 .........
---- VC-Specific VS Video Input Header Descriptor -----bLength : 0x13 (19 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x01 (Input Header)bNumFormats : 0x03wTotalLength : 0x00E8 (232 bytes)bEndpointAddress : 0x81 (Direction=IN EndpointID=1)bmInfo : 0x00 (Dynamic Format Change not supported)bTerminalLink : 0x05 (Output Terminal ID 5)bStillCaptureMethod : 0x00 (No Still Capture)nbTriggerSupport : 0x00 (Hardware Triggering not supported)bTriggerUsage : 0x00 (Host will initiate still image capture)bControlSize : 0x02 (2 bytes each)Video Payload Format 1 : 0x00 0x00 D0 : 0 no - Key Frame Rate D1 : 0 no - P Frame Rate D2 : 0 no - Compression Quality D3 : 0 no - Compression Window Size D4 : 0 no - Generate Key Frame D5 : 0 no - Update Frame Segment D6 : 0 no - Reserved D7 : 0 no - ReservedVideo Payload Format 2 : 0x00 0x00 D0 : 0 no - Key Frame Rate D1 : 0 no - P Frame Rate D2 : 0 no - Compression Quality D3 : 0 no - Compression Window Size D4 : 0 no - Generate Key Frame D5 : 0 no - Update Frame Segment D6 : 0 no - Reserved D7 : 0 no - ReservedVideo Payload Format 3 : 0x00 0x00 D0 : 0 no - Key Frame Rate D1 : 0 no - P Frame Rate D2 : 0 no - Compression Quality D3 : 0 no - Compression Window Size D4 : 0 no - Generate Key Frame D5 : 0 no - Update Frame Segment D6 : 0 no - Reserved D7 : 0 no - ReservedData (HexDump) : 13 24 01 03 E8 00 81 00 05 00 00 00 02 00 00 00 .$.............. 00 00 00 ...
------- VS Uncompressed Format Type Descriptor --------bLength : 0x1B (27 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x04 (Uncompressed Format Type)bFormatIndex : 0x01 (1)bNumFrameDescriptors : 0x01 (1 Frame Descriptor)guidFormat : {E436EB7D-524F-11CE-9F53-0020AF0BA770} (unknown)bBitsPerPixel : 0x18 (24 bits per pixel)bDefaultFrameIndex : 0x01 (Index 1)bAspectRatioX : 0x00bAspectRatioY : 0x00bmInterlaceFlags : 0x00 D0 IL stream or variable: 0 (no) D1 Fields per frame : 0 (2 fields) D2 Field 1 first : 0 (no) D3 Reserved : 0 D4..5 Field pattern : 0 (Field 1 only) D6..7 Display Mode : 0 (Bob only)bCopyProtect : 0x00 (No restrictions)Data (HexDump) : 1B 24 04 01 01 7D EB 36 E4 4F 52 CE 11 9F 53 00 .$...}.6.OR...S. 20 AF 0B A7 70 18 01 00 00 00 00 ...p......
-------- VS Uncompressed Frame Type Descriptor -----------> This is the Default (optimum) Frame indexbLength : 0x26 (38 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x05 (Uncompressed Frame Type)bFrameIndex : 0x01bmCapabilities : 0x02wWidth : 0x0500 (1280)wHeight : 0x02D0 (720)dwMinBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxVideoFrameBufferSize: 0x001C2000 (1843200 bytes)dwDefaultFrameInterval : 0x0003E99A (25.6410 ms -> 39.0000 fps)bFrameIntervalType : 0x03 (3 discrete frame intervals supported)adwFrameInterval[1] : 0x00028B0A (16.6666 ms -> 60.0000 fps)adwFrameInterval[2] : 0x0003E99A (25.6410 ms -> 39.0000 fps)adwFrameInterval[3] : 0x000F4240 (100.0000 ms -> 10.0000 fps)Data (HexDump) : 26 24 05 01 02 00 05 D0 02 00 00 77 01 00 00 77 &$.........w...w 01 00 20 1C 00 9A E9 03 00 03 0A 8B 02 00 9A E9 .. ............. 03 00 40 42 0F 00 ..@B..
------- VS Color Matching Descriptor Descriptor -------bLength : 0x06 (6 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x0D (Color Matching)bColorPrimaries : 0x01 (BT.709, sRGB)bTransferCharacteristics : 0x01 (BT.709)bMatrixCoefficients : 0x04 (SMPTE 170M)Data (HexDump) : 06 24 0D 01 01 04 .$....
------- VS Uncompressed Format Type Descriptor --------bLength : 0x1B (27 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x04 (Uncompressed Format Type)bFormatIndex : 0x02 (2)bNumFrameDescriptors : 0x01 (1 Frame Descriptor)guidFormat : {3231564E-0000-0010-8000-00AA00389B71} (NV12)bBitsPerPixel : 0x0C (12 bits per pixel)bDefaultFrameIndex : 0x01 (Index 1)bAspectRatioX : 0x00bAspectRatioY : 0x00bmInterlaceFlags : 0x00 D0 IL stream or variable: 0 (no) D1 Fields per frame : 0 (2 fields) D2 Field 1 first : 0 (no) D3 Reserved : 0 D4..5 Field pattern : 0 (Field 1 only) D6..7 Display Mode : 0 (Bob only)bCopyProtect : 0x00 (No restrictions)Data (HexDump) : 1B 24 04 02 01 4E 56 31 32 00 00 10 00 80 00 00 .$...NV12....... AA 00 38 9B 71 0C 01 00 00 00 00 ..8.q......
-------- VS Uncompressed Frame Type Descriptor -----------> This is the Default (optimum) Frame indexbLength : 0x26 (38 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x05 (Uncompressed Frame Type)bFrameIndex : 0x01bmCapabilities : 0x02wWidth : 0x0500 (1280)wHeight : 0x02D0 (720)dwMinBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxVideoFrameBufferSize: 0x001C2000 (1843200 bytes)dwDefaultFrameInterval : 0x0003E99A (25.6410 ms -> 39.0000 fps)bFrameIntervalType : 0x03 (3 discrete frame intervals supported)adwFrameInterval[1] : 0x00028B0A (16.6666 ms -> 60.0000 fps)adwFrameInterval[2] : 0x0003E99A (25.6410 ms -> 39.0000 fps)adwFrameInterval[3] : 0x000F4240 (100.0000 ms -> 10.0000 fps)Data (HexDump) : 26 24 05 01 02 00 05 D0 02 00 00 77 01 00 00 77 &$.........w...w 01 00 20 1C 00 9A E9 03 00 03 0A 8B 02 00 9A E9 .. ............. 03 00 40 42 0F 00 ..@B..
------- VS Color Matching Descriptor Descriptor -------bLength : 0x06 (6 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x0D (Color Matching)bColorPrimaries : 0x01 (BT.709, sRGB)bTransferCharacteristics : 0x01 (BT.709)bMatrixCoefficients : 0x04 (SMPTE 170M)Data (HexDump) : 06 24 0D 01 01 04 .$....
------- VS Uncompressed Format Type Descriptor --------bLength : 0x1B (27 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x04 (Uncompressed Format Type)bFormatIndex : 0x03 (3)bNumFrameDescriptors : 0x01 (1 Frame Descriptor)guidFormat : {30303859-0000-0010-8000-00AA00389B71} (Y800)bBitsPerPixel : 0x08 (8 bits per pixel)bDefaultFrameIndex : 0x01 (Index 1)bAspectRatioX : 0x00bAspectRatioY : 0x00bmInterlaceFlags : 0x00 D0 IL stream or variable: 0 (no) D1 Fields per frame : 0 (2 fields) D2 Field 1 first : 0 (no) D3 Reserved : 0 D4..5 Field pattern : 0 (Field 1 only) D6..7 Display Mode : 0 (Bob only)bCopyProtect : 0x00 (No restrictions)Data (HexDump) : 1B 24 04 03 01 59 38 30 30 00 00 10 00 80 00 00 .$...Y800....... AA 00 38 9B 71 08 01 00 00 00 00 ..8.q......
-------- VS Uncompressed Frame Type Descriptor -----------> This is the Default (optimum) Frame indexbLength : 0x26 (38 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x05 (Uncompressed Frame Type)bFrameIndex : 0x01bmCapabilities : 0x02wWidth : 0x0500 (1280)wHeight : 0x02D0 (720)dwMinBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxBitRate : 0x01770000 (24576000 bps -> 3.72 MB/s)dwMaxVideoFrameBufferSize: 0x001C2000 (1843200 bytes)dwDefaultFrameInterval : 0x0003E99A (25.6410 ms -> 39.0000 fps)bFrameIntervalType : 0x03 (3 discrete frame intervals supported)adwFrameInterval[1] : 0x00028B0A (16.6666 ms -> 60.0000 fps)adwFrameInterval[2] : 0x0003E99A (25.6410 ms -> 39.0000 fps)adwFrameInterval[3] : 0x000F4240 (100.0000 ms -> 10.0000 fps)Data (HexDump) : 26 24 05 01 02 00 05 D0 02 00 00 77 01 00 00 77 &$.........w...w 01 00 20 1C 00 9A E9 03 00 03 0A 8B 02 00 9A E9 .. ............. 03 00 40 42 0F 00 ..@B..
------- VS Color Matching Descriptor Descriptor -------bLength : 0x06 (6 bytes)bDescriptorType : 0x24 (Video Streaming Interface)bDescriptorSubtype : 0x0D (Color Matching)bColorPrimaries : 0x01 (BT.709, sRGB)bTransferCharacteristics : 0x01 (BT.709)bMatrixCoefficients : 0x04 (SMPTE 170M)Data (HexDump) : 06 24 0D 01 01 04 .$....
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x01 (Interface 1)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x0E (Video)bInterfaceSubClass : 0x02 (Video Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 01 01 01 0E 02 00 00 .........
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x81 (Direction=IN EndpointID=1)bmAttributes : 0x05 (TransferType=Isochronous SyncType=Asynchronous EndpointType=Data)wMaxPacketSize : 0x13FF (1023 bytes)bInterval : 0x01 (1 ms)Data (HexDump) : 07 05 81 05 FF 13 01 .......
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x02 (Interface 2)bInterfaceCount : 0x03 (3 Interfaces)bFunctionClass : 0x01 (Audio)bFunctionSubClass : 0x02 (Audio Streaming)bFunctionProtocol : 0x00iFunction : 0x07 (String Descriptor 7) Language 0x0409 : "USB Audio"Data (HexDump) : 08 0B 02 03 01 02 00 07 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x02 (Interface 2)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x01 (Audio Control)bInterfaceProtocol : 0x00iInterface : 0x07 (String Descriptor 7) Language 0x0409 : "USB Audio"Data (HexDump) : 09 04 02 00 00 01 01 00 07 .........
------ Audio Control Interface Header Descriptor ------bLength : 0x0A (10 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (Header)bcdADC : 0x0100wTotalLength : 0x0046 (70 bytes)bInCollection : 0x02baInterfaceNr[1] : 0x03baInterfaceNr[2] : 0x04Data (HexDump) : 0A 24 01 00 01 46 00 02 03 04 .$...F....
------- Audio Control Input Terminal Descriptor -------bLength : 0x0C (12 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x01wTerminalType : 0x0101 (USB Streaming)bAssocTerminal : 0x00bNrChannels : 0x01 (1 channel)wChannelConfig : 0x0004 (C)iChannelNames : 0x00 (No String Descriptor)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 0C 24 02 01 01 01 00 01 04 00 00 00 .$..........
-------- Audio Control Feature Unit Descriptor --------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x06 (Feature Unit)bUnitID : 0x02 (2)bSourceID : 0x01 (1)bControlSize : 0x01 (1 byte per control)bmaControls[0] : 0x01 D0: Mute : 1 D1: Volume : 0 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0bmaControls[1] : 0x02 D0: Mute : 0 D1: Volume : 1 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0iFeature : 0x00 (No String Descriptor)Data (HexDump) : 09 24 06 02 01 01 01 02 00 .$.......
------- Audio Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x03wTerminalType : 0x0301 (Speaker)bAssocTerminal : 0x00 (0)bSourceID : 0x02 (2)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 03 01 03 00 02 00 .$.......
------- Audio Control Input Terminal Descriptor -------bLength : 0x0C (12 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Input Terminal)bTerminalID : 0x04wTerminalType : 0x0201 (Microphone)bAssocTerminal : 0x00bNrChannels : 0x01 (1 channel)wChannelConfig : 0x0000 (-)iChannelNames : 0x00 (No String Descriptor)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 0C 24 02 04 01 02 00 01 00 00 00 00 .$..........
-------- Audio Control Feature Unit Descriptor --------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x06 (Feature Unit)bUnitID : 0x05 (5)bSourceID : 0x04 (4)bControlSize : 0x01 (1 byte per control)bmaControls[0] : 0x43 D0: Mute : 1 D1: Volume : 1 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 1 D7: Delay : 0bmaControls[1] : 0x00 D0: Mute : 0 D1: Volume : 0 D2: Bass : 0 D3: Mid : 0 D4: Treble : 0 D5: Graphic Equalizer : 0 D6: Automatic Gain : 0 D7: Delay : 0iFeature : 0x00 (No String Descriptor)Data (HexDump) : 09 24 06 05 04 01 43 00 00 .$....C..
------- Audio Control Selector Unit Descriptor --------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x05 (Selector Unit)bUnitID : 0x07bNrInPins : 0x01 (1 Input Pin)baSourceID[1] : 0x05 (5)iSelector : 0x00 (No String Descriptor)Data (HexDump) : 07 24 05 07 01 05 00 .$.....
------- Audio Control Output Terminal Descriptor ------bLength : 0x09 (9 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x03 (Output Terminal)bTerminalID : 0x06wTerminalType : 0x0101 (USB Streaming)bAssocTerminal : 0x02 (2)bSourceID : 0x07 (7)iTerminal : 0x00 (No String Descriptor)Data (HexDump) : 09 24 03 06 01 01 02 07 00 .$.......
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x03 (Interface 3)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 03 00 00 01 02 00 00 .........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x03 (Interface 3)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 03 01 01 01 02 00 00 .........
-------- Audio Streaming Interface Descriptor ---------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (AS_GENERAL)bTerminalLink : 0x01 (Terminal ID 1)bDelay : 0x01 (1 frame)wFormatTag : 0x0001 (PCM)Data (HexDump) : 07 24 01 01 01 01 00 .$.....
------- Audio Streaming Format Type Descriptor --------bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Format Type)bFormatType : 0x01 (FORMAT_TYPE_I)bNrChannels : 0x01 (1 channel)bSubframeSize : 0x02 (2 bytes per subframe)bBitResolution : 0x10 (16 bits per sample)bSamFreqType : 0x01 (supports 1 sample frequence)tSamFreq[1] : 0x03E80 (16000 Hz)Data (HexDump) : 0B 24 02 01 01 02 10 01 80 3E 00 .$.......>.
----------------- Endpoint Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x02 (Direction=OUT EndpointID=2)bmAttributes : 0x09 (TransferType=Isochronous SyncType=Adaptive EndpointType=Data)wMaxPacketSize : 0x0020 (32 bytes)bInterval : 0x04 (4 ms)bRefresh : 0x00bSynchAddress : 0x00Data (HexDump) : 09 05 02 09 20 00 04 00 00 .... ....
----------- Audio Data Endpoint Descriptor ------------bLength : 0x07 (7 bytes)bDescriptorType : 0x25 (Audio Endpoint Descriptor)bDescriptorSubtype : 0x01 (General)bmAttributes : 0x00 D0 : Sampling Freq : 0x00 (not supported) D1 : Pitch : 0x00 (not supported) D6..2: Reserved : 0x00 D7 : MaxPacketsOnly : 0x00 (no)bLockDelayUnits : 0x00 (Undefined)wLockDelay : 0x0000Data (HexDump) : 07 25 01 00 00 00 00 .%.....
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x04 (Interface 4)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 04 00 00 01 02 00 00 .........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x04 (Interface 4)bAlternateSetting : 0x01bNumEndpoints : 0x01 (1 Endpoint)bInterfaceClass : 0x01 (Audio)bInterfaceSubClass : 0x02 (Audio Streaming)bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 04 01 01 01 02 00 00 .........
-------- Audio Streaming Interface Descriptor ---------bLength : 0x07 (7 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x01 (AS_GENERAL)bTerminalLink : 0x06 (Terminal ID 6)bDelay : 0x01 (1 frame)wFormatTag : 0x0001 (PCM)Data (HexDump) : 07 24 01 06 01 01 00 .$.....
------- Audio Streaming Format Type Descriptor --------bLength : 0x0B (11 bytes)bDescriptorType : 0x24 (Audio Interface Descriptor)bDescriptorSubtype : 0x02 (Format Type)bFormatType : 0x01 (FORMAT_TYPE_I)bNrChannels : 0x01 (1 channel)bSubframeSize : 0x02 (2 bytes per subframe)bBitResolution : 0x10 (16 bits per sample)bSamFreqType : 0x01 (supports 1 sample frequence)tSamFreq[1] : 0x03E80 (16000 Hz)Data (HexDump) : 0B 24 02 01 01 02 10 01 80 3E 00 .$.......>.
----------------- Endpoint Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x82 (Direction=IN EndpointID=2)bmAttributes : 0x05 (TransferType=Isochronous SyncType=Asynchronous EndpointType=Data)wMaxPacketSize : 0x0020 (32 bytes)bInterval : 0x04 (4 ms)bRefresh : 0x00bSynchAddress : 0x00Data (HexDump) : 09 05 82 05 20 00 04 00 00 .... ....
----------- Audio Data Endpoint Descriptor ------------bLength : 0x07 (7 bytes)bDescriptorType : 0x25 (Audio Endpoint Descriptor)bDescriptorSubtype : 0x01 (General)bmAttributes : 0x00 D0 : Sampling Freq : 0x00 (not supported) D1 : Pitch : 0x00 (not supported) D6..2: Reserved : 0x00 D7 : MaxPacketsOnly : 0x00 (no)bLockDelayUnits : 0x00 (Undefined)wLockDelay : 0x0000Data (HexDump) : 07 25 01 00 00 00 00 .%.....
------------------- IAD Descriptor --------------------bLength : 0x08 (8 bytes)bDescriptorType : 0x0B (Interface Association Descriptor)bFirstInterface : 0x05 (Interface 5)bInterfaceCount : 0x02 (2 Interfaces)bFunctionClass : 0x02 (Communications and CDC Control)bFunctionSubClass : 0x02bFunctionProtocol : 0x01iFunction : 0x00 (No String Descriptor)Data (HexDump) : 08 0B 05 02 02 02 01 00 ........
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x05 (Interface 5)bAlternateSetting : 0x00bNumEndpoints : 0x00 (Default Control Pipe only)bInterfaceClass : 0x02 (Communications and CDC Control)bInterfaceSubClass : 0x02 (Abstract Control Model)bInterfaceProtocol : 0x01 (AT Commands defined by ITU-T V.250 etc)iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 05 00 00 02 02 01 00 .........
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x00 (Header Functional Descriptor)bcdCDC : 0x110 (CDC Version 1.10)Data (HexDump) : 05 24 00 10 01 .$...
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x01 (Call Management Functional Descriptor)bmCapabilities : 0x00 D7..2 : 0x00 (Reserved) D1 : 0x00 (sends/receives call management information only over the Communication Class interface) D0 : 0x00 (does not handle call management itself)bDataInterface : 0x01Data (HexDump) : 05 24 01 00 01 .$...
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x04 (4 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x02 (Abstract Control Management Functional Descriptor)bmCapabilities : 0x02 D7..4 : 0x00 (Reserved) D3 : 0x00 (not supports the notification Network_Connection) D2 : 0x00 (not supports the request Send_Break) D1 : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State) D0 : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)Data (HexDump) : 04 24 02 02 .$..
-------------- CDC Interface Descriptor ---------------bFunctionLength : 0x05 (5 bytes)bDescriptorType : 0x24 (Interface)bDescriptorSubType : 0x06 (Union Functional Descriptor)bControlInterface : 0x00bSubordinateInterface[0] : 0x01Data (HexDump) : 05 24 06 00 01 .$...
---------------- Interface Descriptor -----------------bLength : 0x09 (9 bytes)bDescriptorType : 0x04 (Interface Descriptor)bInterfaceNumber : 0x06 (Interface 6)bAlternateSetting : 0x00bNumEndpoints : 0x02 (2 Endpoints)bInterfaceClass : 0x0A (CDC-Data)bInterfaceSubClass : 0x00bInterfaceProtocol : 0x00iInterface : 0x00 (No String Descriptor)Data (HexDump) : 09 04 06 00 02 0A 00 00 00 .........
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x83 (Direction=IN EndpointID=3)bmAttributes : 0x02 (TransferType=Bulk)wMaxPacketSize : 0x0200 (512 bytes)bInterval : 0x00 (ignored)Data (HexDump) : 07 05 83 02 00 02 00 .......
----------------- Endpoint Descriptor -----------------bLength : 0x07 (7 bytes)bDescriptorType : 0x05 (Endpoint Descriptor)bEndpointAddress : 0x03 (Direction=OUT EndpointID=3)bmAttributes : 0x02 (TransferType=Bulk)wMaxPacketSize : 0x0200 (512 bytes)bInterval : 0x00 (ignored)Data (HexDump) : 07 05 03 02 00 02 00 .......
----------------- Unknown Descriptor ------------------bLength : 0x12 (18 bytes)bDescriptorType : 0x01Data (HexDump) : 12 01 00 02 EF 02 01 40 4A 4C 55 4C 00 01 01 02 00 01
-------------------- String Descriptors ------------------- ------ String Descriptor 0 ------bLength : 0x04 (4 bytes)bDescriptorType : 0x03 (String Descriptor)Language ID[0] : 0x0409 (English - United States)Data (HexDump) : 04 03 09 04 .... ------ String Descriptor 1 ------bLength : 0x22 (34 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "xxxxx Technology"Data (HexDump) : 22 03 78 00 78 00 78 00 78 00 78 00 20 00 54 00 ".x.x.x.x.x. .T. 65 00 63 00 68 00 6E 00 6F 00 6C 00 6F 00 67 00 e.c.h.n.o.l.o.g. 79 00 y. ------ String Descriptor 2 ------bLength : 0x2A (42 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "USB Composite Device"Data (HexDump) : 2A 03 55 00 53 00 42 00 20 00 43 00 6F 00 6D 00 *.U.S.B. .C.o.m. 70 00 6F 00 73 00 69 00 74 00 65 00 20 00 44 00 p.o.s.i.t.e. .D. 65 00 76 00 69 00 63 00 65 00 e.v.i.c.e. ------ String Descriptor 3 ------bLength : 0x22 (34 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "0000000000000000"Data (HexDump) : 22 03 30 00 30 00 30 00 30 00 30 00 30 00 30 00 ".0.0.0.0.0.0.0. 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 0.0.0.0.0.0.0.0. 30 00 0. ------ String Descriptor 4 ------bLength : 0x1C (28 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "Configuration"Data (HexDump) : 1C 03 43 00 6F 00 6E 00 66 00 69 00 67 00 75 00 ..C.o.n.f.i.g.u. 72 00 61 00 74 00 69 00 6F 00 6E 00 r.a.t.i.o.n. ------ String Descriptor 5 ------bLength : 0x20 (32 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "XXXX USB CAMERA"Data (HexDump) : 20 03 58 00 58 00 58 00 58 00 20 00 55 00 53 00 .X.X.X.X. .U.S. 42 00 20 00 43 00 41 00 4D 00 45 00 52 00 41 00 B. .C.A.M.E.R.A. ------ String Descriptor 6 ------bLength : 0x14 (20 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "USB Audio"Data (HexDump) : 14 03 55 00 53 00 42 00 20 00 41 00 75 00 64 00 ..U.S.B. .A.u.d. 69 00 6F 00 i.o. ------ String Descriptor 7 ------bLength : 0x14 (20 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "USB Audio"Data (HexDump) : 14 03 55 00 53 00 42 00 20 00 41 00 75 00 64 00 ..U.S.B. .A.u.d. 69 00 6F 00 i.o. ------ String Descriptor 8 ------bLength : 0x06 (6 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "XX"Data (HexDump) : 06 03 58 00 58 00 ..X.X. ------ String Descriptor 9 ------bLength : 0x06 (6 bytes)bDescriptorType : 0x03 (String Descriptor)Language 0x0409 : "XX"Data (HexDump) : 06 03 58 00 58 00 ..X.X.



最新有关嵌入式Lee的文章

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: TI培训

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved