/**
 * @file hv_drv_OsdFrame.h
 * @brief Osd driver layer frame management interface.
 * @verbatim
 * ==============================================================================
 *                        ##### How to use this driver #####
 * ==============================================================================
 * (+) Use Hv_Drv_OsdDataPath_Init(...) to init datapath management data.
 * @endverbatim
 *
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 2022-08-22
 */


#ifndef __HV_DRV_OSDFRAME_H
#define __HV_DRV_OSDFRAME_H

//#define OSD_DDR_KEEP_ALPHA
#if (HV_PROJECT_CONFIG_OSD_DDRPATH == HV_CONFIG_ON)

#define OSD_DOUBLE_BUFFER_COPY_MS 500

#endif /* HV_PROJECT_CONFIG_OSD_DDRPATH */

#if (HV_PROJECT_CONFIG_OSD_ROTATION == HV_CONFIG_ON)

//extern OsdRotationType g_enRotationType;

#endif /* HV_PROJECT_CONFIG_OSD_ROTATION */

UCHAR8 Hv_Drv_OsdFrame_GetOsdFrameRate(USHORT16 usVideoFrameRate, BOOL bIsVRR);

BOOL Hv_Drv_OsdFrame_CheckHTotalChange(USHORT16 usCurPanelHtotal);

VOID Hv_Drv_OsdFrame_ReCalculateTiming(USHORT16 usVideoFrameRate, BOOL bIsVRR);
/**
 * @brief get current language
 * @param[in] None
 * @return language enum
 */
OsdLanguage Hv_Drv_OsdFrame_GetCurrentLanguage(VOID);

/**
 * @brief change language
 * @param[in] enLanguage language enum to set
 * @return HV_TRUE if language switched, HV_FALSE if set to same language
 */
BOOL Hv_Drv_OsdFrame_SetCurrentLanguage(OsdLanguage enLanguage);

/**
 * @brief set reg_en
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdFrame_SetSync(VOID);

/**
 * @brief check reg_en
 * @param[in] None
 * @return HV_TRUE/HV_FALSE
 */
BOOL Hv_Drv_OsdFrame_CheckSync(VOID);

/**
 * @brief switch osd scaler
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdFrame_SetScalerRatio(VOID);

/**
 * @brief reconfig osd timing when tx timing change
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdFrame_ReconfigDataPath(VOID);

/**
 * @brief prepare for redrawing
 * @param[in] None
 * @return VOID without return
 */
VOID Hv_Drv_OsdFrame_DrawPre(VOID);

/**
 * @brief transfer DDR dirty data to OSD SRAM
 * @param[in] None
 * @return HV_SUCCESS
 */
Status Hv_Drv_OsdFrame_DrawPost(VOID);

BOOL Hv_Drv_OsdFrame_GetOsdClockEnable(VOID);
VOID Hv_Drv_OsdFrame_SetOsdClockEnable(BOOL bEnable);
BOOL Hv_Drv_OsdFrame_NeedCloseOsdClock(VOID);

#endif /* __HV_DRV_OSDFRAME_H */
