/* 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 u_sm_bypass_hdlr.h 
 *  $RCSfile: $
 *  $Revision: #1 $
 *  $Date: 2015/05/29 $
 *  $Author: brianpc.huang $
 *  
 *  @par Description:
 *         This header file contains Bypass Stream handler specific 
 *         definitions, which are exported to all.
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*! @defgroup groupMW_STRM_MNGR_BYPASS_HDLR Bypass Handler
 *
 *  @ingroup groupMW_STRM_MNGR
 *  @brief Provides video bypass stream external function for TV Application
 *
 *  %MW Application API would be used by TV Application, lot of these APIs would
 *   be wrapped from Exported API
 *
 *  @see groupMW_STRM_MNGR
 *  @{ 
 */
/*----------------------------------------------------------------------------*/

#ifndef _U_SM_BYPASS_HDLR_H_
#define _U_SM_BYPASS_HDLR_H_


/*-----------------------------------------------------------------------------
                    include files
-----------------------------------------------------------------------------*/

#include "u_common.h"
#include "u_handle.h"
#include "u_sm.h"
#include "u_sm_video_hdlr.h"

/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
-----------------------------------------------------------------------------*/

/* command sets *************************************************************/
/* primary commands */
#define SM_BYPASS_CMD_CODE_SET_DEST_GRP_NAME                    \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 0))    /**<        */
#define SM_BYPASS_CMD_CODE_SET_VBIF_SRC                         \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 1))    /**<        */
#define SM_BYPASS_CMD_CODE_SET_FORCE_PID                        \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 2))    /**<        */
#define SM_BYPASS_CMD_CODE_SET_FORCE_CODEC                      \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 3))    /**<        */
#define SM_BYPASS_CMD_CODE_SET_FORCE_BLANK                      \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 4))    /**<        */

#define SM_BYPASS_CMD_CODE_SET_FORCE_NO_CA_REQ                        \
        ((SM_CMD_CODE_T)(SM_CMD_CODE_PRIMARY_BIT_FLAG | 5))    /**<        */

#define SM_GRP_BSH    (( SM_GRP_LAST_ENTRY + 14 ) << SM_CODE_BITS)    /**<        */

/* set types *****************************************************************/
#define SM_BSH_SET_TYPE_IGNORE               ((SM_SET_TYPE_T)(SM_GRP_BSH | 0))    /**<        */
#define SM_BSH_SET_TYPE_VBIF_SRC             ((SM_SET_TYPE_T)(SM_GRP_BSH | 1))    /**<        */
#define SM_BSH_SET_TYPE_VBIF_CTRL            ((SM_SET_TYPE_T)(SM_GRP_BSH | 2))    /**<        */
#define SM_BSH_SET_TYPE_VIDEO_OUT_CTRL       ((SM_SET_TYPE_T)(SM_GRP_BSH | 3))    /**<        */
#define SM_BSH_SET_TYPE_TV_ENC_CTRL          ((SM_SET_TYPE_T)(SM_GRP_BSH | 4))    /**<        */

/* get types *****************************************************************/
#define SM_BSH_GET_TYPE_IGNORE               ((SM_GET_TYPE_T)(SM_GRP_BSH | 0))    /**<        */
#define SM_BSH_GET_TYPE_VIDEO_SRC_RESOLUTION ((SM_GET_TYPE_T)(SM_GRP_BSH | 1))    /**<        */
#define SM_BSH_GET_TYPE_VIDEO_OUT_CTRL       ((SM_GET_TYPE_T)(SM_GRP_BSH | 2))    /**<        */
#define SM_BSH_GET_TYPE_TV_ENC_CTRL          ((SM_GET_TYPE_T)(SM_GRP_BSH | 3))    /**<        */


/* SM_BSH_SET_TYPE_VBIF_SRC settings ****************************************/
/*------------------------------------------------------------------*/
/*! @enum BSH_VBIF_SRC_TYPE_T
 *  @brief  Specify VBIF source type 
 *  @code
 *  typedef enum _BSH_VBIF_SRC_TYPE_T
 *  {
 *      BSH_VBIF_SRC_TYPE_UNKNOWN = 0,
 *      BSH_VBIF_SRC_TYPE_DIG_VBI_ES,
 *      BSH_VBIF_SRC_TYPE_DIG_TTX_ES
 *  }   BSH_VBIF_SRC_TYPE_T;   
 *  @endcode
 *  @li@c  BSH_VBIF_SRC_TYPE_UNKNOWN                         -VBIF source type unknown
 *  @li@c  BSH_VBIF_SRC_TYPE_DIG_VBI_ES                      -VBIF source type digital VBI ES
 *  @li@c  BSH_VBIF_SRC_TYPE_DIG_TTX_ES                      -VBIF source type digital TTX ES
 */
/*------------------------------------------------------------------*/
typedef enum _BSH_VBIF_SRC_TYPE_T
{
    BSH_VBIF_SRC_TYPE_UNKNOWN = 0,
    BSH_VBIF_SRC_TYPE_DIG_VBI_ES,
    BSH_VBIF_SRC_TYPE_DIG_TTX_ES
}   BSH_VBIF_SRC_TYPE_T;   

/*------------------------------------------------------------------*/
/*! @struct BSH_VBIF_SRC_INFO_T
 *  @brief  Contain VBIF source info
 *  @code
 *  typedef struct _BSH_VBIF_SRC_INFO_T
 *  {
 *      BSH_VBIF_SRC_TYPE_T    e_src_type;
 *      UINT16                 ui2_pid;
 *  }   BSH_VBIF_SRC_INFO_T;
 *  @endcode
 *  @li@c  e_src_type                                     -VBIF source type 
 *  @li@c  ui2_pid                                           -VBIF source PID value
 */
/*------------------------------------------------------------------*/
typedef struct _BSH_VBIF_SRC_INFO_T
{
    BSH_VBIF_SRC_TYPE_T    e_src_type;
    UINT16                 ui2_pid;
}   BSH_VBIF_SRC_INFO_T;

/* SM_BSH_SET_TYPE_VBIF_CTRL settings ****************************************/
/*------------------------------------------------------------------*/
/*! @enum BSH_VBIF_CTRL_T
 *  @brief  Specify VBIF control type
 *  @code
 *  typedef enum
 *  {
 *      BSH_VBIF_CTRL_RESET = 0,
 *      BSH_VBIF_CTRL_STOP,
 *      BSH_VBIF_CTRL_START
 *  }   BSH_VBIF_CTRL_T;
 *  @endcode
 *  @li@c  BSH_VBIF_CTRL_RESET                              -VBIF control type reset
 *  @li@c  BSH_VBIF_CTRL_STOP                                -VBIF control type stop
 *  @li@c  BSH_VBIF_CTRL_START                              -VBIF control type start
 */
/*------------------------------------------------------------------*/
typedef enum
{
    BSH_VBIF_CTRL_RESET = 0,
    BSH_VBIF_CTRL_STOP,
    BSH_VBIF_CTRL_START
}   BSH_VBIF_CTRL_T;

/* SM_BSH_SET_TYPE_VIDEO_OUT_CTRL settings ***********************************/
/*------------------------------------------------------------------*/
/*! @enum BSH_VIDEO_OUT_CTRL_T
 *  @brief  Specify video out control type
 *  @code
 *  typedef enum
 *  {
 *      BSH_VIDEO_OUT_CTRL_DISABLE = 0x0,
 *      BSH_VIDEO_OUT_CTRL_ENABLE  = 0x1
 *  }   BSH_VIDEO_OUT_CTRL_T;
 *  @endcode
 *  @li@c  BSH_VIDEO_OUT_CTRL_DISABLE                        -video out control type disable
 *  @li@c  BSH_VIDEO_OUT_CTRL_ENABLE                         -video out control type enable
 */
/*------------------------------------------------------------------*/
typedef enum
{
    BSH_VIDEO_OUT_CTRL_DISABLE = 0x0,
    BSH_VIDEO_OUT_CTRL_ENABLE  = 0x1
}   BSH_VIDEO_OUT_CTRL_T;

/* SM_BSH_SET_TYPE_TV_ENC_CTRL settings **************************************/
/*------------------------------------------------------------------*/
/*! @enum BSH_TV_ENC_CTRL_T
 *  @brief  Specify TV encoder control type
 *  @code
 *  typedef enum
 *  {
 *      BSH_TV_ENC_CTRL_DISABLE = 0x0,
 *      BSH_TV_ENC_CTRL_ENABLE  = 0x1
 *  }   BSH_TV_ENC_CTRL_T;
 *  @endcode
 *  @li@c  BSH_TV_ENC_CTRL_DISABLE                           -TV encoder control type disable
 *  @li@c  BSH_TV_ENC_CTRL_ENABLE                            -TV encoder control type enable
 */
/*------------------------------------------------------------------*/
typedef enum
{
    BSH_TV_ENC_CTRL_DISABLE = 0x0,
    BSH_TV_ENC_CTRL_ENABLE  = 0x1
}   BSH_TV_ENC_CTRL_T;

/*-----------------------------------------------------------------------------
                   functions declarations
-----------------------------------------------------------------------------*/

#endif /* _U_SM_BYPASS_HDLR_H_ */

/*----------------------------------------------------------------------------*/
/*! @} */   /* end of groupMW_STRM_MNGR_BYPASS_HDLR */
/*----------------------------------------------------------------------------*/

