DecodeVideoInterfaceDescriptor.h [plain text]
#import <Foundation/Foundation.h>
#import "DescriptorDecoder.h"
#import "BusProberSharedFunctions.h"
#import "BusProbeDevice.h"
enum VideoClassSpecific
{
CC_VIDEO = 0x0E,
SC_UNDEFINED = 0x00,
SC_VIDEOCONTROL = 0x01,
SC_VIDEOSTREAMING = 0x02,
SC_VIDEO_INTERFACE_COLLECTION = 0x03,
PC_PROTOCOL_UNDEFINED = 0x00,
CS_UNDEFINED = 0x20,
CS_DEVICE = 0x21,
CS_CONFIGURATION = 0x22,
CS_STRING = 0x23,
VC_DESCRIPTOR_UNDEFINED = 0x00,
VC_HEADER = 0x01,
VC_INPUT_TERMINAL = 0x02,
VC_OUTPUT_TERMINAL = 0x03,
VC_SELECTOR_UNIT = 0x04,
VC_PROCESSING_UNIT = 0x05,
VC_EXTENSION_UNIT = 0x06,
VS_UNDEFINED = 0x00,
VS_INPUT_HEADER = 0x01,
VS_OUTPUT_HEADER = 0x02,
VS_STILL_IMAGE_FRAME = 0x03,
VS_FORMAT_UNCOMPRESSED = 0x04,
VS_FRAME_UNCOMPRESSED = 0x05,
VS_FORMAT_MJPEG = 0x06,
VS_FRAME_MJPEG = 0x07,
VS_FORMAT_MPEG1 = 0x08,
VS_FORMAT_MPEG2PS = 0x09,
VS_FORMAT_MPEG2TS = 0x0a,
VS_FORMAT_MPEG4SL = 0xFF, VS_FORMAT_DV = 0x0c,
VS_COLORFORMAT = 0x0d,
VS_FORMAT_VENDOR = 0x0e,
VS_FRAME_VENDOR = 0x0f,
EP_UNDEFINED = 0x00,
EP_GENERAL = 0x01,
EP_ENDPOINT = 0x02,
EP_INTERRUPT = 0x03,
RC_UNDEFINED = 0x00,
SET_CUR = 0x01,
GET_CUR = 0x81,
GET_MIN = 0x82,
GET_MAX = 0x83,
GET_RES = 0x84,
GET_LEN = 0x85,
GET_INFO = 0x86,
GET_DEF = 0x87,
VC_CONTROL_UNDEFINED = 0x00,
VC_VIDEO_POWER_MODE_CONTROL = 0x01,
VC_REQUEST_ERROR_CODE_CONTROL = 0x02,
VC_REQUEST_INDICATE_HOST_CLOCK_CONTROL = 0x03,
TE_CONTROL_UNDEFINED = 0x00,
SU_CONTROL_UNDEFINED = 0x00,
SU_INPUT_SELECT_CONTROL = 0x01,
CT_CONTROL_UNDEFINED = 0x00,
CT_SCANNING_MODE_CONTROL = 0x01,
CT_AE_MODE_CONTROL = 0x02,
CT_AE_PRIORITY_CONTROL = 0x03,
CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,
CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,
CT_FOCUS_ABSOLUTE_CONTROL = 0x06,
CT_FOCUS_RELATIVE_CONTROL = 0x07,
CT_FOCUS_AUTO_CONTROL = 0x08,
CT_IRIS_ABSOLUTE_CONTROL = 0x09,
CT_IRIS_RELATIVE_CONTROL = 0x0A,
CT_ZOOM_ABSOLUTE_CONTROL = 0x0B,
CT_ZOOM_RELATIVE_CONTROL = 0x0C,
CT_PANTILT_ABSOLUTE_CONTROL = 0x0D,
CT_PANTILT_RELATIVE_CONTROL = 0x0E,
CT_ROLL_ABSOLUTE_CONTROL = 0x0F,
CT_ROLL_RELATIVE_CONTROL = 0x10,
CT_PRIVACY_CONTROL = 0x11,
PU_CONTROL_UNDEFINED = 0x00,
PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,
PU_BRIGHTNESS_CONTROL = 0x02,
PU_CONTRAST_CONTROL = 0x03,
PU_GAIN_CONTROL = 0x04,
PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,
PU_HUE_CONTROL = 0x06,
PU_SATURATION_CONTROL = 0x07,
PU_SHARPNESS_CONTROL = 0x08,
PU_GAMMA_CONTROL = 0x09,
PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0A,
PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0B,
PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0C,
PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0D,
PU_DIGITAL_MULTIPLIER_CONTROL = 0x0E,
PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0F,
PU_HUE_AUTO_CONTROL = 0x10,
XU_CONTROL_UNDEFINED = 0x00,
VS_CONTROL_UNDEFINED = 0x00,
VS_PROBE_CONTROL = 0x01,
VS_COMMIT_CONTROL = 0x02,
VS_STILL_PROBE_CONTROL = 0x03,
VS_STILL_COMMIT_CONTROL = 0x04,
VS_STILL_IMAGE_TRIGGER_CONTROL = 0x05,
VS_STREAM_ERROR_CODE_CONTROL = 0x06,
VS_GENERATE_KEY_FRAME_CONTROL = 0x07,
VS_UPDATE_FRAME_SEGMENT_CONTROL = 0x08,
VS_SYNCH_DELAY_CONTROL = 0x09,
TT_VENDOR_SPECIFIC = 0x0100,
TT_STREAMING = 0x0101,
ITT_VENDOR_SPECIFIC = 0x0200,
ITT_CAMERA = 0x0201,
ITT_MEDIA_TRANSPORT_UNIT = 0x0202,
OTT_VENDOR_SPECIFIC = 0x0300,
OTT_DISPLAY = 0x0301,
OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302,
EXTERNAL_VENDOR_SPECIFIC = 0x0400,
COMPOSITE_CONNECTOR = 0x0401,
SVIDEO_CONNECTOR = 0x0402,
COMPONENT_CONNECTOR = 0x0403,
MTT_CONTROL_UNDEFINED = 0x00,
TRANSPORT_CONTROL = 0X01,
ATN_INFORMATION_CONTROL = 0X02,
MEDIA_INFORMATION_CONTROL = 0X03,
TIME_CODE_INFORMATION_CONTROL = 0X04,
};
enum UncompressedFormatGUID
{
UNCOMPRESSED_YUV2_HI = 0x3259555900000010ULL,
UNCOMPRESSED_YUV2_LO = 0x800000aa00389b71ULL,
UNCOMPRESSED_NV12_HI = 0x3231564E00000010ULL,
UNCOMPRESSED_NV12_LO = 0x800000aa00389b71ULL,
};
#pragma pack(1)
struct IOUSBVCInterfaceDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt16 bcdVDC;
UInt16 wTotalLength;
UInt32 dwClockFrequency;
UInt8 bInCollection; UInt8 baInterfaceNr[1];
};
typedef struct IOUSBVCInterfaceDescriptor IOUSBVCInterfaceDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCInputTerminalDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bTerminalID;
UInt16 wTerminalType;
UInt8 bAssocTerminal;
UInt8 iTerminal;
};
typedef struct IOUSBVCInputTerminalDescriptor IOUSBVCInputTerminalDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCOutputTerminalDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bTerminalID;
UInt16 wTerminalType;
UInt8 bAssocTerminal;
UInt8 bSourceID;
UInt8 iTerminal;
};
typedef struct IOUSBVCOutputTerminalDescriptor IOUSBVCOutputTerminalDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCCameraTerminalDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bTerminalID;
UInt16 wTerminalType;
UInt8 bAssocTerminal;
UInt8 iTerminal;
UInt16 wObjectiveFocalLengthMin;
UInt16 wObjectiveFocalLengthMax;
UInt16 wOcularFocalLength;
UInt8 bControlSize; UInt8 bmControls[1];
};
typedef struct IOUSBVCCameraTerminalDescriptor IOUSBVCCameraTerminalDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCSelectorUnitDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bUnitID;
UInt8 bNrInPins;
UInt8 baSourceID[1];
};
typedef struct IOUSBVCSelectorUnitDescriptor IOUSBVCSelectorUnitDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCSelectorUnit2Descriptor
{
UInt8 iSelector;
};
typedef struct IOUSBVCSelectorUnit2Descriptor IOUSBVCSelectorUnit2Descriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCProcessingUnitDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bUnitID;
UInt8 bSourceID;
UInt16 wMaxMultiplier;
UInt8 bControlSize;
UInt8 bmControls[1];
};
typedef struct IOUSBVCProcessingUnitDescriptor IOUSBVCProcessingUnitDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCProcessingUnit2Descriptor
{
UInt8 iProcessing;
};
typedef struct IOUSBVCProcessingUnit2Descriptor IOUSBVCProcessingUnit2Descriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCExtensionUnitDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bUnitID;
UInt8 guidFormat[16];
UInt8 bNumControls;
UInt8 bNrInPins;
UInt8 baSourceID[1];
};
typedef struct IOUSBVCExtensionUnitDescriptor IOUSBVCExtensionUnitDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCExtensionUnit2Descriptor
{
UInt8 bControlSize;
UInt8 bmControls[1];
};
typedef struct IOUSBVCExtensionUnit2Descriptor IOUSBVCExtensionUnit2Descriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCExtensionUnit3Descriptor
{
UInt8 iExtension;
};
typedef struct IOUSBVCExtensionUnit3Descriptor IOUSBVCExtensionUnit3Descriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVCInterruptEndpointDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt16 wMaxTransferSize;
};
typedef struct IOUSBVCInterruptEndpointDescriptor IOUSBVCInterruptEndpointDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVSInputHeaderDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bNumFormats;
UInt16 wTotalLength;
UInt8 bEndpointAddress;
UInt8 bmInfo;
UInt8 bTerminalLink;
UInt8 bStillCaptureMethod;
UInt8 bTriggerSupport;
UInt8 bTriggerUsage;
UInt8 bControlSize;
UInt8 bmControls[1];
};
typedef struct IOUSBVSInputHeaderDescriptor IOUSBVSInputHeaderDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVSOutputHeaderDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bNumFormats;
UInt16 wTotalLength;
UInt8 bEndpointAddress;
UInt8 bTerminalLink;
};
typedef struct IOUSBVSOutputHeaderDescriptor IOUSBVSOutputHeaderDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MJPEGFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt8 bNumFrameDescriptors;
UInt8 bmFlags;
UInt8 bDefaultFrameIndex;
UInt8 bAspectRatioX;
UInt8 bAspectRatioY;
UInt8 bmInterlaceFlags;
UInt8 bCopyProtect;
};
typedef struct IOUSBVDC_MJPEGFormatDescriptor IOUSBVDC_MJPEGFormatDescriptor;
#pragma options align=reset
struct IOSUBVDC_StillImageSize
{
UInt16 wWidth;
UInt16 wHeight;
};
typedef struct IOSUBVDC_StillImageSize IOSUBVDC_StillImageSize;
struct IOSUBVDC_StillImageCompressionPattern
{
UInt8 bNumCompressionPattern;
UInt8 bCompression[1];
};
typedef struct IOSUBVDC_StillImageCompressionPattern IOSUBVDC_StillImageCompressionPattern;
#pragma pack(1)
struct IOUSBVDC_StillImageFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bEndpointAddress;
UInt8 bNumImageSizePatterns;
IOSUBVDC_StillImageSize dwSize[1];
};
typedef struct IOUSBVDC_StillImageFrameDescriptor IOUSBVDC_StillImageFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MJPEGFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwMinFrameInterval;
UInt32 dwMaxFrameInterval;
UInt32 dwFrameIntervalStep;
};
typedef struct IOUSBVDC_MJPEGFrameDescriptor IOUSBVDC_MJPEGFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MJPEGDiscreteFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwFrameInterval[1];
};
typedef struct IOUSBVDC_MJPEGDiscreteFrameDescriptor IOUSBVDC_MJPEGDiscreteFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_UncompressedFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt8 bNumFrameDescriptors;
UInt8 guidFormat[16];
UInt8 bBitsPerPixel;
UInt8 bDefaultFrameIndex;
UInt8 bAspectRatioX;
UInt8 bAspectRatioY;
UInt8 bmInterlaceFlags;
UInt8 bCopyProtect;
};
typedef struct IOUSBVDC_UncompressedFormatDescriptor IOUSBVDC_UncompressedFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_UncompressedFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwMinFrameInterval;
UInt32 dwMaxFrameInterval;
UInt32 dwFrameIntervalStep;
};
typedef struct IOUSBVDC_UncompressedFrameDescriptor IOUSBVDC_UncompressedFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_UncompressedDiscreteFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwFrameInterval[1];
};
typedef struct IOUSBVDC_UncompressedDiscreteFrameDescriptor IOUSBVDC_UncompressedDiscreteFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_VendorFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt8 bNumFrameDescriptors;
UInt8 guidMajorFormat[16];
UInt8 guidSubFormat[16];
UInt8 guidSpecifierFormat[16];
UInt8 bPayloadClass;
UInt8 bDefaultFrameIndex;
UInt8 bCopyProtect;
};
typedef struct IOUSBVDC_VendorFormatDescriptor IOUSBVDC_VendorFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_VendorFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwMinFrameInterval;
UInt32 dwMaxFrameInterval;
UInt32 dwFrameIntervalStep;
};
typedef struct IOUSBVDC_VendorFrameDescriptor IOUSBVDC_VendorFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_VendorDiscreteFrameDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFrameIndex;
UInt8 bmCapabilities;
UInt16 wWidth;
UInt16 wHeight;
UInt32 dwMinBitRate;
UInt32 dwMaxBitRate;
UInt32 dwMaxVideoFrameBufferSize;
UInt32 dwDefaultFrameInterval;
UInt8 bFrameIntervalType;
UInt32 dwFrameInterval[1];
};
typedef struct IOUSBVDC_VendorDiscreteFrameDescriptor IOUSBVDC_VendorDiscreteFrameDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_DVFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt32 dwMaxVideoFrameBufferSize;
UInt8 bFormatType;
};
typedef struct IOUSBVDC_DVFormatDescriptor IOUSBVDC_DVFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MPEG1SSFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt16 wPacketLength;
UInt16 wPackLength;
UInt8 bPackDataType;
};
typedef struct IOUSBVDC_MPEG1SSFormatDescriptor IOUSBVDC_MPEG1SSFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MPEG2PSFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt16 wPacketLength;
UInt16 wPackLength;
UInt8 bPackDataType;
};
typedef struct IOUSBVDC_MPEG2PSFormatDescriptor IOUSBVDC_MPEG2PSFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_MPEG2PTSFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bFormatIndex;
UInt8 bDataOffset;
UInt8 bPacketLength;
UInt8 bStrideLength;
};
typedef struct IOUSBVDC_MPEG2PTSFormatDescriptor IOUSBVDC_MPEG2PTSFormatDescriptor;
#pragma options align=reset
#pragma pack(1)
struct IOUSBVDC_ColorFormatDescriptor
{
UInt8 bLength;
UInt8 bDescriptorType;
UInt8 bDescriptorSubType;
UInt8 bColorPrimaries;
UInt8 bTransferCharacteristics;
UInt8 bMatrixCoefficients;
};
typedef struct IOUSBVDC_ColorFormatDescriptor IOUSBVDC_ColorFormatDescriptor;
#pragma options align=reset
@interface DecodeVideoInterfaceDescriptor : NSObject {
}
+(void)decodeBytes:(UInt8 *)descriptor forDevice:(BusProbeDevice *)thisDevice withDeviceInterface:(IOUSBDeviceRef)deviceIntf;
char MapNumberToVersion( int i );
@end