Home | History | Annotate | Download | only in usb
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef __LINUX_USB_VIDEO_H
     20 #define __LINUX_USB_VIDEO_H
     21 #include <linux/types.h>
     22 #define UVC_SC_UNDEFINED 0x00
     23 #define UVC_SC_VIDEOCONTROL 0x01
     24 #define UVC_SC_VIDEOSTREAMING 0x02
     25 #define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03
     26 #define UVC_PC_PROTOCOL_UNDEFINED 0x00
     27 #define UVC_PC_PROTOCOL_15 0x01
     28 #define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
     29 #define UVC_VC_HEADER 0x01
     30 #define UVC_VC_INPUT_TERMINAL 0x02
     31 #define UVC_VC_OUTPUT_TERMINAL 0x03
     32 #define UVC_VC_SELECTOR_UNIT 0x04
     33 #define UVC_VC_PROCESSING_UNIT 0x05
     34 #define UVC_VC_EXTENSION_UNIT 0x06
     35 #define UVC_VS_UNDEFINED 0x00
     36 #define UVC_VS_INPUT_HEADER 0x01
     37 #define UVC_VS_OUTPUT_HEADER 0x02
     38 #define UVC_VS_STILL_IMAGE_FRAME 0x03
     39 #define UVC_VS_FORMAT_UNCOMPRESSED 0x04
     40 #define UVC_VS_FRAME_UNCOMPRESSED 0x05
     41 #define UVC_VS_FORMAT_MJPEG 0x06
     42 #define UVC_VS_FRAME_MJPEG 0x07
     43 #define UVC_VS_FORMAT_MPEG2TS 0x0a
     44 #define UVC_VS_FORMAT_DV 0x0c
     45 #define UVC_VS_COLORFORMAT 0x0d
     46 #define UVC_VS_FORMAT_FRAME_BASED 0x10
     47 #define UVC_VS_FRAME_FRAME_BASED 0x11
     48 #define UVC_VS_FORMAT_STREAM_BASED 0x12
     49 #define UVC_EP_UNDEFINED 0x00
     50 #define UVC_EP_GENERAL 0x01
     51 #define UVC_EP_ENDPOINT 0x02
     52 #define UVC_EP_INTERRUPT 0x03
     53 #define UVC_RC_UNDEFINED 0x00
     54 #define UVC_SET_CUR 0x01
     55 #define UVC_GET_CUR 0x81
     56 #define UVC_GET_MIN 0x82
     57 #define UVC_GET_MAX 0x83
     58 #define UVC_GET_RES 0x84
     59 #define UVC_GET_LEN 0x85
     60 #define UVC_GET_INFO 0x86
     61 #define UVC_GET_DEF 0x87
     62 #define UVC_VC_CONTROL_UNDEFINED 0x00
     63 #define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
     64 #define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
     65 #define UVC_TE_CONTROL_UNDEFINED 0x00
     66 #define UVC_SU_CONTROL_UNDEFINED 0x00
     67 #define UVC_SU_INPUT_SELECT_CONTROL 0x01
     68 #define UVC_CT_CONTROL_UNDEFINED 0x00
     69 #define UVC_CT_SCANNING_MODE_CONTROL 0x01
     70 #define UVC_CT_AE_MODE_CONTROL 0x02
     71 #define UVC_CT_AE_PRIORITY_CONTROL 0x03
     72 #define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
     73 #define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
     74 #define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06
     75 #define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
     76 #define UVC_CT_FOCUS_AUTO_CONTROL 0x08
     77 #define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
     78 #define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
     79 #define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
     80 #define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
     81 #define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
     82 #define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
     83 #define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
     84 #define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
     85 #define UVC_CT_PRIVACY_CONTROL 0x11
     86 #define UVC_PU_CONTROL_UNDEFINED 0x00
     87 #define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
     88 #define UVC_PU_BRIGHTNESS_CONTROL 0x02
     89 #define UVC_PU_CONTRAST_CONTROL 0x03
     90 #define UVC_PU_GAIN_CONTROL 0x04
     91 #define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
     92 #define UVC_PU_HUE_CONTROL 0x06
     93 #define UVC_PU_SATURATION_CONTROL 0x07
     94 #define UVC_PU_SHARPNESS_CONTROL 0x08
     95 #define UVC_PU_GAMMA_CONTROL 0x09
     96 #define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
     97 #define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
     98 #define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
     99 #define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
    100 #define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
    101 #define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
    102 #define UVC_PU_HUE_AUTO_CONTROL 0x10
    103 #define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
    104 #define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
    105 #define UVC_VS_CONTROL_UNDEFINED 0x00
    106 #define UVC_VS_PROBE_CONTROL 0x01
    107 #define UVC_VS_COMMIT_CONTROL 0x02
    108 #define UVC_VS_STILL_PROBE_CONTROL 0x03
    109 #define UVC_VS_STILL_COMMIT_CONTROL 0x04
    110 #define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
    111 #define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
    112 #define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07
    113 #define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
    114 #define UVC_VS_SYNC_DELAY_CONTROL 0x09
    115 #define UVC_TT_VENDOR_SPECIFIC 0x0100
    116 #define UVC_TT_STREAMING 0x0101
    117 #define UVC_ITT_VENDOR_SPECIFIC 0x0200
    118 #define UVC_ITT_CAMERA 0x0201
    119 #define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
    120 #define UVC_OTT_VENDOR_SPECIFIC 0x0300
    121 #define UVC_OTT_DISPLAY 0x0301
    122 #define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
    123 #define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
    124 #define UVC_COMPOSITE_CONNECTOR 0x0401
    125 #define UVC_SVIDEO_CONNECTOR 0x0402
    126 #define UVC_COMPONENT_CONNECTOR 0x0403
    127 #define UVC_STATUS_TYPE_CONTROL 1
    128 #define UVC_STATUS_TYPE_STREAMING 2
    129 #define UVC_STREAM_EOH (1 << 7)
    130 #define UVC_STREAM_ERR (1 << 6)
    131 #define UVC_STREAM_STI (1 << 5)
    132 #define UVC_STREAM_RES (1 << 4)
    133 #define UVC_STREAM_SCR (1 << 3)
    134 #define UVC_STREAM_PTS (1 << 2)
    135 #define UVC_STREAM_EOF (1 << 1)
    136 #define UVC_STREAM_FID (1 << 0)
    137 #define UVC_CONTROL_CAP_GET (1 << 0)
    138 #define UVC_CONTROL_CAP_SET (1 << 1)
    139 #define UVC_CONTROL_CAP_DISABLED (1 << 2)
    140 #define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
    141 #define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
    142 struct uvc_descriptor_header {
    143   __u8 bLength;
    144   __u8 bDescriptorType;
    145   __u8 bDescriptorSubType;
    146 } __attribute__((packed));
    147 struct uvc_header_descriptor {
    148   __u8 bLength;
    149   __u8 bDescriptorType;
    150   __u8 bDescriptorSubType;
    151   __u16 bcdUVC;
    152   __u16 wTotalLength;
    153   __u32 dwClockFrequency;
    154   __u8 bInCollection;
    155   __u8 baInterfaceNr[];
    156 } __attribute__((__packed__));
    157 #define UVC_DT_HEADER_SIZE(n) (12 + (n))
    158 #define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_ ##n
    159 #define DECLARE_UVC_HEADER_DESCRIPTOR(n) struct UVC_HEADER_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u16 bcdUVC; __u16 wTotalLength; __u32 dwClockFrequency; __u8 bInCollection; __u8 baInterfaceNr[n]; \
    160 } __attribute__((packed))
    161 struct uvc_input_terminal_descriptor {
    162   __u8 bLength;
    163   __u8 bDescriptorType;
    164   __u8 bDescriptorSubType;
    165   __u8 bTerminalID;
    166   __u16 wTerminalType;
    167   __u8 bAssocTerminal;
    168   __u8 iTerminal;
    169 } __attribute__((__packed__));
    170 #define UVC_DT_INPUT_TERMINAL_SIZE 8
    171 struct uvc_output_terminal_descriptor {
    172   __u8 bLength;
    173   __u8 bDescriptorType;
    174   __u8 bDescriptorSubType;
    175   __u8 bTerminalID;
    176   __u16 wTerminalType;
    177   __u8 bAssocTerminal;
    178   __u8 bSourceID;
    179   __u8 iTerminal;
    180 } __attribute__((__packed__));
    181 #define UVC_DT_OUTPUT_TERMINAL_SIZE 9
    182 struct uvc_camera_terminal_descriptor {
    183   __u8 bLength;
    184   __u8 bDescriptorType;
    185   __u8 bDescriptorSubType;
    186   __u8 bTerminalID;
    187   __u16 wTerminalType;
    188   __u8 bAssocTerminal;
    189   __u8 iTerminal;
    190   __u16 wObjectiveFocalLengthMin;
    191   __u16 wObjectiveFocalLengthMax;
    192   __u16 wOcularFocalLength;
    193   __u8 bControlSize;
    194   __u8 bmControls[3];
    195 } __attribute__((__packed__));
    196 #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15 + (n))
    197 struct uvc_selector_unit_descriptor {
    198   __u8 bLength;
    199   __u8 bDescriptorType;
    200   __u8 bDescriptorSubType;
    201   __u8 bUnitID;
    202   __u8 bNrInPins;
    203   __u8 baSourceID[0];
    204   __u8 iSelector;
    205 } __attribute__((__packed__));
    206 #define UVC_DT_SELECTOR_UNIT_SIZE(n) (6 + (n))
    207 #define UVC_SELECTOR_UNIT_DESCRIPTOR(n) uvc_selector_unit_descriptor_ ##n
    208 #define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bUnitID; __u8 bNrInPins; __u8 baSourceID[n]; __u8 iSelector; \
    209 } __attribute__((packed))
    210 struct uvc_processing_unit_descriptor {
    211   __u8 bLength;
    212   __u8 bDescriptorType;
    213   __u8 bDescriptorSubType;
    214   __u8 bUnitID;
    215   __u8 bSourceID;
    216   __u16 wMaxMultiplier;
    217   __u8 bControlSize;
    218   __u8 bmControls[2];
    219   __u8 iProcessing;
    220 } __attribute__((__packed__));
    221 #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9 + (n))
    222 struct uvc_extension_unit_descriptor {
    223   __u8 bLength;
    224   __u8 bDescriptorType;
    225   __u8 bDescriptorSubType;
    226   __u8 bUnitID;
    227   __u8 guidExtensionCode[16];
    228   __u8 bNumControls;
    229   __u8 bNrInPins;
    230   __u8 baSourceID[0];
    231   __u8 bControlSize;
    232   __u8 bmControls[0];
    233   __u8 iExtension;
    234 } __attribute__((__packed__));
    235 #define UVC_DT_EXTENSION_UNIT_SIZE(p,n) (24 + (p) + (n))
    236 #define UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) uvc_extension_unit_descriptor_ ##p_ ##n
    237 #define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bUnitID; __u8 guidExtensionCode[16]; __u8 bNumControls; __u8 bNrInPins; __u8 baSourceID[p]; __u8 bControlSize; __u8 bmControls[n]; __u8 iExtension; \
    238 } __attribute__((packed))
    239 struct uvc_control_endpoint_descriptor {
    240   __u8 bLength;
    241   __u8 bDescriptorType;
    242   __u8 bDescriptorSubType;
    243   __u16 wMaxTransferSize;
    244 } __attribute__((__packed__));
    245 #define UVC_DT_CONTROL_ENDPOINT_SIZE 5
    246 struct uvc_input_header_descriptor {
    247   __u8 bLength;
    248   __u8 bDescriptorType;
    249   __u8 bDescriptorSubType;
    250   __u8 bNumFormats;
    251   __u16 wTotalLength;
    252   __u8 bEndpointAddress;
    253   __u8 bmInfo;
    254   __u8 bTerminalLink;
    255   __u8 bStillCaptureMethod;
    256   __u8 bTriggerSupport;
    257   __u8 bTriggerUsage;
    258   __u8 bControlSize;
    259   __u8 bmaControls[];
    260 } __attribute__((__packed__));
    261 #define UVC_DT_INPUT_HEADER_SIZE(n,p) (13 + (n * p))
    262 #define UVC_INPUT_HEADER_DESCRIPTOR(n,p) uvc_input_header_descriptor_ ##n_ ##p
    263 #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n,p) struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __u16 wTotalLength; __u8 bEndpointAddress; __u8 bmInfo; __u8 bTerminalLink; __u8 bStillCaptureMethod; __u8 bTriggerSupport; __u8 bTriggerUsage; __u8 bControlSize; __u8 bmaControls[p][n]; \
    264 } __attribute__((packed))
    265 struct uvc_output_header_descriptor {
    266   __u8 bLength;
    267   __u8 bDescriptorType;
    268   __u8 bDescriptorSubType;
    269   __u8 bNumFormats;
    270   __u16 wTotalLength;
    271   __u8 bEndpointAddress;
    272   __u8 bTerminalLink;
    273   __u8 bControlSize;
    274   __u8 bmaControls[];
    275 } __attribute__((__packed__));
    276 #define UVC_DT_OUTPUT_HEADER_SIZE(n,p) (9 + (n * p))
    277 #define UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) uvc_output_header_descriptor_ ##n_ ##p
    278 #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __u16 wTotalLength; __u8 bEndpointAddress; __u8 bTerminalLink; __u8 bControlSize; __u8 bmaControls[p][n]; \
    279 } __attribute__((packed))
    280 struct uvc_color_matching_descriptor {
    281   __u8 bLength;
    282   __u8 bDescriptorType;
    283   __u8 bDescriptorSubType;
    284   __u8 bColorPrimaries;
    285   __u8 bTransferCharacteristics;
    286   __u8 bMatrixCoefficients;
    287 } __attribute__((__packed__));
    288 #define UVC_DT_COLOR_MATCHING_SIZE 6
    289 struct uvc_streaming_control {
    290   __u16 bmHint;
    291   __u8 bFormatIndex;
    292   __u8 bFrameIndex;
    293   __u32 dwFrameInterval;
    294   __u16 wKeyFrameRate;
    295   __u16 wPFrameRate;
    296   __u16 wCompQuality;
    297   __u16 wCompWindowSize;
    298   __u16 wDelay;
    299   __u32 dwMaxVideoFrameSize;
    300   __u32 dwMaxPayloadTransferSize;
    301   __u32 dwClockFrequency;
    302   __u8 bmFramingInfo;
    303   __u8 bPreferedVersion;
    304   __u8 bMinVersion;
    305   __u8 bMaxVersion;
    306 } __attribute__((__packed__));
    307 struct uvc_format_uncompressed {
    308   __u8 bLength;
    309   __u8 bDescriptorType;
    310   __u8 bDescriptorSubType;
    311   __u8 bFormatIndex;
    312   __u8 bNumFrameDescriptors;
    313   __u8 guidFormat[16];
    314   __u8 bBitsPerPixel;
    315   __u8 bDefaultFrameIndex;
    316   __u8 bAspectRatioX;
    317   __u8 bAspectRatioY;
    318   __u8 bmInterfaceFlags;
    319   __u8 bCopyProtect;
    320 } __attribute__((__packed__));
    321 #define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
    322 struct uvc_frame_uncompressed {
    323   __u8 bLength;
    324   __u8 bDescriptorType;
    325   __u8 bDescriptorSubType;
    326   __u8 bFrameIndex;
    327   __u8 bmCapabilities;
    328   __u16 wWidth;
    329   __u16 wHeight;
    330   __u32 dwMinBitRate;
    331   __u32 dwMaxBitRate;
    332   __u32 dwMaxVideoFrameBufferSize;
    333   __u32 dwDefaultFrameInterval;
    334   __u8 bFrameIntervalType;
    335   __u32 dwFrameInterval[];
    336 } __attribute__((__packed__));
    337 #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26 + 4 * (n))
    338 #define UVC_FRAME_UNCOMPRESSED(n) uvc_frame_uncompressed_ ##n
    339 #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) struct UVC_FRAME_UNCOMPRESSED(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __u16 wWidth; __u16 wHeight; __u32 dwMinBitRate; __u32 dwMaxBitRate; __u32 dwMaxVideoFrameBufferSize; __u32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __u32 dwFrameInterval[n]; \
    340 } __attribute__((packed))
    341 struct uvc_format_mjpeg {
    342   __u8 bLength;
    343   __u8 bDescriptorType;
    344   __u8 bDescriptorSubType;
    345   __u8 bFormatIndex;
    346   __u8 bNumFrameDescriptors;
    347   __u8 bmFlags;
    348   __u8 bDefaultFrameIndex;
    349   __u8 bAspectRatioX;
    350   __u8 bAspectRatioY;
    351   __u8 bmInterfaceFlags;
    352   __u8 bCopyProtect;
    353 } __attribute__((__packed__));
    354 #define UVC_DT_FORMAT_MJPEG_SIZE 11
    355 struct uvc_frame_mjpeg {
    356   __u8 bLength;
    357   __u8 bDescriptorType;
    358   __u8 bDescriptorSubType;
    359   __u8 bFrameIndex;
    360   __u8 bmCapabilities;
    361   __u16 wWidth;
    362   __u16 wHeight;
    363   __u32 dwMinBitRate;
    364   __u32 dwMaxBitRate;
    365   __u32 dwMaxVideoFrameBufferSize;
    366   __u32 dwDefaultFrameInterval;
    367   __u8 bFrameIntervalType;
    368   __u32 dwFrameInterval[];
    369 } __attribute__((__packed__));
    370 #define UVC_DT_FRAME_MJPEG_SIZE(n) (26 + 4 * (n))
    371 #define UVC_FRAME_MJPEG(n) uvc_frame_mjpeg_ ##n
    372 #define DECLARE_UVC_FRAME_MJPEG(n) struct UVC_FRAME_MJPEG(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __u16 wWidth; __u16 wHeight; __u32 dwMinBitRate; __u32 dwMaxBitRate; __u32 dwMaxVideoFrameBufferSize; __u32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __u32 dwFrameInterval[n]; \
    373 } __attribute__((packed))
    374 #endif
    375