////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  chxdefs.h
/// @brief CHX common definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CHXDEFS_H
#define CHXDEFS_H

#include <vector>

#include "camera3.h"
#include "camxcdktypes.h"
#include "chivendortag.h"

// NOWHINE ENTIRE FILE - Temporarily bypassing for existing CHI files

#define CHX_STATIC_ASSERT(condition)   static_assert(condition, #condition)
#define CHX_ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0]))

/// Constants
static const UINT   MaxChiStreams          = 20;                         ///< Maximum number of CHI streams
static const UINT32 MaxOutstandingRequests = 256;                        ///< Number is bigger to prevent throttling of the
                                                                         ///  preview pipeline
static const UINT32 MaxPendingFrameNumber  = MaxOutstandingRequests;     ///< Max valid number mapping between Framework and CHI
                                                                         ///  keep same with MaxOutstandingRequests
static const INT    InvalidIndexInt32              = 0x7FFFFFFF;         ///  Invalid integer frame Number
static const INT64  InvalidFrameNumber             = 0x7FFFFFFFFFFFFFFF; ///< Invalid frame number

static const UINT32 INVALIDSEQUENCEID              = 0xFFFFFFFF;         ///< Invalid sequence id
static const UINT32 INVALIDFRAMENUMBER             = 0xFFFFFFFF;         ///< Invalid frame number

static const UINT   tuningUsecasePreviewMask       = 1;                  ///< Mask to indicate to preview usecase.
static const UINT   tuningUsecaseVideoMask         = 2;                  ///< Mask to indicate to video usecase.
static const UINT   tuningUsecaseSnapshotMask      = 4;                  ///< Mask to indicate to snapshot usecase.
static const UINT   tuningUsecaseZSLMask           = 8;                  ///< Mask to indicate to ZSL usecase.

static const UINT   CHIImmediateBufferCountDefault = 2;                  ///< Number of buffers to allocate immediately when
                                                                         ///  chi buffer manager is being created.
static const UINT   CHIImmediateBufferCountZSL     = 3;                  ///< Number of buffers to allocate immediately when
                                                                         ///  chi buffer manager is being created for zsl usecase.

static const UINT32 Resolution48MPWidth            = 8000;               ///< 48MP width
static const UINT32 Resolution48MPHeight           = 6000;               ///< 48MP height
static const UINT32 UHD8KResolutionWidth           = 7680;               ///< 8K UHD resolution width
static const UINT32 UHD8KResolutionHeight          = 4320;               ///< 8K UHD resolution height
static const UINT32 FHDResolutionWidth             = 1920;               ///< FHD resolution width
static const UINT32 FHDResolutionHeight            = 1080;               ///< FHD resolution height
static const UINT32 VGAResolutionWidth             = 640;                ///< VGA resolution width
static const UINT32 VGAResolutionHeight            = 480;                ///< VGA resolution height
static const UINT8  MultiPreviewWindows            = 2;                  ///< Number of Preview Windows to enable Y2Y
static const UINT8  MaxNumSnapshotStreams          = 2;                  ///< Number of Snapshot streams that are supported
static const UINT8  NumSinglePipeline              = 1;                  ///< Denotes single pipeline

static const UINT32 UninitializedNumberOfPixelsPerColor = 0xFFFFFFFF;    ///< Uninitialized number of pixels per color
static const UINT32 InvalidNumberOfPixelsPerColor       = 0xFFFFFFFE;    ///< Invalid value of number of pixels per color
static const UINT32 InvalidBinningFactor                = 0xFFFFFFFF;    ///< Invalid value of binning factor
static const UINT32 InvalidBinningSizeValue             = 0xFFFFFFFF;    ///< Invalid value of Binning size width and height
static const UINT32 NumberOfPixelsPerColorForHWRemosaic = 1;             ///< number of pixels per color if HW remosaic is enabled.


static const UINT   RTYUVOutputCap                  = 3840 * 2160;       ///< Realtime YUV output capabilities
static const UINT   RTYUVDisplayCap                 = 1920* 1080;        ///< Realtime YUV display capabilities
static const UINT   RTYUVOutputCapInMimas           = (1920 * 1080) + 1; ///< Realtime YUV output capabilities in Mimas
static const UINT   MultiPreviewCapInMimas2         = 2048 * 1536;       ///< Max resolution for enabling multi preview


/// @brief Usecase identifying enums
enum class UsecaseId
{
    NoMatch             = 0,
    Default             = 1,
    Preview             = 2,
    PreviewZSL          = 3,
    MFNR                = 4,
    MFSR                = 5,
    MultiCamera         = 6,
    XCFA                = 7,
    RawJPEG             = 8,
    MultiCameraVR       = 9,
    Torch               = 10,
    YUVInBlobOut        = 11,
    VideoLiveShot       = 12,
    SuperSlowMotionFRC  = 13,
    Feature2            = 14,
    Depth               = 15,
    AON                 = 16,
    EVS                 = 17,
    MaxUsecases         = 18,
};

// List of Vendor Tags
enum class VendorTag
{
    SensorBpsModeIndex  = 0,                ///< SensorBpsModeIndex
    SensorBpsGain,                          ///< SensorBpsGain
    DebugDataTag,                           ///< DebugData
    DebugDataTagTuningMeta,                 ///< DebugData info of tuning meta
    SensorModeIndex,                        ///< SensorModeIndices
    CurrentSensorMode,                      ///< Current sensor mode index
    CropRegions,                            ///< Crop Regions
    TuningMode,                             ///< TagTuningMode
    RefCropSize,                            ///< Ref crop size
    MultiCamera,                            ///< multicamera
    IsFlashRequiredTag,                     ///< Is Flash Required for Snapshot
    Feature1Mode,                           ///< Feature1Mode
    Feature2Mode,                           ///< Feature1Mode
    VideoHDR10Mode,                         ///< Video HDR10 Mode
    StatsSkipMode,                          ///< Force skip stats processing
    BurstFps,                               ///< Burst Fps indicates vendor tag coming from APP
    BurstShot,                              ///< Burst Shot indicates vendor tag to determine 2 consecutive JPEG/YUV/HEIF streams
    CustomNoiseReduction,                   ///< MFNR  Hint
    FastShutterMode,                        ///< FS mode
    IHDRControl,                            ///< IHDR Control
    HistNodeLTCRatioIndex,                  ///< LTC ratio from histogram node
    IFEMaxWidth,                            ///< Max single IFE supported
    ZSLTimestampRange,                      ///< Range of time within which to pull ZSL Buffers
    IPEOverrideScale,                       ///< IPE Override Scale Flag
    LivePreview,                            ///< Live Preview Enablement flag
    SnapshotFrameExposureType,              ///< Exposure Type of the Live Snapshot Frame being processed
    SnapshotNumOfExposures,                 ///< Number of Exposure frames used for MFHDR, 2 or 3 Exposures
    DebugDumpConfig,                        ///< Record timestamp and app frame number
    GPUOverrideRotation,                    ///< GPU Node Rotation
    SWMCTFEnable,                           ///< SWMCTF Node enablement
    ScreenGrab,                             ///< Is ScreenGrab Snapshot
    MFNRCapability,                         ///< MFNR Capability
    T2TConfigRegROI,                        ///< Tracker registration ROI from application
    T2TResultROI,                           ///< Tracker result ROI from driver
    SeemlessInSensorZoomModeSwitch,         ///< InSensorZoom Mode Switch
    SeemlessInSensorZoomState,              ///< InSensorZoom State
    BayerAlignmentSize,                     ///< Bayer alignment frame size
    EnableMFNR,                             ///< Flag indicating MF Feature enablement
    EnableSHDR,                             ///< SHDR mode is enabled
    EnableMFHDR,                            ///< MFHDR mode is enabled
    HDRMode,                                ///< HDR modes to enable
                                            ///  000 : None, 001 : SHDR, 010 : MFHDR, 100 : QHDR,
                                            ///  011 : SHDR + MFHDR, 101 : SHDR + QHDR,
                                            ///  110 : MFHDR + QHDR, 111 : SHDR + MFHDR + QHDR
    SnapshotHDRMode,                        ///< Session parameter to enable Multi Frame HDR Snapshot
                                            ///  0 : Single Frame(ADRC), 1 : Multi Frame HDR Snapshot
    MetadataOwnerCamId,                     ///< Owner of given metadata used in multicam case
    NumPCRsBeforeStreamOn,                  ///< Number of PCRs before stream on (earlyPCR)
    EnableMCXMasterCb,                      ///< Flag indicating MasterRawCb enablement
    RawCbSourceType,                        ///< Flag indicating Raw callback source type
    HDRVideoModeSession,                    ///< HDRVideoMode enablement
    ExtendedMaxZoom,                        ///< Extended MaxZoom
    SaliencyNumOfROI,                       ///< Number of salient ROIs
    SaliencyROIData,                        ///< Saliency ROI Data from driver
    SensorModeInfo,                         ///< SensorModeInfo
    McxYuvCbInfo,                           ///< Multicamera YUV callback information
    McxRawCbInfo,                           ///< Multicamera RAW callback information
    DynamicFPSConfig,                       ///< Configuration of video dynamic FPS
    QLLControl,                             ///< QLL frame control
    AnchorSync,                             ///< fix anchor frame picked
    MultiFrameBurstCount,                   ///< number of multiframe burst
    MultiFrameBurst,                        ///< Enable multiframe burst
    HWMFHDRSupported,                       ///< MFHDR fuse value
    SWMCTFEnableWithRef,                    ///< SWMCTF enable with reference frame handling in node
    EnableQLL,                              ///< QLL mode is enabled from UI
    EnableVIULL,                            ///< VIULL mode is enabled from UI
    IsQLLSupported,                         ///< QLL mode is supported
    IsDMMSupported,                         ///< DMM is supported
    EnableSWMF,                             ///< SWMF is enabled from application
    EnableAIDE,                             ///< AIDE is enabled from application
    EnableShadingCorrection,                ///< Enable SWBEstats in offline snapshot path
    EnableSWPDPC,                           ///< Enable SWPDPC in offline snapshot path
    FacialContourVersion,                   ///< Facial countour version
    EnableStatsVisualizer,                  ///< Stats Visualizer Is Enabled from UI
    InSensorSHDRMode,                       ///< Insensor SHDR mode capability
    EnableInsensorZoom,                     ///< Session parameter to enable insensor zoom
    EnableSnapshotOnlyInsensorZoom,         ///< Session parameter to enable snapshot only insensor zoom
    EnableQHDR,                             ///< QHDR mode is enabled
    EnableAutoHDR,                          ///< Auto HDR mode is enabled
    EnableOfflineSHDR,                      ///< Offline SHDR mode is enabled
    NumHDRExposure,                         ///< Override to force HDR with num of exposures, permitted values 1,2,3
    HDRModePreference,                      ///< List of HDR modes for Auto HDR where order is their preference
    EnableAFBracketing,                     ///< AF Braketing mode is enabled or not
    EnableVSR,                              ///< Flag indicating VSR is enabled
    OverrideResourceCostValidation,         ///< Override resource cost validation
    EnableSalinet,                          ///< Salinet enable/disable from UI
    McxInputZoomMetadata,                   ///< Input zoom information
    McxOutputZoomMetadata,                  ///< Output zoom information
    McxPixelShift,                          ///< Multicamera Pixel shift information
    McxMasterCamera,                        ///< Multicamera master information
    McxActiveCameraMask,                    ///< Multicamera identifier information
    McxSyncMode,                            ///< Multicamera sync mode
    McxFpsMatch,                            ///< Flag to indicate fps match is needed
    McxLPM,                                 ///< Multicamera low power mode
    McxPhyCamFOVMargin,                     ///< Multicamera FOV margin
    TransitionMode,                         ///< Transition mode based on exposure type
    McxInputBokehMetadata,                  ///< Bokeh input information
    IFEAppliedCrop,                         ///< IFE applied Crop information
    IFEResidualCrop,                        ///< IFE residual Crop information
    SensorAppliedCrop,                      ///< Sensor applied crop
    AecLux,                                 ///< AEC Lux information
    StreamCropInfo,                         ///< Stream Crop information
    HDRFeatureMode,                         ///< HDR Feature mode
    HDRFeatureModeData,                     ///< HDR Feature Mode data
    Feature2IsSnapshot,                     ///< Flag to indicate whether the current request is snapshot
    PrimaryPipelinesActiveInAuxSessionMask, ///< Primary pipeline active in auxiliary session
    ActiveAuxCameraInfo,                    ///< Active auxiliary camera info
    enableSecureMode,                       ///< Secure Mode session tag
    ForceFullFOV,                           ///< ForceFullFOV indicating ForceFullFOV is enabled
    StillOutputDimension,                   ///< Snapshot still output dimension
    DisplayOutputDimension,                 ///< Snapshot display output dimension
    AppOutputDimension,                     ///< Snapshot display output dimension
    IsGeoLibNeeded,                         ///< GeoLib calculations needed for snapshot
    HoriCountIndex,                         ///< com.qti.stats.af section
    VertCountIndex,                         ///< com.qti.stats.af section
    WidthRegionIndex,                       ///< com.qti.stats.af section
    HeightRegionIndex,                      ///< com.qti.stats.af section
    HoriOffsetIndex,                        ///< com.qti.stats.af section
    VertOffsetIndex,                        ///< com.qti.stats.af section
    ConfidenceMapIndex,                     ///< com.qti.stats.af section
    DistanceMapIndex,                       ///< com.qti.stats.af section
    AFSelectionMapIndex,                    ///< com.qti.stats.af section
    DefocusMapIndex,                        ///< com.qti.stats.af section
    BERStats,                               ///< org.codeaurora.qcamera3.bayer_exposure section
    BEGStats,                               ///< org.codeaurora.qcamera3.bayer_exposure section
    BEBStats,                               ///< org.codeaurora.qcamera3.bayer_exposure section
    BGRStats,                               ///< org.codeaurora.qcamera3.bayer_grid section
    BGGStats,                               ///< org.codeaurora.qcamera3.bayer_grid section
    BGBStats,                               ///< org.codeaurora.qcamera3.bayer_grid section
    HistogramStats,                         ///< org.codeaurora.qcamera3.histogram section
    OEMJPEGLumaQuantizationTable,           ///< org.quic.camera2.jpegquantizationtables section
    OEMJPEGChromaQuantizationTable,         ///< org.quic.camera2.jpegquantizationtables section
    CVPMetaData,                            ///< org.quic.camera.cvpMetaData section
    CVPDynamicMode,                         ///< org.quic.camera.cvpMetaData section
    FOVCFrameControl,                       ///< org.quic.camera2.statsconfigs section
    IFOVCFrameControl,                      ///< org.quic.camera2.statsconfigs section
    AEBracketing,                           ///< AE Bracketing Mode
    RawSize,                                ///< Raw size vendor tag
    RealtimeMetadataOpticalZoom,            ///< Realtime Metadata Optical Zoom
    InputMetadataForSwitchController,       ///< Switch Controller
    MasterCamera,                           ///< Master Camera
    OutputMetadataStreamMask,               ///< Output Metadata Stream Mask
    MetadataOwner,                          ///< Metadata Owner
    is_flash_snapshot,                      ///< Is Flash Snapshot
    AECFrameControl,                        ///< AEC Frame Control
    is_lls_needed,                          ///< Is LLS Needed
    EnableIdealRaw,                         ///< Is ideal raw used.
    DynamicModeSwitch,                      ///< Dynamic sensor Mode switch
    EnableADRCpath,                         ///< Enable ADRC path
    FaceContoursResult,                     ///< Face contour result
    FaceMaskResult,                         ///< Face mask result
    FaceUpperBodyResult,                    ///< Upper body result
    EnableOfflineIFE,                       ///< Enable offline IFE session tag
    AEBSnapshotMode,                        ///< AEB snapshot mode. (SingleExp=0, NonHDR=1, HDR=2)
    AEBSnapshotPath,                        ///< AEB snapshot path. (Short=0, Long=1)
    AICameraMode,                           ///< AI Camera Mode
    OEMAECTrigger,                          ///< OEM AEC Trigger
    OEMAWBTrigger,                          ///< OEM AWB Trigger
    OEMAFTrigger,                           ///< OEM AF Trigger
    OEMReserveTrigger,                      ///< OEM Reserved Trigger
    EnableHVXMFHDRMode,                     ///< HVX MFHDR mode
    EnableHVXSHDRMode,                      ///< HVX SHDR mode
    VideoRetouchSupported,                  ///< Video Re-touch Supported section
    EnableVideoRetouch,                     ///< video Re-touch enabled section
    AICamera,                               ///< AI Camera for AI snapshot flow
    EnableXHDR,                             ///< Enable XHDR
    SupportedAICameraModes,                 ///< AI Camera Modes
    NumHWInputFrames,                       ///< Number of HW input frames for offline camera
    FeatureTag,                             ///< Offline camera feature tag
    HWProfileId,                            ///< Offline camera HW profile Id
    SensorModeFS,                           ///< Enable FS
    EnableBDSSplitMode,                     ///< BDS feature enable tag
    BlurMode,                               ///< Blur Mode
    WarpsCropTransform,                     ///< ROI transformation info
    ICAInGridOut2InTransform,               ///< LDC Out to In grid
    ICAInPerspectiveTransform,              ///< EIS Stabilize matrix
    ICASnapshotGridOut2InTrans,             ///< LDC Out to In grid for snapshot
    ICASnapshotPerspectiveTrans,            ///< EIS Stabilize matrix for snapshot
    IFERDIStreamCrop,                       ///< IFE stream crop in RDI path
    SelectPriority,                         ///< iso exp priority
    UseIsoExpPriority,                      ///< use iso exp priority
    SharedSinkTargetInfo,                   ///< shared sink target info
    ExposureCount,                          ///< exposure count
    BitSwitchMode,                          ///< bit switch mde
    StackedFrame,                           ///< stacked frame
    IdealRaw,                               ///< ideal raw
    PerStreamHDRMode,                       ///< Per stream HDR mode
    MultiCameraControlZSLMode,              ///< MultiCameraControlZSLMode
    EnableCinematicMode,                    ///< EnableCinematicMode
    DepthFrameSyncInfo,                     ///< com.qti.camera.depth section
    XCFARemosaicType,                       ///< Remosaic Type used in (mcx)realtime Feature
    IsXCFAPZSLSnapshot,                     ///< Is XCFA PZSL snapshot
    CameraStatusInfo,                       ///< camera status info
    InSensorZoomStateTag,                   ///< InSensorZoom State
    SensorSwitchedTag,                      ///< Sensor switched
    EISHorizonLevel,                        ///< Control for EIS horizon leveling override
    EnableXCFAOptimization,                 ///< Enable XCFA Optimization
    GeoLibHDRFlowMode,                      ///< HDR mode used by GeoLib
    EnableAIDE2,                            ///< AIDE2 is enabled from application
    EnableMFNRAIDEMode,                     ///< AIDE2 mode is enabled
    ExtraPreviewMaxBuffers,                 ///< Additional max buffers for preview
    EnableOfflineHALZSL,                    ///< skip zsl raw buffer session tag
    AFRegion,                               ///< AF ROI
    IPEUBWCDisplayStatsTag,                 ///< UBWCDisplayStats reported from IPE
    IPEUBWCVideoStatsTag,                   ///< UBWCVideoStats reported from IPE
    EISMode,                                ///< EIS Mode
    LowResolutionUpscale,                   ///< LowResolutionUpscale for IPE
    SegMetaOutTag,                          ///< com.qti.chi.segmentation section
    SegFaceStatsMetaOutTag,                 ///< com.qti.chi.segmentation section
    FinalScalerCropRegion,                  ///< Without SAT Margin, but will contatin EIS Margin.
    EnableHMEMode,                          ///< HME mode tag
    EnabledISPSensorGroupConfigTag,         ///< org.codeaurora.qcamera3.EnabledISPSensorGroupConfig section
    EnabledISPGroupsConfigTag,              ///< Enable ISP group config
    ExtRecoveryInfoTag,                     ///< enable external recovery
    EnableSWMCTF,                           ///< enable swmctf through session parameter
    NumVendorTags                           ///< Max Tags
};

// Enum Class for Partial Result Count
enum class PartialResultCount
{
    NoPartialResult     = 0,
    FirstPartialResult  = 1,
    SecondPartialResult = 2,
    ThirdPartialResult  = 3,
};

// Enum Class for Total Partial Metadata that will be sent
enum class MetaDataResultCount
{
    NoMetaDataCount     = 0,
    OneMetaDataCount    = 1,
    TwoMetaDataCount    = 2,
    ThreeMetaDataCount  = 3,
};

// Enum Class for Partial Metadata sender
enum class PartialResultSender
{
    DriverPartialData = 0,
    CHIPartialData    = 1,
    DriverMetaData    = 2,
};

// Enum Class for Partial Metadata support from CHI
enum class PartialMetaSupport
{
    NoSupport           = 0,
    SeperatePartialMeta = 1,
    CombinedPartialMeta = 2,
};

/// @brief Information about the last frame returned to the framework for a given stream
struct PerStreamBufferReturnInfo
{
    camera3_stream_t*   pCameraStream;                          ///< Camera stream
    UINT64              activeFrames[MaxOutstandingRequests];   ///< Last framework number buffer returned on this stream
    UINT32              lastIndexEnqueued;                      ///< Last index for slot used in the activeFrames array
    UINT32              lastIndexDequeued;                      ///< Last index we removed a frame from
};

/// @brief Association info for CHI frames
struct ChiFrameNumAssociationInfo
{
    UINT32                      appFrameNumber;             ///< HALFrameNumber
    UINT32                      chiOverrideFrameNum;        ///< CHiFrameNumber
    UINT32                      chiAssociatedframeNum;      ///< Associated CHiFrameNumber given by the derived usecase/feature
    VOID*                       pAssociatedSesssionHandle;  ///< Associated Sesssion Handle
    VOID*                       pAssociatedPipelineHandle;  ///< Associated Pipeline Handle
};

/// @brief HDR info for a logical or physical camera
struct HDRDeviceInfo
{
    UINT32                          cameraId;       ///< The camera id for the device entry
    UINT32                          numHDRExposure; ///< The number of exposures to use for HDR
    std::vector<ChiHDRFeatureMode>  HDRStaticCaps;  ///< The static capability supported HDR modes for the physical camera
    ChiHDRModeInfo                  HDRModeInfo;    ///< The HDR mode info for the camera
};

/// @brief HDR info for the device
struct HDRInfo
{
    HDRDeviceInfo*                 pLogicalHDRDeviceInfo;   ///< The logical HDR device info
    UINT32                         numPhysicalCameras;      ///< The number of physical cameras
    HDRDeviceInfo**                ppPhysicalHDRDeviceInfo; ///< Array of physical HDR device info
    BOOL                           isAutoHDREnabled;        ///< Flag indicating whether we are in Auto HDR mode
    BOOL                           isAutoHDRSetByOverride;  ///< Flag indicating whether auto HDR is set by override setting
    std::vector<ChiHDRFeatureMode> sessionParameters;       ///< The session parameters from the application for the
                                                            ///  physical camera
    std::vector<ChiHDRFeatureMode> HDRModePreference;       ///< The order in which we prefer a given HDR mode, can be all or a
                                                            ///  subset of the max hdr modes
    UINT32                         appReqNumHDRExposure;    ///< The number of exposures to use for HDR
    UINT                           masterCameraIndex;       ///< The index of the current master camera
    BOOL                           appEnabledQHDR;          ///< Is app enabled QHDR to differentiate QCFA
    BOOL                           HVXHDREnabled;           ///< Is HDR enabled is HVX based.
    BOOL                           isSnapshotHDRMode;       ///< Is App requested Multi Frame HDR Snapshot
};

/// @brief Various SW HDR modes supported
enum SWHDRFeatureMode
{
    SWSHDRNone,
    SWSHDRLI2Frame,
    SWYUVSHDRVC2Frame,
    SWSHDRVC2Frame,
    SWSHDRVC3Frame,
    SWSHDRV2VC2Frame,
    SWSHDRMax,
};

/// @brief nonZSL snapshot type
enum class ChiFeature2NZSLSnapshotType
{
    None          = 0,                               ///< No need to configure non-zsl snapshot
    NZSLXCFA      = 1 << 0,                          ///< Need non-zsl for XCFA
    NZSLSHDR      = 1 << 1,                          ///< Need non-zsl for SHDR
    PseudoZSLXCFA = 1 << 2,                          ///< Need pseudo-zsl for XCFA
};

/// @brief physical camera info for quad cfa
struct ChiFeature2XCFASensorInfo
{
    BOOL            isXCFASensor;                    ///< Flag to indicate if is a XCFA sensor
    BOOL            isQCFAseamless;                  ///< Flag to indicate seamless switch
    UINT            xCFAModeIdx;                     ///< Sensor mode index of the selected XCFA mode
    ChiRemosaicType remosaicType;                    ///< Sensor remosaic type, sw or hw
    CHIDIMENSION    sizeOfXCFA;                      ///< Sensor output size of the selected XCFA mode
    UINT32          xCFABinningFactor;               ///< Binning factor of the selected XCFA mode
    UINT32          numPixelsPerColor;               ///< Number of pixels per Color
    CFAPattern      cFAPattern;                      ///< CHI XCFA type
};

/// @brief sensor bit switch capability
struct SensorBitSwitchCap
{
    BOOL    supportBitSwitch;                         ///< Flag to indicate if support bit switch
    UINT    physicalCameraIndex;                      ///< Physical camera index
    UINT32  bpp;                                      ///< IDCG mode bit per pixel
};

/// @brief sensor bit switch capability
struct ChiFeature2SensorBitSwitchCap
{
    UINT32                          numPhysicalCameras;       ///< The number of physical cameras
    std::vector<SensorBitSwitchCap> sensorBitSwitchCapArray;  ///< Array of sensor bit switch capability
};

/// @brief non-zsl config info
struct ChiFeature2NZSLSnapshotInfo
{
    // Update Assignment operator, whenever new arguments are added
    BOOL                                     needNZSLSnapshot;       ///< Need non-zsl snapshot session/pipeline
    BOOL                                     needPseudoZSLSnapshot;  ///< Need pseudo-zsl snapshot session/pipeline
    BOOL                                     dualIFENeeded;          ///< Flag to indicate if indicate dual IFE is needed
    BOOL                                     isLogicalCameraXCFA;    ///< Flag to indicate if logical camera has XCFA Support
    BOOL                                     isPrimaryCameraXCFA;    ///< Flag to indicate if primary camera has XCFA support
    ChiFeature2NZSLSnapshotType              nZSLType;               ///< Non-zsl snapshot type
    CHIREMOSAICTYPE                          remosaicType;           ///< Remosaic Type used for this configuration
    std::vector<ChiFeature2XCFASensorInfo>   XCFASensorInfoArray;    ///< Array of quadcfa sensor info
    std::vector<UINT32>                      XCFAStreamIndex;        ///< Index of QCFA Stream, Set to MAX_UINT if no QCFA
                                                                     ///< streams are passed
    std::vector<CHISTREAM*>                  XCFAStreamArray;        ///< Array of FW QCFA streams
    BOOL                                     hasLogicalXCFAStream;   ///< Has logical xcfa stream

    /// @brief Function assignment
    VOID operator = (const ChiFeature2NZSLSnapshotInfo &src)
    {
        needNZSLSnapshot            = src.needNZSLSnapshot;
        needPseudoZSLSnapshot       = src.needPseudoZSLSnapshot;
        dualIFENeeded               = src.dualIFENeeded;
        isLogicalCameraXCFA         = src.isLogicalCameraXCFA;
        isPrimaryCameraXCFA         = src.isPrimaryCameraXCFA;
        nZSLType                    = src.nZSLType;
        remosaicType                = src.remosaicType;
        XCFASensorInfoArray         = src.XCFASensorInfoArray;
        XCFAStreamIndex             = src.XCFAStreamIndex;
        XCFAStreamArray             = src.XCFAStreamArray;
        hasLogicalXCFAStream        = src.hasLogicalXCFAStream;
    }
};


/// @brief This structure will contain additional parameters which will help in selecting a required Sensor Mode
struct ChiFeature2XCFASnapshotInputParam
{
    BOOL        isSeamlessXCFA;         ///< Flag to indicate if Seamless XCFA is preferred
    // If application wants to select only SHDR to QCFA Transition, then this value will be set accordingly.
    // In normal cases, set this value with 0xFFFF so that any mode to XCFA transition wil be selected.
    UINT64      fromSensorModeType;     ///< CHISENSORMODECAPS value that needs to be used.
};

/// @brief Usecase Mask to Enable Internal modes. Values need to be updated if static setting value changes
enum class InternalModeEnableUsecase
{
    PseudoZSLSnapshot   = 0,          ///< Pseudo ZSL Snapshot Usecase
    Max                 = 0x1,        ///< Do not enable Internal Mode
};

#endif // CHXDEFS_H
