/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*-----------------------------------------------------------------------------
 *
 *
 *---------------------------------------------------------------------------*/

/** @file nptv_if.h
 *  NPTV video path control, include  input source select ,
 *  timing information, and video quality control
 */

#ifndef _NPTV_IF_H_
#define _NPTV_IF_H_

#include "drv_hdmi.h"
#include "util.h"
#include "drv_vga.h"
#include "drv_tvd.h"
#include "api_notify.h"
#include "vdo_if.h"
#include "nptv_vdec_if.h"
#include "ostg_if.h"

//-----------------------------------------------------------------------------
//function Declare
//-----------------------------------------------------------------------------


#if 0 // 5387


/**
 * Set display region information of the path video window.
 *
 * @param bPath SV_VP_MAIN / SV_VP_PIP
 * @param wResX The region start horizontal position of the path.
 * @param wY The region start vertical position of the path.
 * @param wTotWidth The total width in pixel of the path.
 * @param bHeight The total height in pixel of the path.
 * @return The exit status of this api.
 */
EXTERN UINT8 bApiVideoSetPathDispInfo(UINT8 bPath, UINT16 wRegSX, UINT16 wRegSY,
                               UINT16 wTotWidth, UINT16 wTotHeight);

/**
 * set scaler to pixel based or percentage based.
 *
 * @param u4OnOff = 0 refer to scaler API change to percentage based. (Default)
 * @param u4OnOff = 1 refer to scaler API change to pixel based.
 * @return void
 */
EXTERN void vApiSetScalerPixelBased(UINT32 u4OnOff);

/**
 * Set display position and size of video window.
 *
 * @param bPath SV_VP_MAIN / SV_VP_PIP
 * @param wX horizontal position
 * @param wY vertical position
 * @param wWidth width in pixel
 * @param wHeight height in pixel
 * @ruturn The exit status of this api.
 * @retval SV_SUCCESS
 * @retval SV_FAIL
 */
EXTERN UINT8 bApiVideoSetDispPosSize(UINT8 bPath, UINT16 wX, UINT16 wY,
                              UINT16 wWidth, UINT16 wHeight);


/**
 * @brief bApiVideoSetSrcOverScan

 * Set position and size of the source video window

 * @param  bPath: SV_VP_MAIN/SV_VP_PIP
 *         wXOff: the horizontal position of the source video window
 *         wYOff: the vertical position of the source video window
 *         wWidth: the width of the source video window
 *         wHeight: the height of the source video window
 * @retval SV_SUCCESS/SV_FAIL
 */
EXTERN UINT8 bApiVideoSetSrcOverScan(UINT8 bPath, UINT16 wTop, UINT16 wBottom,
                              UINT16 wLeft, UINT16 wRight);

/**
 * Set position and size of source video window.
 *
 * @param bPath SV_VP_MAIN / SV_VP_PIP
 * @wX horizontal position
 * @wY vertical position
 * @bWidth width in pixel
 * @bHeight height in pixel
 * @return The exit status of this api.
 * @retval SV_SUCCESS
 * @retval SV_FAIL
 */
EXTERN UINT8 bApiVideoSetSrcRegion(UINT8 bPath, UINT16 wX, UINT16 wY, UINT16 wWidth,
                             UINT16 wHeight);

/**
 * Enable/Disable the feature of blanking the area outside video windows.
 *
 * @bPath SV_VP_MAIN / SV_VP_PIP
 * @bOnOff SV_ON - After position or size is changed, the old picture will remain still.
 * SV_OFF - After position or size is changed, the old picture will be cleared.
 * @return NONE
 */
EXTERN void vApiVideoSetDispMask(UINT8 bPath, UINT8 bOnOff);

/**
 * Make video frozen.
 *
 * @param bPath SV_VP_MAIN / SV_VP_PIP
 * @param bOnOff SV_ON / SV_OFF
 * @return NONE
 */
EXTERN void vApiVideoFreeze(UINT8 bPath, UINT8 bOnOff);
#endif

//EXTERN void vApiVideoForceMute(UINT8 bPath, UINT8 bOnOff);


// removed. Call vDrvVideoSetBg() instead
//EXTERN void vApiVideoSetBg(UINT8 bPath, UINT32 u4Bg);

/**
 * @brief vApiVideoSetNonLinearUpScaler
 * Set the flag "_fgNonLinearUP" for Panoramic Mode(Non-linear upscaling mode)
 * @param  bOnOff: SV_ON/SV_OFF
 * @retval void
 */
//EXTERN void vApiVideoSetNonLinearUpScaler(UINT8 bOnOff);


// removed!
// call vApiLVDSSetDriving() instead.
//EXTERN void vDrvLVDSSetDriving(UINT8 bDriving);

// removed!
// call vApiLCDSetFrameRate() instead.
//EXTERN void vDrvLCDSetFrame(UINT16 wFrameRate);

// removed!
// call bApiLCDGetFrameRate() instead.
//EXTERN UINT8 vDrvGetLCDFreq(void);

// Removed. Call wApiVideoGetInputWidth() instead
//EXTERN UINT16 wDrvVideoInputWidth(UINT8 bPath);


// Removed. Call wApiVideoGetInputHeight() instead
//EXTERN UINT16 wDrvVideoInputHeight(UINT8 bPath);

// Removed. Call bApiVideoGetRefreshRate() instead.
//EXTERN UINT8 bDrvVideoGetRefreshRate(UINT8 bPath);

// Removed. Call bApiVideoIsSrcInterlace() instead
//EXTERN UINT8 bDrvVideoIsSrcInterlace(UINT8 bPath);

// Remove. Call bApiVgaSigStatus() intstead
//EXTERN UINT8 bVgaSigStatus(void);

 // Removed! Use fgApiVideoVgaAuto() instead.
//EXTERN void vDrvVgaAutoStart(void);

// Remove. Call vApiVgaAutoStop() instead.
//EXTERN void vDrvVgaAutoStop(void);


//EXTERN UINT16 wDrvVideoGetPorch(UINT8 bPath, UINT8 bPorchType);
//EXTERN UINT16 wDrvVideoSetPorch(UINT8 bPath, UINT8 bPorchType, UINT16 wValue);


/**
 * @brief vHDMIHPDAdjust(UINT32 value)
 * Time period of HPD low which is used to reset player.
 * @param value The low period of HPD in millisecond.
 * @retval VOID
 */
//EXTERN void vHDMIHPDAdjust(UINT32 value);

/**
 * @brief vHDMIHPDAdjust(UINT32 value)
 * Time period of HPD low which is used to reset player.
 * @param frame The type of infoFram.
 	HDMI_InfoFrame_AVI/ 	HDMI_InfoFrame_SPD/	HDMI_InfoFrame_AUDIO/ HDMI_InfoFrame_MPEG/
	HDMI_InfoFrame_UNREC/ HDMI_InfoFrame_GAMUT/ HDMI_InfoFrame_ACP

 * @retval Pointer of HDMI_INFOFRAME_DESCRIPTION which conatains FrameSize and data.
 */
//EXTERN HDMI_INFOFRAME_DESCRIPTION *API_HDMI_Get_InfoFrame(UINT8 frame);



#endif /* _NPTV_IF_H_ */
