hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/include/uapi/linux/usb/video.h
....@@ -179,6 +179,36 @@
179179 #define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
180180 #define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
181181
182
+/* 3.9.2.6 Color Matching Descriptor Values */
183
+enum uvc_color_primaries_values {
184
+ UVC_COLOR_PRIMARIES_UNSPECIFIED,
185
+ UVC_COLOR_PRIMARIES_BT_709_SRGB,
186
+ UVC_COLOR_PRIMARIES_BT_470_2_M,
187
+ UVC_COLOR_PRIMARIES_BT_470_2_B_G,
188
+ UVC_COLOR_PRIMARIES_SMPTE_170M,
189
+ UVC_COLOR_PRIMARIES_SMPTE_240M,
190
+};
191
+
192
+enum uvc_transfer_characteristics_values {
193
+ UVC_TRANSFER_CHARACTERISTICS_UNSPECIFIED,
194
+ UVC_TRANSFER_CHARACTERISTICS_BT_709,
195
+ UVC_TRANSFER_CHARACTERISTICS_BT_470_2_M,
196
+ UVC_TRANSFER_CHARACTERISTICS_BT_470_2_B_G,
197
+ UVC_TRANSFER_CHARACTERISTICS_SMPTE_170M,
198
+ UVC_TRANSFER_CHARACTERISTICS_SMPTE_240M,
199
+ UVC_TRANSFER_CHARACTERISTICS_LINEAR,
200
+ UVC_TRANSFER_CHARACTERISTICS_SRGB,
201
+};
202
+
203
+enum uvc_matrix_coefficients {
204
+ UVC_MATRIX_COEFFICIENTS_UNSPECIFIED,
205
+ UVC_MATRIX_COEFFICIENTS_BT_709,
206
+ UVC_MATRIX_COEFFICIENTS_FCC,
207
+ UVC_MATRIX_COEFFICIENTS_BT_470_2_B_G,
208
+ UVC_MATRIX_COEFFICIENTS_SMPTE_170M,
209
+ UVC_MATRIX_COEFFICIENTS_SMPTE_240M,
210
+};
211
+
182212 /* ------------------------------------------------------------------------
183213 * UVC structures
184214 */
....@@ -192,14 +222,14 @@
192222
193223 /* 3.7.2. Video Control Interface Header Descriptor */
194224 struct uvc_header_descriptor {
195
- __u8 bLength;
196
- __u8 bDescriptorType;
197
- __u8 bDescriptorSubType;
198
- __u16 bcdUVC;
199
- __u16 wTotalLength;
200
- __u32 dwClockFrequency;
201
- __u8 bInCollection;
202
- __u8 baInterfaceNr[];
225
+ __u8 bLength;
226
+ __u8 bDescriptorType;
227
+ __u8 bDescriptorSubType;
228
+ __le16 bcdUVC;
229
+ __le16 wTotalLength;
230
+ __le32 dwClockFrequency;
231
+ __u8 bInCollection;
232
+ __u8 baInterfaceNr[];
203233 } __attribute__((__packed__));
204234
205235 #define UVC_DT_HEADER_SIZE(n) (12+(n))
....@@ -209,57 +239,57 @@
209239
210240 #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \
211241 struct UVC_HEADER_DESCRIPTOR(n) { \
212
- __u8 bLength; \
213
- __u8 bDescriptorType; \
214
- __u8 bDescriptorSubType; \
215
- __u16 bcdUVC; \
216
- __u16 wTotalLength; \
217
- __u32 dwClockFrequency; \
218
- __u8 bInCollection; \
219
- __u8 baInterfaceNr[n]; \
242
+ __u8 bLength; \
243
+ __u8 bDescriptorType; \
244
+ __u8 bDescriptorSubType; \
245
+ __le16 bcdUVC; \
246
+ __le16 wTotalLength; \
247
+ __le32 dwClockFrequency; \
248
+ __u8 bInCollection; \
249
+ __u8 baInterfaceNr[n]; \
220250 } __attribute__ ((packed))
221251
222252 /* 3.7.2.1. Input Terminal Descriptor */
223253 struct uvc_input_terminal_descriptor {
224
- __u8 bLength;
225
- __u8 bDescriptorType;
226
- __u8 bDescriptorSubType;
227
- __u8 bTerminalID;
228
- __u16 wTerminalType;
229
- __u8 bAssocTerminal;
230
- __u8 iTerminal;
254
+ __u8 bLength;
255
+ __u8 bDescriptorType;
256
+ __u8 bDescriptorSubType;
257
+ __u8 bTerminalID;
258
+ __le16 wTerminalType;
259
+ __u8 bAssocTerminal;
260
+ __u8 iTerminal;
231261 } __attribute__((__packed__));
232262
233263 #define UVC_DT_INPUT_TERMINAL_SIZE 8
234264
235265 /* 3.7.2.2. Output Terminal Descriptor */
236266 struct uvc_output_terminal_descriptor {
237
- __u8 bLength;
238
- __u8 bDescriptorType;
239
- __u8 bDescriptorSubType;
240
- __u8 bTerminalID;
241
- __u16 wTerminalType;
242
- __u8 bAssocTerminal;
243
- __u8 bSourceID;
244
- __u8 iTerminal;
267
+ __u8 bLength;
268
+ __u8 bDescriptorType;
269
+ __u8 bDescriptorSubType;
270
+ __u8 bTerminalID;
271
+ __le16 wTerminalType;
272
+ __u8 bAssocTerminal;
273
+ __u8 bSourceID;
274
+ __u8 iTerminal;
245275 } __attribute__((__packed__));
246276
247277 #define UVC_DT_OUTPUT_TERMINAL_SIZE 9
248278
249279 /* 3.7.2.3. Camera Terminal Descriptor */
250280 struct uvc_camera_terminal_descriptor {
251
- __u8 bLength;
252
- __u8 bDescriptorType;
253
- __u8 bDescriptorSubType;
254
- __u8 bTerminalID;
255
- __u16 wTerminalType;
256
- __u8 bAssocTerminal;
257
- __u8 iTerminal;
258
- __u16 wObjectiveFocalLengthMin;
259
- __u16 wObjectiveFocalLengthMax;
260
- __u16 wOcularFocalLength;
261
- __u8 bControlSize;
262
- __u8 bmControls[3];
281
+ __u8 bLength;
282
+ __u8 bDescriptorType;
283
+ __u8 bDescriptorSubType;
284
+ __u8 bTerminalID;
285
+ __le16 wTerminalType;
286
+ __u8 bAssocTerminal;
287
+ __u8 iTerminal;
288
+ __le16 wObjectiveFocalLengthMin;
289
+ __le16 wObjectiveFocalLengthMax;
290
+ __le16 wOcularFocalLength;
291
+ __u8 bControlSize;
292
+ __u8 bmControls[3];
263293 } __attribute__((__packed__));
264294
265295 #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))
....@@ -293,18 +323,19 @@
293323
294324 /* 3.7.2.5. Processing Unit Descriptor */
295325 struct uvc_processing_unit_descriptor {
296
- __u8 bLength;
297
- __u8 bDescriptorType;
298
- __u8 bDescriptorSubType;
299
- __u8 bUnitID;
300
- __u8 bSourceID;
301
- __u16 wMaxMultiplier;
302
- __u8 bControlSize;
303
- __u8 bmControls[2];
304
- __u8 iProcessing;
326
+ __u8 bLength;
327
+ __u8 bDescriptorType;
328
+ __u8 bDescriptorSubType;
329
+ __u8 bUnitID;
330
+ __u8 bSourceID;
331
+ __le16 wMaxMultiplier;
332
+ __u8 bControlSize;
333
+ __u8 bmControls[2];
334
+ __u8 iProcessing;
335
+ __u8 bmVideoStandards;
305336 } __attribute__((__packed__));
306337
307
-#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))
338
+#define UVC_DT_PROCESSING_UNIT_SIZE(n) (10+(n))
308339
309340 /* 3.7.2.6. Extension Unit Descriptor */
310341 struct uvc_extension_unit_descriptor {
....@@ -343,29 +374,29 @@
343374
344375 /* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */
345376 struct uvc_control_endpoint_descriptor {
346
- __u8 bLength;
347
- __u8 bDescriptorType;
348
- __u8 bDescriptorSubType;
349
- __u16 wMaxTransferSize;
377
+ __u8 bLength;
378
+ __u8 bDescriptorType;
379
+ __u8 bDescriptorSubType;
380
+ __le16 wMaxTransferSize;
350381 } __attribute__((__packed__));
351382
352383 #define UVC_DT_CONTROL_ENDPOINT_SIZE 5
353384
354385 /* 3.9.2.1. Input Header Descriptor */
355386 struct uvc_input_header_descriptor {
356
- __u8 bLength;
357
- __u8 bDescriptorType;
358
- __u8 bDescriptorSubType;
359
- __u8 bNumFormats;
360
- __u16 wTotalLength;
361
- __u8 bEndpointAddress;
362
- __u8 bmInfo;
363
- __u8 bTerminalLink;
364
- __u8 bStillCaptureMethod;
365
- __u8 bTriggerSupport;
366
- __u8 bTriggerUsage;
367
- __u8 bControlSize;
368
- __u8 bmaControls[];
387
+ __u8 bLength;
388
+ __u8 bDescriptorType;
389
+ __u8 bDescriptorSubType;
390
+ __u8 bNumFormats;
391
+ __le16 wTotalLength;
392
+ __u8 bEndpointAddress;
393
+ __u8 bmInfo;
394
+ __u8 bTerminalLink;
395
+ __u8 bStillCaptureMethod;
396
+ __u8 bTriggerSupport;
397
+ __u8 bTriggerUsage;
398
+ __u8 bControlSize;
399
+ __u8 bmaControls[];
369400 } __attribute__((__packed__));
370401
371402 #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))
....@@ -375,32 +406,32 @@
375406
376407 #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
377408 struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \
378
- __u8 bLength; \
379
- __u8 bDescriptorType; \
380
- __u8 bDescriptorSubType; \
381
- __u8 bNumFormats; \
382
- __u16 wTotalLength; \
383
- __u8 bEndpointAddress; \
384
- __u8 bmInfo; \
385
- __u8 bTerminalLink; \
386
- __u8 bStillCaptureMethod; \
387
- __u8 bTriggerSupport; \
388
- __u8 bTriggerUsage; \
389
- __u8 bControlSize; \
390
- __u8 bmaControls[p][n]; \
409
+ __u8 bLength; \
410
+ __u8 bDescriptorType; \
411
+ __u8 bDescriptorSubType; \
412
+ __u8 bNumFormats; \
413
+ __le16 wTotalLength; \
414
+ __u8 bEndpointAddress; \
415
+ __u8 bmInfo; \
416
+ __u8 bTerminalLink; \
417
+ __u8 bStillCaptureMethod; \
418
+ __u8 bTriggerSupport; \
419
+ __u8 bTriggerUsage; \
420
+ __u8 bControlSize; \
421
+ __u8 bmaControls[p][n]; \
391422 } __attribute__ ((packed))
392423
393424 /* 3.9.2.2. Output Header Descriptor */
394425 struct uvc_output_header_descriptor {
395
- __u8 bLength;
396
- __u8 bDescriptorType;
397
- __u8 bDescriptorSubType;
398
- __u8 bNumFormats;
399
- __u16 wTotalLength;
400
- __u8 bEndpointAddress;
401
- __u8 bTerminalLink;
402
- __u8 bControlSize;
403
- __u8 bmaControls[];
426
+ __u8 bLength;
427
+ __u8 bDescriptorType;
428
+ __u8 bDescriptorSubType;
429
+ __u8 bNumFormats;
430
+ __le16 wTotalLength;
431
+ __u8 bEndpointAddress;
432
+ __u8 bTerminalLink;
433
+ __u8 bControlSize;
434
+ __u8 bmaControls[];
404435 } __attribute__((__packed__));
405436
406437 #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))
....@@ -410,15 +441,15 @@
410441
411442 #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
412443 struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \
413
- __u8 bLength; \
414
- __u8 bDescriptorType; \
415
- __u8 bDescriptorSubType; \
416
- __u8 bNumFormats; \
417
- __u16 wTotalLength; \
418
- __u8 bEndpointAddress; \
419
- __u8 bTerminalLink; \
420
- __u8 bControlSize; \
421
- __u8 bmaControls[p][n]; \
444
+ __u8 bLength; \
445
+ __u8 bDescriptorType; \
446
+ __u8 bDescriptorSubType; \
447
+ __u8 bNumFormats; \
448
+ __le16 wTotalLength; \
449
+ __u8 bEndpointAddress; \
450
+ __u8 bTerminalLink; \
451
+ __u8 bControlSize; \
452
+ __u8 bmaControls[p][n]; \
422453 } __attribute__ ((packed))
423454
424455 /* 3.9.2.6. Color matching descriptor */
....@@ -473,19 +504,19 @@
473504
474505 /* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */
475506 struct uvc_frame_uncompressed {
476
- __u8 bLength;
477
- __u8 bDescriptorType;
478
- __u8 bDescriptorSubType;
479
- __u8 bFrameIndex;
480
- __u8 bmCapabilities;
481
- __u16 wWidth;
482
- __u16 wHeight;
483
- __u32 dwMinBitRate;
484
- __u32 dwMaxBitRate;
485
- __u32 dwMaxVideoFrameBufferSize;
486
- __u32 dwDefaultFrameInterval;
487
- __u8 bFrameIntervalType;
488
- __u32 dwFrameInterval[];
507
+ __u8 bLength;
508
+ __u8 bDescriptorType;
509
+ __u8 bDescriptorSubType;
510
+ __u8 bFrameIndex;
511
+ __u8 bmCapabilities;
512
+ __le16 wWidth;
513
+ __le16 wHeight;
514
+ __le32 dwMinBitRate;
515
+ __le32 dwMaxBitRate;
516
+ __le32 dwMaxVideoFrameBufferSize;
517
+ __le32 dwDefaultFrameInterval;
518
+ __u8 bFrameIntervalType;
519
+ __le32 dwFrameInterval[];
489520 } __attribute__((__packed__));
490521
491522 #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))
....@@ -495,19 +526,19 @@
495526
496527 #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \
497528 struct UVC_FRAME_UNCOMPRESSED(n) { \
498
- __u8 bLength; \
499
- __u8 bDescriptorType; \
500
- __u8 bDescriptorSubType; \
501
- __u8 bFrameIndex; \
502
- __u8 bmCapabilities; \
503
- __u16 wWidth; \
504
- __u16 wHeight; \
505
- __u32 dwMinBitRate; \
506
- __u32 dwMaxBitRate; \
507
- __u32 dwMaxVideoFrameBufferSize; \
508
- __u32 dwDefaultFrameInterval; \
509
- __u8 bFrameIntervalType; \
510
- __u32 dwFrameInterval[n]; \
529
+ __u8 bLength; \
530
+ __u8 bDescriptorType; \
531
+ __u8 bDescriptorSubType; \
532
+ __u8 bFrameIndex; \
533
+ __u8 bmCapabilities; \
534
+ __le16 wWidth; \
535
+ __le16 wHeight; \
536
+ __le32 dwMinBitRate; \
537
+ __le32 dwMaxBitRate; \
538
+ __le32 dwMaxVideoFrameBufferSize; \
539
+ __le32 dwDefaultFrameInterval; \
540
+ __u8 bFrameIntervalType; \
541
+ __le32 dwFrameInterval[n]; \
511542 } __attribute__ ((packed))
512543
513544 /* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */
....@@ -529,19 +560,19 @@
529560
530561 /* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */
531562 struct uvc_frame_mjpeg {
532
- __u8 bLength;
533
- __u8 bDescriptorType;
534
- __u8 bDescriptorSubType;
535
- __u8 bFrameIndex;
536
- __u8 bmCapabilities;
537
- __u16 wWidth;
538
- __u16 wHeight;
539
- __u32 dwMinBitRate;
540
- __u32 dwMaxBitRate;
541
- __u32 dwMaxVideoFrameBufferSize;
542
- __u32 dwDefaultFrameInterval;
543
- __u8 bFrameIntervalType;
544
- __u32 dwFrameInterval[];
563
+ __u8 bLength;
564
+ __u8 bDescriptorType;
565
+ __u8 bDescriptorSubType;
566
+ __u8 bFrameIndex;
567
+ __u8 bmCapabilities;
568
+ __le16 wWidth;
569
+ __le16 wHeight;
570
+ __le32 dwMinBitRate;
571
+ __le32 dwMaxBitRate;
572
+ __le32 dwMaxVideoFrameBufferSize;
573
+ __le32 dwDefaultFrameInterval;
574
+ __u8 bFrameIntervalType;
575
+ __le32 dwFrameInterval[];
545576 } __attribute__((__packed__));
546577
547578 #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))
....@@ -551,19 +582,19 @@
551582
552583 #define DECLARE_UVC_FRAME_MJPEG(n) \
553584 struct UVC_FRAME_MJPEG(n) { \
554
- __u8 bLength; \
555
- __u8 bDescriptorType; \
556
- __u8 bDescriptorSubType; \
557
- __u8 bFrameIndex; \
558
- __u8 bmCapabilities; \
559
- __u16 wWidth; \
560
- __u16 wHeight; \
561
- __u32 dwMinBitRate; \
562
- __u32 dwMaxBitRate; \
563
- __u32 dwMaxVideoFrameBufferSize; \
564
- __u32 dwDefaultFrameInterval; \
565
- __u8 bFrameIntervalType; \
566
- __u32 dwFrameInterval[n]; \
585
+ __u8 bLength; \
586
+ __u8 bDescriptorType; \
587
+ __u8 bDescriptorSubType; \
588
+ __u8 bFrameIndex; \
589
+ __u8 bmCapabilities; \
590
+ __le16 wWidth; \
591
+ __le16 wHeight; \
592
+ __le32 dwMinBitRate; \
593
+ __le32 dwMaxBitRate; \
594
+ __le32 dwMaxVideoFrameBufferSize; \
595
+ __le32 dwDefaultFrameInterval; \
596
+ __u8 bFrameIntervalType; \
597
+ __le32 dwFrameInterval[n]; \
567598 } __attribute__ ((packed))
568599
569600 /* Frame Based Payload - 3.1.1. Frame Based Video Format Descriptor */