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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  camxhwintfdecl.h
/// @brief HwInterface class declaration, for storing device static information
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CAMXHWINTFDECL_H
#define CAMXHWINTFDECL_H

#include <vector>

#include <unordered_map>

#include "camxcsl.h"

CAMX_NAMESPACE_BEGIN

struct HwContextCreateData;
struct HwEnvironmentStaticCaps;
struct PlatformStaticCaps;
struct SensorModuleStaticCaps;
struct StaticMetadataKeysInfo;

class  HWEnvironmentInterface;
class  IHwInterfaceCallback;

enum CameraMetadataTag : INT32;
enum ImageSensorFacing : INT32;
enum ImageOrientation : INT32;
enum class PDAFType;


/// @brief Definition of seamless transition table
typedef std::unordered_map<UINT32, std::vector<UINT32>> SeamlessTransitionTable;
typedef std::vector<UINT32>                             SeamlessTransitionModeList;

static const INT32 CustomHFR60Fps = 60;
static const INT32 CustomHFR30Fps = 30;

/// @brief table entry for supported devices.
struct HwDeviceTypeInfo
{
    CSLVersion  hwVersion;                          ///< HW version as reported by CSL.
    CSLVersion  driverVersion;                      ///< KMD driver version as reported by CSL.
    INT32       deviceIndex[CamxMaxDeviceIndex];    ///< Array of device Indices as reported by CSL.
    UINT        deviceIndexCount;                   ///< Number of valid entries in deviceIndex.
};

/// @brief Encapsulates static camera information to be used by HAL.
struct HwCameraInfo
{
    ImageSensorFacing               imageSensorFacing;                      ///< The direction that the camera faces.
    ImageOrientation                imageOrientation;                       ///< The orientation of the camera image.
    UINT32                          mountAngle;                             ///< Camera Mount Angle
    INT                             resourceCost;                           ///< The total resource "cost" of using this camera.
    const PlatformStaticCaps*       pPlatformCaps;                          ///< Static capabilities of the chipset.
    const SensorModuleStaticCaps*   pSensorCaps;                            ///< Static capabilities of the image sensor module.
    const HwEnvironmentStaticCaps*  pHwEnvironmentCaps;                     ///< Static capabilities of overall hardware
                                                                            ///  environment. i.e. conbination of capabilities
                                                                            ///  of sensor, chipset, and other hardwares
};

/// @brief HwEnvironment create data
struct HwEnvironmentCreateInputData
{
    IHwInterfaceCallback*   pHwInterfaceCallback;   ///< Base class pointer of HwInterfaceCallback instance
};

struct HwEnvironmentCreateOutputData
{
    HWEnvironmentInterface* pHwEnvironment;     ///< Base class pointer of HwEnvironment instance
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// PCreateHwEnvironment
///
/// @brief  function to create HwEnvironment instance
///
/// @param  pCreateInputData    HwEnvironment create input data
/// @param  pCreateOutputData   HwEnvironment create output data
///
/// @return CamxResult
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef CamxResult (*PCreateHwEnvironment)(
            HwEnvironmentCreateInputData*   pCreateInputData,
            HwEnvironmentCreateOutputData*  pCreateOutputData);

CAMX_NAMESPACE_END

#endif // CAMXHWINTFDECL_H
