/*
 * Kneron UVC driver
 *
 * Copyright (C) 2020 Kneron, Inc. All rights reserved.
 *
 */
#ifndef __UVC_API_INTERNAL_H__
#define __UVC_API_INTERNAL_H__

#define VIDEO_MAX_FRAME               32

#define ET_POS  28
#define UVC_CID_DEV_INF_CLASS_BASE 	(UVC_DEV_INF << ET_POS)
#define DEVICE_POWER_MODE_LEN           0x1
#define DEVICE_POWER_MODE_LEN           0x1
#define UVC_CID_DEVICE_POWER_MODE    UVC_CID_DEV_INF_CLASS_BASE  | UVC_VC_VIDEO_POWER_MODE_CONTROL

#define POWER_MODECTL_FULL_POWER                 0000b
#define POWER_MODECTL_DEVICE_DEP_POWER           0001b
#define POWER_MODECTL_DEVICE_DEP_POWER_SUPPORTED 0x10
#define POWER_MODECTL_POWER_BY_USB               0x20
#define POWER_MODECTL_POWER_BY_BATTERY           0x40
#define POWER_MODECTL_POWER_BY_BY_AC             0x80

//#define SCANNING_MODE_CTL_PROGRESSIVE 0x1

#define DEVICE_REQUEST_ERROR_CODE_LEN           0x1
#define UVC_CID_REQUEST_ERROR_CODE        UVC_CID_DEV_INF_CLASS_BASE  |  UVC_VC_REQUEST_ERROR_CODE_CONTROL << 24
#define REQUEST_ERROR_CTL

/* CT control IDs */
#define UVC_CID_CAMERA_CLASS_BASE 	(UVC_ET_CT << ET_POS)
#define SCANNING_MODE           0x1
#define AUTO_EXPOSURE_MODE      0x2
#define AUTO_EXPOSURE_PRIORITY  0x4
#define EXPOSURE_TIME_ABSOLUTE  0x8
#define EXPOSURE_TIME_RELATIVE  0x10
#define FOCUS_ABSOLUTE          0x20
#define FOCUS_RELATIVE          0x40
#define IRIS_ABSOLUTE           0x80
#define IRIS_RELATIVE           0x100
#define ZOOM_ABSOLUTE           0x200
#define ZOOM_RELATIVE           0x400
#define PANTILT_ABSOLUTE        0x800
#define PANTILT_RELATIVE        0x1000
#define ROLL_ABSOLUTE           0x2000
#define ROLL_RELATIVE           0x4000
#define FOCUS_AUTO              0x20000
#define PRIVACY                 0x40000
#define FOCUS_SIMPLE            0x80000
#define WINDOW                  0x100000
#define REGION_OF_INTEREST      0x200000


#define SCANNING_MODE_LEN           0x1
#define AUTO_EXPOSURE_MODE_LEN      0x1
#define AUTO_EXPOSURE_PRIORITY_LEN  0x1
#define EXPOSURE_TIME_ABSOLUTE_LEN  0x4
#define EXPOSURE_TIME_RELATIVE_LEN  0x1
#define FOCUS_ABSOLUTE_LEN          0x2
#define FOCUS_RELATIVE_LEN          0x2
#define IRIS_ABSOLUTE_LEN           0x2
#define IRIS_RELATIVE_LEN           0x2
#define ZOOM_ABSOLUTE_LEN           0x2
#define ZOOM_RELATIVE_LEN           0x3
#define PANTILT_ABSOLUTE_LEN        0x8
#define PANTILT_RELATIVE_LEN        0x4
#define ROLL_ABSOLUTE_LEN           0x2
#define ROLL_RELATIVE_LEN           0x2
#define FOCUS_AUTO_LEN              0x1
#define PRIVACY_LEN                 0x1
#define FOCUS_SIMPLE_LEN            0x1
#define WINDOW_LEN                  0xc
#define REGION_OF_INTEREST_LEN      0xa


#define UVC_CID_SCANNING_MODE           UVC_CID_CAMERA_CLASS_BASE  | SCANNING_MODE
#define UVC_CID_AUTO_EXPOSURE_MODE      UVC_CID_CAMERA_CLASS_BASE  | AUTO_EXPOSURE_MODE
#define UVC_CID_AUTO_EXPOSURE_PRIORITY  UVC_CID_CAMERA_CLASS_BASE  | AUTO_EXPOSURE_PRIORITY
#define UVC_CID_EXPOSURE_TIME_ABSOLUTE  UVC_CID_CAMERA_CLASS_BASE  | EXPOSURE_TIME_ABSOLUTE
#define UVC_CID_EXPOSURE_TIME_RELATIVE  UVC_CID_CAMERA_CLASS_BASE  | EXPOSURE_TIME_RELATIVE
#define UVC_CID_FOCUS_ABSOLUTE          UVC_CID_CAMERA_CLASS_BASE  | FOCUS_ABSOLUTE
#define UVC_CID_FOCUS_RELATIVE          UVC_CID_CAMERA_CLASS_BASE  | FOCUS_RELATIVE
#define UVC_CID_IRIS_ABSOLUTE           UVC_CID_CAMERA_CLASS_BASE  | IRIS_ABSOLUTE
#define UVC_CID_IRIS_RELATIVE           UVC_CID_CAMERA_CLASS_BASE  | IRIS_RELATIVE
#define UVC_CID_ZOOM_ABSOLUTE           UVC_CID_CAMERA_CLASS_BASE  | ZOOM_ABSOLUTE
#define UVC_CID_ZOOM_RELATIVE           UVC_CID_CAMERA_CLASS_BASE  | ZOOM_RELATIVE
#define UVC_CID_PANTILT_ABSOLUTE        UVC_CID_CAMERA_CLASS_BASE  | PANTILT_ABSOLUTE
#define UVC_CID_PANTILT_RELATIVE        UVC_CID_CAMERA_CLASS_BASE  | PANTILT_RELATIVE
#define UVC_CID_ROLL_ABSOLUTE           UVC_CID_CAMERA_CLASS_BASE  | ROLL_ABSOLUTE
#define UVC_CID_ROLL_RELATIVE           UVC_CID_CAMERA_CLASS_BASE  | ROLL_RELATIVE
#define UVC_CID_FOCUS_AUTO              UVC_CID_CAMERA_CLASS_BASE  | FOCUS_AUTO
#define UVC_CID_PRIVACY                 UVC_CID_CAMERA_CLASS_BASE  | PRIVACY
#define UVC_CID_FOCUS_SIMPLE            UVC_CID_CAMERA_CLASS_BASE  | FOCUS_SIMPLE
#define UVC_CID_WINDOW                  UVC_CID_CAMERA_CLASS_BASE  | WINDOW
#define UVC_CID_REGION_OF_INTEREST      UVC_CID_CAMERA_CLASS_BASE  | REGION_OF_INTEREST


#define SCANNING_MODE_CTL_INTERLACED  0x0
#define SCANNING_MODE_CTL_PROGRESSIVE 0x1

#define AUTO_EXPOSURE_MODE_CTL_MODE_MANUAL 0x1
#define AUTO_EXPOSURE_MODE_CTL_MODE_AUTO   0x2
#define AUTO_EXPOSURE_MODE_CTL_MODE_SHUTTER_PRIO  0x4
#define AUTO_EXPOSURE_MODE_CTL_MODE_APERTURE_PRIO 0x8

#define AUTO_EXPOSURE_PRI_CTL_FRAMERAT_CONST  0x0
#define AUTO_EXPOSURE_PRI_CTL_FRAMERAT_VARIED 0x1

#define EXPOSURE_TIME_REL_CTL_DEF            0x0
#define EXPOSURE_TIME_REL_CTL_INC_BY_1STEP   0x1
#define EXPOSURE_TIME_REL_CTL_DEC_BY_1_STEP  0xFF

#define FOCUS_REL_CTL_REL_STOP         0x0
#define FOCUS_REL_CTL_REL_NEAR_DIR     0x1
#define FOCUS_REL_CTL_REL_INFINITE_DIR 0xFF

#define FOCUS_SIMPLE_CTL_FULL_RANGE           0x00
#define FOCUS_SIMPLE_CTL_MACRO_LESS_THAN_0_3M 0x01
#define FOCUS_SIMPLE_CTL_PEOPLE_0_3M_TO_3M    0x02
#define FOCUS_SIMPLE_CTL_SCENE_3M_TO_INFINITY 0x03

#define IRIS_REL_CTL_REL_DEF            0x0
#define IRIS_REL_CTL_REL_OPEN_BY_1STEP  0x1
#define IRIS_REL_CTL_REL_CLOSE_BY_1STEP 0xFF

#define ZOOM_REL_CTL_ZOOM_STOP               0x0
#define ZOOM_REL_CTL_ZOOM_TO_TELEPHOTO_DIR   0x1
#define ZOOM_REL_CTL_ZOOM_TO_WIDEANGLE_DIR   0xFF
#define ZOOM_REL_CTL_DIGITALZOOM_OFF         0x0
#define ZOOM_REL_CTL_DIGITALZOOM_ON          0x1

#define PANTILT_REL_CTL_STOP       0x0
#define PANTILT_REL_CTL_PLANE_UP   0x1
#define PANTILT_REL_CTL_PLANE_DOWN 0xFF

#define ROLL_RELATIVE_CTL_STOP                       0x0
#define ROLL_RELATIVE_CTL_CLOCKWISE_ROTATION         0x1
#define ROLL_RELATIVE_CTL_COUNTER_CLOCKWISE_ROTATION 0xFF

#define PRIVACY_CTL_OPEN  0x0
#define PRIVACY_CTL_CLOSE 0x1

#define WINDOWS_CTL_STEPUNIT_VIDEOFRAME   0x1
#define WINDOWS_CTL_STEPUNIT_MILLISECONDS 0x2

#define ROI_CTL_AUTOCTL_EXPOSURE      0x1
#define ROI_CTL_AUTOCTL_IRIS          0x2
#define ROI_CTL_AUTOCTL_WHITE_BALANCE 0x4
#define ROI_CTL_AUTOCTL_FOCUS         0x8
#define ROI_CTL_AUTOCTL_FACE_DETECT   0x10
#define ROI_CTL_AUTOCTL_AUTO_DETECT_TRACK    0x20
#define ROI_CTL_AUTOCTL_IMAGE_STABILIZATION  0x40
#define ROI_CTL_AUTOCTL_HIGHER_QUALITY       0x80

/*PU ctl */

#define BRIGHTNESS                     0x1
#define CONTRAST                       0x2
#define HUE                            0x4
#define SATURATION                     0x8
#define SHARPNESS                      0x10
#define GAMMA                          0x20
#define WHITE_BALANCE_TEMPERATURE      0x40
#define WHITE_BALANCE_COMPONENT        0x80
#define BACKLIGHT_COMPENSATION         0x100
#define GAIN                           0x200
#define POWER_LINE_FREQUENCY           0x400
#define HUE_AUTO                       0x800
#define WHITE_BALANCE_TEMPERATURE_AUTO 0x1000
#define WHITE_BALANCE_COMPONENT_AUTO   0x2000
#define DIGITAL_MULTIPLIER             0x4000
#define DIGITAL_MULTIPLIER_LIMIT       0x8000
#define ANALOG_VIDEO_STANDARD          0x10000
#define ANALOG_VIDEO_LOCK_STATUS       0x20000
#define CONTRAST_AUTO                  0x40000

#define BRIGHTNESS_LEN                     0x2
#define CONTRAST_LEN                       0x2
#define HUE_LEN                            0x2
#define SATURATION_LEN                     0x2
#define SHARPNESS_LEN                      0x2
#define GAMMA_LEN                          0x2
#define WHITE_BALANCE_TEMPERATURE_LEN      0x2
#define WHITE_BALANCE_COMPONENT_LEN        0x2
#define BACKLIGHT_COMPENSATION_LEN         0x2
#define GAIN_LEN                           0x2
#define POWER_LINE_FREQUENCY_LEN           0x1
#define HUE_AUTO_LEN                       0x1
#define WHITE_BALANCE_TEMPERATURE_AUTO_LEN 0x1
#define WHITE_BALANCE_COMPONENT_AUTO_LEN   0x1
#define DIGITAL_MULTIPLIER_LEN             0x2
#define DIGITAL_MULTIPLIER_LIMIT_LEN       0x2
#define ANALOG_VIDEO_STANDARD_LEN          0x1
#define ANALOG_VIDEO_LOCK_STATUS_LEN       0x1
#define CONTRAST_AUTO_LEN                  0x1

#define UVC_CID_PU_CLASS_BASE 	(UVC_ET_PU << ET_POS)
#define UVC_CID_BRIGHTNESS                     UVC_CID_PU_CLASS_BASE | BRIGHTNESS
#define UVC_CID_CONTRAST                       UVC_CID_PU_CLASS_BASE | CONTRAST
#define UVC_CID_HUE                            UVC_CID_PU_CLASS_BASE | HUE
#define UVC_CID_SATURATION                     UVC_CID_PU_CLASS_BASE | SATURATION
#define UVC_CID_SHARPNESS                      UVC_CID_PU_CLASS_BASE | SHARPNESS
#define UVC_CID_GAMMA                          UVC_CID_PU_CLASS_BASE | GAMMA
#define UVC_CID_WHITE_BALANCE_TEMPERATURE      UVC_CID_PU_CLASS_BASE | WHITE_BALANCE_TEMPERATURE
#define UVC_CID_WHITE_BALANCE_COMPONENT        UVC_CID_PU_CLASS_BASE | WHITE_BALANCE_COMPONENT
#define UVC_CID_BACKLIGHT_COMPENSATION         UVC_CID_PU_CLASS_BASE | BACKLIGHT_COMPENSATION
#define UVC_CID_GAIN                           UVC_CID_PU_CLASS_BASE | GAIN
#define UVC_CID_POWER_LINE_FREQUENCY           UVC_CID_PU_CLASS_BASE | POWER_LINE_FREQUENCY
#define UVC_CID_HUE_AUTO                       UVC_CID_PU_CLASS_BASE | HUE_AUTO
#define UVC_CID_WHITE_BALANCE_TEMPERATURE_AUTO UVC_CID_PU_CLASS_BASE | WHITE_BALANCE_TEMPERATURE_AUTO
#define UVC_CID_WHITE_BALANCE_COMPONENT_AUTO   UVC_CID_PU_CLASS_BASE | WHITE_BALANCE_COMPONENT_AUTO
#define UVC_CID_DIGITAL_MULTIPLIER             UVC_CID_PU_CLASS_BASE | DIGITAL_MULTIPLIER
#define UVC_CID_DIGITAL_MULTIPLIER_LIMIT       UVC_CID_PU_CLASS_BASE | DIGITAL_MULTIPLIER_LIMIT
#define UVC_CID_ANALOG_VIDEO_STANDARD          UVC_CID_PU_CLASS_BASE | ANALOG_VIDEO_STANDARD
#define UVC_CID_ANALOG_VIDEO_LOCK_STATUS       UVC_CID_PU_CLASS_BASE | ANALOG_VIDEO_LOCK_STATUS
#define UVC_CID_CONTRAST_AUTO                  UVC_CID_PU_CLASS_BASE | CONTRAST_AUTO

#define BACKLIGHT_COMPENSATION_CTL_DISABLED 0x0

#define CONTRAST_AUTO_CTL_AUTO_ADJUSTMENT_ENABLED 0x1


#define POWER_LINE_FREQUENCY_CTL_DISABLED 0
#define POWER_LINE_FREQUENCY_CTL_50HZ     1
#define POWER_LINE_FREQUENCY_CTL_60HZ     2

#define HUE_AUTO_CTL_AUTO_ADJUSTMENT_ENABLED 0x1

#define SATURATION_CTL_GRAYSCALE 0x0

#define GAMMA_CTL_GAMMA_MIN 1
#define GAMMA_CTL_GAMMA_MAX 500

#define WHITE_BALANCE_TEMPERATURE_AUTO_CTL_AUTO_ADJUSTMENT_ENABLED 0x1
#define WHITE_BALANCE_COMPONENT_AUTO_CTL_AUTO_ADJUSTMENT_ENABLED   0x1

#define  UVC_CID_EU_CLASS_BASE    (UVC_ET_EU << ET_POS)
#define SELECT_LAYER                                  0x1
#define PROFILE_AND_TOOLSET                           0x2
#define VIDEO_RESOLUTION                              0x4
#define MINIMUM_FRAME_INTERVAL                        0x8
#define SLICE_MODE                                    0x10
#define RATE_CONTROL_MODE                             0x20
#define AVERAGE_BIT_RATE                              0x40
#define CPB_SIZE                                      0x80
#define PEAK_BIT_RATE                                 0x100
#define QUANTIZATION_PARAMETER                        0x200
#define SYNCHRONIZATION_AND_LONGTERM_REFERENCE_FRAME  0x400
#define LONG_TERM_BUFFER                              0x800
#define PICTURE_LONG_TERM_REFERENCE                   0x1000
#define LTR_VALIDATION                                0x2000
#define LEVEL_IDC                                     0x4000
#define SEI_MESSAGE                                   0x8000
#define QP_RANGE                                      0x10000
#define PRIORITY_ID                                   0x20000
#define START_OR_STOP_LAYER_VIEW                      0x40000
#define ERROR_RESILIENCY                              0x80000

#define  SELECT_LAYERL_LEN                                0x2
#define  PROFILE_AND_TOOLSET_LEN                          0x5
#define  VIDEO_RESOLUTION_LEN                             0x4
#define  MINIMUM_FRAME_INTERVAL_LEN                       0x4
#define  SLICE_MODE_LEN                                   0x4
#define  RATE_CONTROL_MODE_LEN                            0x1
#define  AVERAGE_BIT_RATE_LEN                             0x4
#define  CPB_SIZE_LEN                                     0x4
#define  PEAK_BIT_RATE_LEN                                0x4
#define  QUANTIZATION_PARAMETER_LEN                       0x6
#define  SYNCHRONIZATION_AND_LONGTERM_REFERENCE_FRAME_LEN 0x4
#define  LONG_TERM_BUFFER_LEN                             0x2
#define  PICTURE_LONG_TERM_REFERENCE_LEN                  0x2
#define  LTR_VALIDATION_LEN                               0x2
#define  LEVEL_IDC_LEN                                    0x1
#define  SEI_MESSAGE_LEN                                  0x8
#define  QP_RANGE_LEN                                     0x2
#define  PRIORITY_ID_LEN                                  0x1
#define  START_OR_STOP_LAYER_VIEW_LEN                     0x1
#define  ERROR_RESILIENCY_LEN                             0x2

#define UVC_CID_SELECT_LAYER                                  UVC_CID_EU_CLASS_BASE | SELECT_LAYER
#define UVC_CID_PROFILE_AND_TOOLSET                           UVC_CID_EU_CLASS_BASE | PROFILE_AND_TOOLSET
#define UVC_CID_VIDEO_RESOLUTION                              UVC_CID_EU_CLASS_BASE | VIDEO_RESOLUTION
#define UVC_CID_MINIMUM_FRAME_INTERVAL                        UVC_CID_EU_CLASS_BASE | MINIMUM_FRAME_INTERVAL
#define UVC_CID_SLICE_MODE                                    UVC_CID_EU_CLASS_BASE | SLICE_MODE
#define UVC_CID_RATE_CONTROL_MODE                             UVC_CID_EU_CLASS_BASE | RATE_CONTROL_MODE
#define UVC_CID_AVERAGE_BIT_RATE                              UVC_CID_EU_CLASS_BASE | AVERAGE_BIT_RATE
#define UVC_CID_CPB_SIZE                                      UVC_CID_EU_CLASS_BASE | CPB_SIZE
#define UVC_CID_PEAK_BIT_RATE                                 UVC_CID_EU_CLASS_BASE | PEAK_BIT_RATE
#define UVC_CID_QUANTIZATION_PARAMETER                        UVC_CID_EU_CLASS_BASE | QUANTIZATION_PARAMETER
#define UVC_CID_SYNCHRONIZATION_AND_LONGTERM_REFERENCE_FRAME  UVC_CID_EU_CLASS_BASE | SYNCHRONIZATION_AND_LONGTERM_REFERENCE_FRAME
#define UVC_CID_LONG_TERM_BUFFER                              UVC_CID_EU_CLASS_BASE | LONG_TERM_BUFFER
#define UVC_CID_PICTURE_LONG_TERM_REFERENCE                   UVC_CID_EU_CLASS_BASE | PICTURE_LONG_TERM_REFERENCE
#define UVC_CID_LTR_VALIDATION                                UVC_CID_EU_CLASS_BASE | LTR_VALIDATION
#define UVC_CID_LEVEL_IDC                                     UVC_CID_EU_CLASS_BASE | LEVEL_IDC
#define UVC_CID_SEI_MESSAGE                                   UVC_CID_EU_CLASS_BASE | SEI_MESSAGE
#define UVC_CID_QP_RANGE                                      UVC_CID_EU_CLASS_BASE | QP_RANGE
#define UVC_CID_PRIORITY_ID                                   UVC_CID_EU_CLASS_BASE | PRIORITY_ID
#define UVC_CID_START_OR_STOP_LAYER_VIEW                      UVC_CID_EU_CLASS_BASE | START_OR_STOP_LAYER_VIEW
#define UVC_CID_ERROR_RESILIENCY                              UVC_CID_EU_CLASS_BASE | ERROR_RESILIENCY

#define RATE_CONTROL_MODE_CTL_MODE_VBR 0x1
#define RATE_CONTROL_MODE_CTL_MODE_CBR 0x2
#define RATE_CONTROL_MODE_CTL_MODE_Constant_QP 0x3
#define RATE_CONTROL_MODE_CTL_MODE_GVBR  0x4
#define RATE_CONTROL_MODE_CTL_MODE_VBRN  0x5
#define RATE_CONTROL_MODE_CTL_MODE_GVBRN 0x6

#define PROFILE_AND_TOOLSET_CTL_CONSTRAINED_BASELINE_PROFILE 0x4240
#define PROFILE_AND_TOOLSET_CTL_BASELINE_PROFILE             0x4200
#define PROFILE_AND_TOOLSET_CTL_MAIN_PROFILE                 0x4D00
#define PROFILE_AND_TOOLSET_CTL_CONSTRAINED_HIGH_PROFILE     0x640C
#define PROFILE_AND_TOOLSET_CTL_HIGH_PROFILE                 0x6400
#define PROFILE_AND_TOOLSET_CTL_SCALABLE_CONSTRAINED_BASELINE_PROFILE 0x5304
#define PROFILE_AND_TOOLSET_CTL_SCALABLE_BASELINE_PROFILE             0x5300
#define PROFILE_AND_TOOLSET_CTL_SCALABLE_CONSTRAINED_HIGH_PROFILE     0x5604
#define PROFILE_AND_TOOLSET_CTL_SCALABLE_HIGH_PROFILE                 0x5600
#define PROFILE_AND_TOOLSET_CTL_MULTIVIEW_HIGH_PROFILE                0x7600
#define PROFILE_AND_TOOLSET_CTL_STEREO_HIGH_PROFILE                   0x8000

#define SLICE_MODE_CTL_MODE_MAX_MBS_PER_SLICE                    0x0
#define SLICE_MODE_CTL_MODE_TARGET_COMPRESSED_SIZE_PER_SLICE     0x1
#define SLICE_MODE_CTL_MODE_NUMBER_OF_SLICES_PER_FRAME           0x2
#define SLICE_MODE_CTL_MODE_NUMBER_OF_MACROBLOCK_ROWS_PER_SLICE  0x3

#define SYNC_AND_LTR_FRAME_CTL_RESET 0x0
#define SYNC_AND_LTR_FRAME_CTL_IDR   0x1
#define SYNC_AND_LTR_FRAME_CTL_LONG_TERM_REF_IDR        0x2
#define SYNC_AND_LTR_FRAME_CTL_NON_IDR_RAND_I_FRAME     0x3
#define SYNC_AND_LTR_FRAME_CTL_LTR_NON_IDR_RAND_I_FRAME 0x4
#define SYNC_AND_LTR_FRAME_CTL_LTR_P_FRAME              0x5

#define LONG_TERM_BUFFER_CTL_TRUSTMODE_NOT_TRUST  0x0
#define LONG_TERM_BUFFER_CTL_TRUSTMODE_TRUST      0x1

#define SEI_MESSAGE_CTL_BUFFERING_PERIOD  0x1
#define SEI_MESSAGE_CTL_PIC_TIMING        0x2
#define SEI_MESSAGE_CTL_PAN_SCAN_RECT     0x4
#define SEI_MESSAGE_CTL_FILLER_PAYLOAD    0x8
#define SEI_MESSAGE_CTL_USER_DATA_REGISTERED_ITU_T_T35  0x10
#define SEI_MESSAGE_CTL_USER_DATA_UNREGISTERED          0x20
#define SEI_MESSAGE_CTL_RECOVERY_POINT                  0x40
#define SEI_MESSAGE_CTL_DEC_REF_PIC_MARKING_REPETITION  0x80
#define SEI_MESSAGE_CTL_SPARE_PIC     0x100
#define SEI_MESSAGE_CTL_SCENE_INFO    0x200
#define SEI_MESSAGE_CTL_SUB_SEQ_INFO  0x400
#define SEI_MESSAGE_CTL_SUB_SEQ_LAYER_CHARACTERISTICS  0x800
#define SEI_MESSAGE_CTL_SUB_SEQ_CHARACTERISTICS        0x1000
#define SEI_MESSAGE_CTL_FULL_FRAME_FREEZE              0x2000
#define SEI_MESSAGE_CTL_FULL_FRAME_FREEZE_RELEASE      0x4000
#define SEI_MESSAGE_CTL_FULL_FRAME_SNAPSHOT            0x8000
#define SEI_MESSAGE_CTL_PROGRESSIVE_REFINEMENT_SEGMENT_START   0x10000
#define SEI_MESSAGE_CTL_PROGRESSIVE_REFINEMENT_SEGMENT_END     0x20000
#define SEI_MESSAGE_CTL_MOTION_CONSTRAINED_SLICE_GROUP_SET     0x40000
#define SEI_MESSAGE_CTL_FILM_GRAIN_CHARACTERISTICS             0x80000
#define SEI_MESSAGE_CTL_DEBLOCKING_FILTER_DISPLAY_PREFERENCE   0x100000
#define SEI_MESSAGE_CTL_STEREO_VIDEO_INFO                      0x200000
#define SEI_MESSAGE_CTL_POST_FILTER_HINT                       0x400000
#define SEI_MESSAGE_CTL_TONE_MAPPING_INFO                      0x800000
#define SEI_MESSAGE_CTL_SCALABILITY_INFO                       0x1000000
#define SEI_MESSAGE_CTL_SUB_PIC_SCALABLE_LAYER                 0x2000000
#define SEI_MESSAGE_CTL_NON_REQUIRED_LAYER_REP                 0x4000000
#define SEI_MESSAGE_CTL_PRIORITY_LAYER_INFO                    0x8000000
#define SEI_MESSAGE_CTL_LAYERS_NOT_PRESENT                     0x10000000
#define SEI_MESSAGE_CTL_LAYER_DEPENDENCY_CHANGE                0x20000000
#define SEI_MESSAGE_CTL_SCALABLE_NESTING                       0x40000000
#define SEI_MESSAGE_CTL_BASE_LAYER_TEMPORAL_HRD                0x80000000
#define SEI_MESSAGE_CTL_QUALITY_LAYER_INTEGRITY_CHECK          0x100000000
#define SEI_MESSAGE_CTL_REDUNDANT_PIC_PROPERTY                 0x200000000
#define SEI_MESSAGE_CTL_TL0_DEP_REP_INDEX                      0x400000000
#define SEI_MESSAGE_CTL_TL_SWITCHING_POINT                     0x800000000
#define SEI_MESSAGE_CTL_PARALLEL_DECODING_INFO                 0x1000000000
#define SEI_MESSAGE_CTL_MVC_SCALABLE_NESTING                   0x2000000000
#define SEI_MESSAGE_CTL_VIEW_SCALABILITY_INFO                  0x4000000000
#define SEI_MESSAGE_CTL_MULTIVIEW_SCENE_INFO                   0x8000000000
#define SEI_MESSAGE_CTL_MULTIVIEW_ACQUISITION_INFO             0x10000000000
#define SEI_MESSAGE_CTL_NON_REQUIRED_VIEW_COMPONENT            0x20000000000
#define SEI_MESSAGE_CTL_VIEW_DEPENDENCY_CHANGE                 0x40000000000
#define SEI_MESSAGE_CTL_OPERATION_POINTS_NOT_PRESENT           0x80000000000
#define SEI_MESSAGE_CTL_BASE_VIEW_TEMPORAL_HRD                 0x100000000000
#define SEI_MESSAGE_CTL_FRAME_PACKING_ARRANGEMENT              0x200000000000

#define  UVC_CID_XU_CLASS_BASE    (UVC_ET_XU << ET_POS)

#define UVC_VSCID_PROBE_CONTROL       UVC_VS_PROBE_CONTROL
#define UVC_VSCID_COMMIT_CONTROL      UVC_VS_COMMIT_CONTROL
#define UVC_VSCID_STILL_PROBE      UVC_VS_STILL_PROBE_CONTROL
#define UVC_VSCID_STILL_COMMIT     UVC_VS_STILL_COMMIT_CONTROL
#define UVC_VSCID_STILL_IMAGE_TRIGGER   UVC_VS_STILL_IMAGE_TRIGGER_CONTROL
#define UVC_VSCID_STREAM_ERROR_CODE     UVC_VS_STREAM_ERROR_CODE_CONTROL
#define UVC_VSCID_GENERATE_KEY_FRAME    UVC_VS_GENERATE_KEY_FRAME_CONTROL
#define UVC_VSCID_UPDATE_FRAME_SEGMENT  UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL
#define UVC_VSCID_SYNC_DELAY            UVC_VS_SYNC_DELAY_CONTROL

#define PROBE_LEN                                         48
#define PROFILE_AND_TOOLSET_LEN                          0x5
#define UVC_VSCID_PROBE         UVC_VS_PROBE_CONTROL << 8
#define UVC_VSCID_COMMIT         UVC_VS_COMMIT_CONTROL << 8

#endif // __UVC_API_INTERNAL_H__
