////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017-2023 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  camxncsdefs.h
/// @brief CamX Non-Camera Sensor common definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CAMXNCSDEFS_H
#define CAMXNCSDEFS_H

#include "camxcdktypes.h"
#include "camxformats.h"

CAMX_NAMESPACE_BEGIN
#pragma pack(push, CDK_PACK_SIZE)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Common Handle Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief NCS object related handle
typedef VOID* NCSSensorDataHandle;      ///< NCSSensor data accessor handle
typedef VOID* NCSSensorHandle;          ///< NCSSensor object handle
typedef VOID* NCSProviderHandle;        ///< NCSProvider object handle
typedef VOID* NCSSessionHandle;         ///< NCS session handle
typedef VOID* NCSCapabilityHandle;      ///< NCS capability handle

/// @brief NCS request related handle
typedef VOID* NCSServiceRequestHandle;  ///< NCS service request handle
typedef VOID* NCSSensorRequestHandle;   ///< NCS sensor request handle
typedef VOID* NCSProviderRequestHandle; ///< NCS provider request handle

typedef VOID* NCSImageHandle;           ///< NCS image handle
typedef VOID* NCSChiImageHandle;        ///< NCS chi image handle

struct NCSAsyncRequest
{
    UINT64          tStart;        ///< Start timestamp
    UINT64          tEnd;          ///< End timestamp
    CHIFENCEHANDLE  hChiFence;     ///< Fence handle
    NCSSensorHandle hSensorHandle; ///< Client sensor handle
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Buffer Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NCS Buffer Info
struct NCSBufferInfo
{
    UINT32 sampleSize;    ///< Size of each sample
    UINT32 numSamples;    ///< Number of samples of dataSize
    UINT32 totalSize;     ///< Total size of buffer
    VOID*  pSetting;      ///< Pointer to the setting
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Interface Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NCS Sensor interface type enum
enum class NCSIntfType : UINT
{
    QSEE = 0,                   ///< QSEE interface.
    NIS,                        ///< Non Image Sensor
    OIS,                        ///< OIS Capable Sensor
    SS,                         ///< External Spectral Sensor Interface
    TOF,                        ///< Laser sensor
    QSEE2,                      ///< QSEE2 interface.
    OFD,                        ///< Offline dependencies interface
    CustomIntfType1,            ///< OEM interface type 1
    CustomIntfType2,            ///< OEM interface type 2
    CustomIntfType3,            ///< OEM interface type 3
    CustomIntfType4,            ///< OEM interface type 4
    MaxNCSIntfType,             ///< Max interface types
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Sensor Type Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NCS Sensor types
enum NCSSensorType
{
    NCSInvalidType = 0,         ///< Invalid sensor type.
    NCSGyroType,                ///< Gyroscope sensor type.
    NCSAccelerometerType,       ///< Accelerometer sensor type.
    NCSMagnetometerType,        ///< Magnetometer sensor type.
    NCSGravityType,             ///< Gravity sensor type.
    NCSLinearAccelerationType,  ///< Linear acceleration sensor type.
    NCSTimeOfFlightType,        ///< Time of flight sensor type.
    NCSLightType,               ///< Light sensor type.
    NCSGyroCalType,             ///< Gyro calibration type
    NCSMagCalType,              ///< Magnetometer calibration type
    NCSDepthType,               ///< Depth Sensor
    NCSOISType,                 ///< OIS Sensor
    NCSSSType,                  ///< Multi Spectral Sensor
    NCSAISegCatMapType,         ///< AISeg CatMap Sensor
    NCSFDROIType,               ///< FDROI Sensor
    NCSEVSType,                 ///< EVS (Event-based Vision Sensor) type.
    NCSMaxInternalType,         ///< Max internal sensor type.
    NCSCustomTypeStart = 0x20,  ///< OEM sensor type start from here
    NCSCustomTypeEND   = 0x40,  ///< OEM sensor type end
    NCSMaxType,                 ///< Max sensor type.
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Sensor Capability & Config Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NCS Sensor capability base structure
struct NCSSensorCap
{
    NCSSensorType type;       ///< Sensor type.
};

/// @brief NCS Buffer Type
enum NCSBufferType
{
    NCSBufferRawData,           ///< Raw sensor data for OIS, Gyro, etc.
    NCSBufferMetadata,          ///< Metadata for offline dependencies
    NCSBufferImageData          ///< Image data for offline dependencies
};

/// @brief NCS Sensor capability base structure
struct NCSProviderCap: public NCSSensorCap
{
    UINT32        version;          ///< Version
    NCSBufferType bufferType;       ///< Buffer type.
};

/// @brief NCS Sensor config base structure
struct NCSSensorConfig
{
    NCSSensorType sensorType;       ///< Sensor type.
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS Request Structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief NCSServiceRequestType
enum NCSServiceRequestType : UINT
{
    QueryCapabilities,                              ///< Request to NCSService::QueryCapabilites
    RegisterService,                                ///< Request to NCSService::RegisterService
    UnregisterService,                              ///< Request to NCSService::UnregisterService
    RegisterProvider,                               ///< Request to NCSService::RegisterProvider
    UnregisterProvider                              ///< Request to NCSService::UnregisterProvider
};

/// @brief NCSQueryCapabilitiesRequest
struct NCSQueryCapabilitiesRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSIntfType             interfaceType;          ///< NCS interface type
    NCSSensorType           sensorType;             ///< NCSSensorType
    NCSSensorCap*           pSensorCap;             ///< Pointer to the Sensor cap
};

/// @brief NCSRegisterServiceRequest
struct NCSRegisterServiceRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSIntfType             interfaceType;          ///< NCS interface type
    NCSSensorConfig*        pSensorConfig;          ///< Sensor config
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor that is registered
};

/// @brief NCSUnregisterServiceRequest
struct NCSUnregisterServiceRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor that need to be unregistered
};

/// @brief NCSSensorRequestType
enum NCSSensorRequestType : UINT
{
    GetDataAsync,                                   ///< Request to NCSSensor::GetDataAsync
    GetDataSync,                                    ///< Request to NCSSensor::GetDataSync
    GetLastNSamples,                                ///< Request to NCSSensor::GetLastNSamples
    IterateSamples,                                 ///< Request to iterate NCSSensorData
    PutBackSamples                                  ///< Request to NCSSensor::PutBackSamples
};

/// @brief NCSSensorGetDataAsyncRequest
struct NCSSensorGetDataAsyncRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor to be requested
    UINT64                  tFrom;                  ///< The from time of the requested time window.
    UINT64                  tEnd;                   ///< The end time of the requested time window.
    CHIFENCEHANDLE          hChiFence;              ///< Handle of the chi fence
};

/// @brief NCSSensorGetDataSyncRequest
struct NCSSensorGetDataSyncRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor to be requested
    UINT64                  tFrom;                  ///< The from time of the requested time window.
    UINT64                  tEnd;                   ///< The end time of the requested time window.
    NCSSensorDataHandle     hSensorData;            ///< Handle of NCSSensorData
    UINT32                  sampleCount;            ///< Total sample count of the request
};

/// @brief NCSSensorGetLastNSamplesRequest
struct NCSSensorGetLastNSamplesRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor to be requested
    UINT32                  numOfSamples;           ///< Number of samples
    NCSSensorDataHandle     hSensorData;            ///< Handle of NCSSensorData
    UINT32                  sampleCount;            ///< Total sample count of the request
};

/// @brief NCSSensorIterateSamplesRequest
struct NCSSensorIterateSamplesRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorDataHandle     hSensorData;            ///< Handle of NCSSensorData
    UINT32                  indexOfSample;          ///< Index of the requesting sample
    VOID*                   pSample;                ///< Pointer to the sample
};

/// @brief NCSSensorPutBackSamplesRequest
struct NCSSensorPutBackSamplesRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSSensorHandle         hSensor;                ///< Pointer to NCSSensor
    NCSSensorDataHandle     hSensorData;            ///< Handle of NCSSensorData to be recycled
};

/// @brief NCSRegisterProviderRequest
struct NCSRegisterProviderRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSIntfType             interfaceType;          ///< NCS interface Type
    NCSProviderCap*         pProviderCap;           ///< Pointer to NCSProviderCap
    NCSProviderHandle       hProvider;              ///< Pointer to the provider
};

/// @brief NCSUnregisterProviderRequest
struct NCSUnregisterProviderRequest
{
    UINT32                  size;                   ///< sizeof NCSServiceRequestInput
    NCSProviderHandle       hProvider;              ///< Pointer to NCSProvider
};

/// @brief NCSProviderRequestType
enum NCSProviderRequestType : UINT
{
    GetBuffers,                                     ///< Request to NCSProvider::GetBuffers
    PostData,                                       ///< Request to NCSProvider::PostData
    Flush                                           ///< Request to NCSProvider::Flush
};

/// @brief NCSProviderGetBuffersRequest
struct NCSProviderGetBuffersRequest
{
    UINT32                  size;                   ///< sizeof NCSProviderGetBuffersRequest
    NCSProviderHandle       hProvider;              ///< Pointer to NCSProvider
    NCSBufferInfo*          pBuffInfo;              ///< Buffer info including number of buffers available.
    UINT8**                 ppBuffArray;            ///< Array of buffer pointers to fill.
};

/// @brief NCSProviderPostDataRequest
struct NCSProviderPostDataRequest
{
    UINT32                  size;                   ///< sizeof NCSProviderPostDataRequest
    NCSProviderHandle       hProvider;              ///< Pointer to NCSProvider
    NCSBufferInfo*          pBuffInfo;              ///< Buffer info including number of buffers available.
    UINT8**                 ppBuffArray;            ///< Array of buffer pointers to fill.
};

// /// @brief NCSProviderFlushRequest
struct NCSProviderFlushRequest
{
    UINT32                  size;                   ///< sizeof NCSProviderPostDataRequest
    NCSProviderHandle       hProvider;              ///< Pointer to NCSProvider
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS QSEE & QSEE2 Constant Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const UINT NCSMaxBufferedTime           = 2;    ///< 2 seconds of data would be buffered at most
const UINT NCSMaxRates                  = 10;   ///< NCS max supported rates

/// @brief QSEE2 Sensor capabilities valid mask
typedef UINT64 QSEE2SensorCapValidMask;

/// @brief QSEE provider version
const UINT32  NCS_QSEE2_PROVIDER_DATA_VERSION       = 1;    ///< data structure version of QSEE2

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS QSEE & QSEE2 Sensor Config & Capability Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NCS Range structure
struct NCSRange
{
    FLOAT start;  ///< Start of the range.
    FLOAT end;    ///< End of the range.
};

/// @brief QSEE Sensor config structure
struct QSEESensorConfig: public NCSSensorConfig
{
    BOOL          operationMode;   ///< Batched mode(0) / streaming mode(1).
    FLOAT         samplingRate;    ///< Sampling rate in hertz.
    UINT          reportRate;      ///< Reporting rate in micorseconds.
    BOOL          needExact;       ///< Need the exact sample rate as configured
    VOID*         pOEMConfigData;  ///< OEM config data
};

/// @brief QSEE Sensor capabilites structure
struct QSEESensorCap : public NCSSensorCap
{
    BOOL           isValid;                   ///< Data valid flag.
    FLOAT          resolutions[NCSMaxRates];  ///< List of sensor resolutions.
    UINT           numResolutions;            ///< Number of resolutions.
    FLOAT          rates[NCSMaxRates];        ///< List of sensor rates.
    UINT           numRates;                  ///< Number of rates.
    NCSRange       ranges[NCSMaxRates];       ///< List of operational ranges.
    UINT           numRanges;                 ///< Number of ranges.
};

/// @brief QSEE2 Sensor capabilites structure
struct QSEE2SensorCap : public NCSProviderCap
{
    BOOL                    isProbed;                       ///< Probed flag.
    BOOL                    isValid;                        ///< Data valid flag.
    QSEE2SensorCapValidMask isValidMask;                    ///< Data valid mask.
    FLOAT                   resolutions[NCSMaxRates];       ///< List of sensor resolutions.
    UINT                    numResolutions;                 ///< Number of resolutions.
    FLOAT                   rates[NCSMaxRates];             ///< List of sensor rates.
    UINT                    numRates;                       ///< Number of rates.
    FLOAT                   lowLatencyRates[NCSMaxRates];   ///< List of sensor rates.
    UINT                    numLowLatencyRates;             ///< Number of rates.
    NCSRange                ranges[NCSMaxRates];            ///< List of operational ranges.
    UINT                    numRanges;                      ///< Number of ranges.
    QSEESensorConfig        curConfig;                      ///< Current config of sensor
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS QSEE & QSEE2 Sensor Data Structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief Defines the NCS gyro data.
struct NCSDataGyro
{
    FLOAT  x;           ///< Angular velocity along the x axis.
    FLOAT  y;           ///< Angular velocity along the y axis.
    FLOAT  z;           ///< Angular velocity along the z axis.
    UINT64 timestamp;   ///< Qtimer timestamp of when the sample was captured.
};

/// @brief Defines the NCS accelerometer information.
struct NCSDataAccel
{
    FLOAT  x;           ///< Acceleration along the x-axis.
    FLOAT  y;           ///< Acceleration along the y-axis.
    FLOAT  z;           ///< Acceleration along the z-axis.
    UINT64 timestamp;   ///< Qtimer timestamp of when the sample was captured.
};

/// @brief Defines the NCS magnetometer data.
struct NCSDataMagnetometer
{
    FLOAT  x_uncalib;       ///< Magnetic field along the x-axis.
    FLOAT  y_uncalib;       ///< Magnetic field along the y-axis.
    FLOAT  z_uncalib;       ///< Magnetic field along the z-axis.
    FLOAT  x_bias;          ///< Magnetic field along the x-axis.
    FLOAT  y_bias;          ///< Magnetic field along the y-axis.
    FLOAT  z_bias;          ///< Magnetic field along the z-axis.
    UINT64 timestamp;       ///< Timestamp of this sample.
};

/// @brief Defines the NCS gravity data.
struct NCSDataGravity
{
    FLOAT  x;         ///< Gravity value along the x-axis.
    FLOAT  y;         ///< Gravity value along the y-axis.
    FLOAT  z;         ///< Gravity value along the z-axis.
    FLOAT  lx;        ///< Linear acceleration along the x-axis.
    FLOAT  ly;        ///< Linear acceleration along the y-axis.
    FLOAT  lz;        ///< Linear acceleration along the z-axis.
    UINT64 timestamp; ///< Timestamp of this sample.
};

/// @brief NCS Ambient light data structure
struct NCSDataLight
{
    FLOAT lux;  ///< Lux value.
};

/// @brief NCS laser data structure
struct NCSDataLaser
{
    FLOAT  version;     ///< Sensor version.
    FLOAT  type;        ///< Sensor specific type.
    FLOAT  distance;    ///< Estimated distance.
    FLOAT  confidence;  ///< Data confidence.
    FLOAT  nearLimit;   ///< Near limit of the sensor.
    FLOAT  farLimit;    ///< Far limit of the sensor.
    INT32  maxRange;    ///< Max range of the sensor.
    UINT64 timestamp;   ///< Timestamp of this sample
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS NIS Sensor Capability & Config Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NIS sensor mode
struct NISSensorMode
{
    UINT        width;              ///< Width
    UINT        height;             ///< Height
    UINT        frameRate;          ///< Frame rate
    UINT        outputWidth;        ///< Output width
    UINT        outputHeight;       ///< Output height
    UINT        outputBitsPerPixel; ///< Output format bits per pixel
    Format      outputFormat;       ///< Output format
    ColorSpace  outputColorSpace;   ///< Output color space
};

/// @brief NIS Camera orientation
enum NISCameraOrientation
{
    REAR      = 0,     ///< rear sensor
    FRONT     = 1,     ///< front sensor
    REAR_AUX  = 2,     ///< rear aux sensor
    FRONT_AUX = 3,     ///< front aux sensor
    EXTERNAL  = 4,     ///< external sensor
};

/// @brief Available clients for the non-image sensor (NIS) sensor.
enum NISClientType
{
    ClientAF,           ///< AF client
    ClientAEC,          ///< AEC client
    ClientAWB,          ///< AWB client
    ClientFramework,    ///< Framework client (an Android framework external-triggered depth use case). Should not selected
                        ///  by customers
    ClientChinode,      ///< Chi node client
    ClientMax,          ///< Max client
};

struct NISSensorInfo
{
    NCSSensorType sensorType;   ///< Sensor type
    NISClientType clientType;   ///< Client type
    INT           sensorId;     ///< CameraId of this sensor
};

/// @brief NCS config priority
enum NCSConfigPriority
{
    NCSConfigBestEffort = 0,        ///< Config best effort, can be reconfigured by any client
    NCSConfigCritical,              ///< Config critical, can only be reconfigured by MustMatch
    NCSConfigMustMatch,             ///< Config must match, can not be reconfigured by any client
    NCSConfigPriorityMax,           ///< Config max
};

/// @brief NCS Sensor config structure
struct NISSensorConfig: public NCSSensorConfig
{
    INT                 sensorId;           ///< Camera ID of this sensor
    INT                 camIdOfClient;      ///< Logical camera ID of client
    NISClientType       clientType;         ///< Client type
    UINT                sensorModeIndex;    ///< Sensor mode index
    NCSConfigPriority   priority;           ///< Config priority
    BOOL                isDefer;            ///< Is defer
    BOOL                isSecureMode;       ///< Is secure mode
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS NIS Sensor Data Structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief NIS Sensor Data
struct NISSensorData
{
    INT     sensorId;       ///< Camera id of this sensor
    UINT64  timestamp;      ///< Sensor timestamp asscociated with this frame
    UINT    dataSize;       ///< Data size
    VOID*   pData;          ///< Image data for camx client
    VOID*   pChiBuffer;     ///< Image data for chi node client
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OIS Constant Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const UINT32 NCS_OIS_PROVIDER_DATA_VERSION          = 1;    ///< data structure version of OIS

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OIS Sensor Capability & Config Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief OIS Sensor capabilites structure
struct OISSensorCap : public NCSProviderCap
{
    INT            cameraId;                  ///< OIS sensor id
    BOOL           isValid;                   ///< Data valid flag
    FLOAT          rates[NCSMaxRates];        ///< List of sensor rates
    UINT           numRates;                  ///< Number of rates
};

/// @brief OIS Sensor config structure
struct OISSensorConfig: public NCSSensorConfig
{
    INT   sensorId;     ///< Camera Id requested
    FLOAT samplingRate; ///< Sampling rate of this sensor
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OIS Sensor Data Structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief Defines the NCS OIS data.
struct NCSDataOIS
{
    FLOAT  x;          ///< Acceleration along the x-axis.
    FLOAT  y;          ///< Acceleration along the y-axis.
    FLOAT  z;          ///< Acceleration along the z-axis.
    FLOAT  w;          ///< Acceleration along the w-axis.
    UINT64 timestamp;  ///< Timestamp of this sample.
                       ///  @newpagetable
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OFD Constant Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const UINT32 NCS_OFD_AI_SEG_CAT_MAP_PROVIDER_DATA_VERSION       = 1;    ///< data structure version of AISeg CatMap
const UINT32 NCS_OFD_FD_ROI_PROVIDER_DATA_VERSION               = 1;    ///< data structure version of FDROI

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OFD Sensor Capability & Config Definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// Forward Declarations
struct ImageFormat;

/// @brief OFD image source type
enum OFDImageSourceType
{
    OFDImageSourceInvalid,          ///< OFD image source is invalid
    OFDImageSourceSinkBuffer,       ///< OFD image source is a sink buffer
    OFDImageSourceInternalBuffer,   ///< OFD image source is an internal buffer
};

/// @brief OFD Sensor capabilites structure
struct OFDSensorCap : public NCSProviderCap
{
    UINT                    sampleCount;                ///< Sample count
    INT                     logicalCameraId;            ///< Logical camera sensor id
    INT                     physicalCameraId;           ///< Physical camera sensor id
    BOOL                    isLogicalCamProvider;       ///< Is provider for the whole logical camera
    const ImageFormat*      pImageFormat;               ///< Pointer of image format, mandatory for image data type
    OFDImageSourceType      imageSourceType;            ///< Image source type, mandatory for image data type
};

/// @brief NCS Sensor config structure
struct OFDSensorConfig: public NCSSensorConfig
{
    INT            logicalCameraId;             ///< Logical camera sensor id
    INT            physicalCameraId;            ///< Physical camera sensor id
    BOOL           isLogicalCamProvider;        ///< Is provider for the whole logical camera
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OFD Sensor Data Structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// @brief OFD image buffer type
enum OFDImageBufferType
{
    OFDImageHALBuffer,      ///< OFD image buffer is a HAL buffer
    OFDImageCHIBuffer,      ///< OFD image buffer is a CHI buffer
    OFDImageCamXBuffer,     ///< OFD image buffer is a CamX buffer
};

/// @brief NCS OFD data structure
struct NCSDataOFD
{
    UINT64 timestamp;   ///< Timestamp of the sample
};

/// @brief NCS Image data structure
struct NCSDataImage: public NCSDataOFD
{
    UINT64              frameNumber;       ///< Frame number of the image data
    NCSImageHandle      hImageBuffer;      ///< Handle of image buffer
    NCSChiImageHandle   hChiImageBuffer;   ///< Handle of CHI image
    OFDImageBufferType  imageBufferType;   ///< Image buffer type
};

/// @brief NCS AISeg Category Map Image data structure
struct NCSDataAISegCatMap: public NCSDataImage
{
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// NCS OFD Buffer Setting
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief NCS OFD Buffer Setting structure
struct NCSOFDBufferSetting
{
    OFDImageBufferType  imageBufferType;    ///< Image buffer type, this param is only available for sink buffer
};

#pragma pack(pop)

CAMX_NAMESPACE_END

#endif // CAMXNCSDEFS_H
