/* 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.
 *
 *****************************************************************************/

/*------------------------------------------------------------------------------
 * Copyright (c) 2010, Mediatek Inc.
 * All rights reserved.
 *
 * Unauthorized use, practice, perform, copy, distribution, reproduction,
 * or disclosure of this information in whole or in part is prohibited.
 *----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*! @file x_ginga.h
 *  $File: //DTV/PROD_BR/DTV_X_IDTV1501/apollo/middleware/public/ginga/x_ginga.h $
 *  $Revision: #1 $
 *  $Date: 2015/05/29 $
 *  $Author: brianpc.huang $
 *  
 *  @par Description:
 *    
 */
/*----------------------------------------------------------------------------*/
#ifndef  _X_GINGA_H_
#define  _X_GINGA_H_
/*----------------------------------------------------------------------------*/
/*! @addtogroup groupMW_GINGA
 *  @{
 */
/*----------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------------
                    include files
-----------------------------------------------------------------------------*/
#include "u_ginga.h"
#include "x_common.h"

/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
                    data declarations
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
                    functions declarations
-----------------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/*! @brief  This API does Ginga initialization
 *  @param  [in]  pt_thread_desc    - Pointer of thread description to create thread internally.
 *  @return Return the error code
 *  @retval OSR_OK                  - Initialize successfully.
 *  @retval INITR_FAIL              - Initialize failed.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_init(THREAD_DESCR_T* pt_thread_desc);


/*------------------------------------------------------------------*/
/*! @brief  notify Ginga that 3rd partition is ready
 *  @return Return the error code
 *  @retval zero                    - successfully.
 *  @retval non zero             - failed.
 */
/*------------------------------------------------------------------*/
extern INT32 x_ginga_3rd_ready(VOID);

    

/*------------------------------------------------------------------*/
/*! @brief  This API registes the Ginga engine instance
 *  @param  [in]  pt_fct_tbl        - Pointer to Ginga engine function table.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Registes the Ginga engine successfully.
 *  @retval GINGAR_INV_ARG          - NULL pointer of pt_fct_tbl.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reg_engine(GINGA_ENGINE_FCT_TBL_T* pt_fct_tbl);

/*------------------------------------------------------------------*/
/*! @brief  This API load the Ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Load the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_load(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API initialize the Ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Initialize the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_initialize(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API active the Ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Active the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_active(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API deactive the ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Dective the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_deactive(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API uninit the Ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Uninit the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_uninitialize(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API unload the Ginga middleware
 *  @return Return the error code
 *  @retval GINGAR_OK               - Unload the Ginga middleware successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_unload(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API get the status of Ginga middleware
 *  @return Return the status of Ginga middleware
 *  @retval GINGA_STATE_NOT_INIT    - The Ginga middleware was not initialized yet.
 *  @retval GINGA_STATE_HIDDEN      - The Ginga middleware is in stand-by mode.
 *  @retval GINGA_STATE_VISIBLE     - The Ginga middleware is running and has the "focus"
 */
/*------------------------------------------------------------------*/
extern GINGA_MW_STATE_T x_ginga_get_state(VOID);


/*------------------------------------------------------------------*/
/*! @brief  This API allows to registe a callback of Ginga APP list changes.  
 *  @param  [in]  pf_nfy            - Notification function provided by the caller,
 *                                    to notify that the Ginga APP list has been changed .
 *  @param  [in]  pv_tag            - Private tag provided by the caller.  
 *                                    This tag is passed to the caller's notification function..
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reg_app_list_cb(
        x_ginga_app_list_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API allows to registe a callback of a Ginga APP state changes.  
 *  @param  [in]  pf_nfy            - Notification function provided by the caller,
 *                                    to notify that a Ginga APP state has been changed .
 *  @param  [in]  pv_tag            - Private tag provided by the caller.  
 *                                    This tag is passed to the caller's notification function .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reg_app_stat_cb(
        x_ginga_app_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API gets the Ginga APPs' info list.  
 *  @param  [out]  pui4_app_num     - Number of APPs in APP list .
 *  @param  [out]  ppt_app_list     - Ginga APPs' info list.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Get APP list successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_INV_ARG          - Invalid argument.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_get_app_list(
        UINT32*                       pui4_app_num,
        GINGA_APP_INFO_T**            ppt_app_list);


/*------------------------------------------------------------------*/
/*! @brief  This API starts a Ginga APP.  
 *  @param  [in]  s_app_id          - Specify the Ginga APP's ID .
 *  @param  [in]  b_sync            - Indicates if this is a synchronous operation.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Start the Ginga APP successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_INV_ARG          - Invalidate argument.
 *  @retval GINGAR_INV_STATE        - Already started or already in starting state.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 *  @retval GINGAR_TIMEOUT          - Time out when start in synchronized mode.
 *  @retval GINGAR_INTERNAL_ERROR   - Internal error. 
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_start_app(const CHAR* s_app_id, BOOL b_sync);


/*------------------------------------------------------------------*/
/*! @brief  This API stops a Ginga APP.  
 *  @param  [in]  s_app_id          - Specify the Ginga APP's ID .
 *  @param  [in]  b_sync            - Indicates if this is a synchronous operation.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Stop the Ginga APP successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_INV_ARG          - Invalidate argument.
 *  @retval GINGAR_INV_STATE        - Already stopped or already in stopping state.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 *  @retval GINGAR_TIMEOUT          - Time out when stop in synchronized mode.
 *  @retval GINGAR_INTERNAL_ERROR   - Internal error. 
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_stop_app (const CHAR* s_app_id, BOOL b_sync);


/*------------------------------------------------------------------*/
/*! @brief  This API controls whether or not to allow auto-starting application
 *          by broadcasting control.
 *  @param  [in]  b_enable          - Indicates if auto-starting is allowed.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Set auto start successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_INTERNAL_ERROR   - Internal error. 
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_set_app_auto_start(BOOL b_enable);


/*------------------------------------------------------------------*/
/*! @brief  This API sends a key event to Ginga middleware.  
 *  @param  [in]  e_key             - The key event code to send .
 *  @param  [in]  ui4_key_code      - The key code(or symbol) get from DirectFB .
 *  @param  [in]  e_cond            - The key event condition , key up or key down.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Push key event successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 *  @retval GINGAR_NOT_ATTACHED     - The key code is not attached to Ginga middleware.
 *                                    It means that Ginga middleware no longer requires 
 *                                    to be notified about this key
 *  @retval GINGAR_INV_STATE        - The Ginga middleware is not in visible state.
 *  @retval GINGAR_INV_ARG          - Invalide argument.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_send_key_event (GINGA_KEY_CODE_T e_key, UINT32  ui4_key_code,IOM_NFY_COND_T e_cond);

extern INT32 x_ginga_get_reserved_key(UINT32*  pui4_reserved_key, UINT8* pui1_key_num);

/*------------------------------------------------------------------*/
/*! @brief  This API sends a networt event to Ginga middleware.  
 *  @param  [in]  e_code            - The network event code to send .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Push network event successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_send_network_event (GINGA_EVENT_CODE_T e_code);

/*------------------------------------------------------------------*/
/*! @brief  This API sends a networt event to Ginga middleware.  
 *  @param  [in]  e_code                        - The network event code to send .
 *  @param  [in]  ui2_on_id                     - The original network Id.
 *  @param  [in]  ui2_ts_id                     - The transpond stream ID.
 *  @param  [in]  ui2_rc_key_id             - The remote control key ID.
 *  @param  [in]  ui2_svc_id                    - The service ID.
 *  @param  [in]  ui4_comp_tag              - The component tag.
 *  @return Return the error code
 *  @retval GINGAR_OK                            - Push network event successfully.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_send_network_event_ex(
        GINGA_EVENT_CODE_T          e_code,
        UINT16                      ui2_on_id,
        UINT16                      ui2_ts_id,
        UINT16                      ui2_rc_key_id,
        UINT16                      ui2_svc_id,
        UINT32                      ui4_comp_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API add a property to Ginga middleware.  
 *  @param  [in]  s_name            - The property name .
 *  @param  [in]  aui1_buf_def_val  - The property value.
 *  @param  [in]  z_buf_def_val_len - The property value buffer length.
 *  @param  [in]  b_const_4_astrotv - If this property is unmutable for astrotv. 
 *  @param  [in]  b_const_4_native  - If this property is unmutable for native app. 
 *                                    If it is true , this property can not be modified by set_property.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Add a new property successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_add_property(
        const CHAR*                 s_name, 
        UINT8                       aui1_buf_def_val[], 
        SIZE_T                      z_buf_def_val_len,
        BOOL                        b_const_4_astrotv,
        BOOL                        b_const_4_native);

/*------------------------------------------------------------------*/
/*! @brief  This API delete a property of Ginga middleware.  
 *  @param  [in]  s_name            - Name of property to delete .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Delete the property successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_del_property(const CHAR* s_name);


/*------------------------------------------------------------------*/
/*! @brief  This API modifies a property value of Ginga middleware.  
 *  It works only when this property already added with b_const_4_native = false.
 *  @param  [in]  s_name            - The property name to modify .
 *  @param  [in]  aui1_buf_val      - The new value to set.
 *  @param  [in]  z_buf_len         - The length of new value .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Set new value successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_set_property(
        const CHAR*                 s_name, 
        UINT8                       aui1_buf_val[], 
        SIZE_T                      z_buf_len);

/*------------------------------------------------------------------*/
/*! @brief  This API get a property value of Ginga middleware.  
 * It works only when this property already added.
 *  @param  [in]  s_name            - The property name to modify .
 *  @param  [in]  aui1_buf_val      - The buffer for storing the property value.
 *  @param  [in]  z_buf_len         - The buffer length .
 *  @param  [in/out] pui4_remain    - when the buffer is not enough to hold
 *                                    the entire property value, this variable
 *                                    will indicate how many bytes remain to
 *                                    be stored. First time it will be 0. 
*                                     On sucessive calls the same value returned
*                                     previously will be passed and must be used
*                                     to calculate the offset from where the value
*                                     must be copied.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Set new value successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_get_property(
        const CHAR*                 s_name, 
        UINT8                       aui1_buf_val[], 
        SIZE_T                      z_buf_len,
        UINT32*                     pui4_remain);


/*------------------------------------------------------------------*/
/*! @brief  This API reset a property  value to the default value of add_property.  
 *  @param  [in]  s_name            - The property to reset .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Reset successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reset_property(const CHAR* s_name);


/*------------------------------------------------------------------*/
/*! @brief  This API redraw screen.  
 *  @return Return the error code
 *  @retval GINGAR_OK               - Reset successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_redraw_screen();


/*------------------------------------------------------------------*/
/*! @brief  This API enable screen.
 *  @param  [in]  b_enable            - enable/disable draw on screen.
 *  @return Return the error code
 *  @retval GINGAR_OK               - Reset successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga engine not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_enable_screen(BOOL b_enable);
INT32 x_ginga_screen_setResolution(UINT32 width, UINT32 height);
/*------------------------------------------------------------------*/
/*! @brief  This API enable / disable Ginga's control to TV audio / video.
 *  @param  [in]  b_enable          - TRUE: Enable, FALSE: disable
 *  @return Return the error code
 *  @retval GINGAR_OK               - Ginga set A/V control successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_av_enable(BOOL b_enable);


/*------------------------------------------------------------------*/
/*! @brief  This API mute / unmute audio in main / sub window.
 *  @param  [in]  ui1_main_sub      - The main / sub window to mute /
 *                                    unmute. 0: main, 1: sub.
 *  @param  [in]  e_strm_type       - The stream type to mute / unmute.
 *                                    ST_AUDIO: audio, ST_VIDEO: video.
 *  @param  [in]  b_mute            - To mute(TRUE) or unmute(FALSE).
 *  @return Return the error code
 *  @retval GINGAR_OK               - Operation is successful.
 *  @retval GINGAR_INTERNAL_ERROR   - Internal error occurs.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_av_mute(
        UINT8                       ui1_main_sub,
        STREAM_TYPE_T               e_strm_type,
        BOOL                        b_mute);


/*------------------------------------------------------------------*/
/*! @brief  This API freeze / unfreeze video in main / sub window.
 *  @param  [in]  ui1_main_sub      - The main / sub window to freeze /
 *                                    unfreeze. 0: main, 1: sub.
 *  @param  [in]  b_freeze          - To freeze(TRUE) or unfreeze(FALSE).
 *  @return Return the error code
 *  @retval GINGAR_OK               - Operation is successful.
 *  @retval GINGAR_INTERNAL_ERROR   - Internal error occurs.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_av_freeze(
        UINT8                       ui1_main_sub,
        BOOL                        b_freeze);

/*------------------------------------------------------------------*/
/*! @brief  This API sends a audio configuaration to Ginga middleware.   
 *  @param  [in]  i2_cfg_value_per  - the percentage of audio configuaration value
 *  @param  [in]  e_cfg_type        - audio configuaration type.  
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32 x_ginga_send_aud_cfg (
        INT16                    i2_cfg_value_per, 
        GINGA_AV_AUD_CFG_TYPE_T e_cfg_type);

/*------------------------------------------------------------------*/
/*! @brief  This API allows to registe a callback of a Ginga audio setting change.  
 *  @param  [in]  pf_nfy            - Notification function provided by the caller,
 *                                    to notify that audio setting need to be changed .
 *  @param  [in]  pv_tag            - Private tag provided by the caller.  
 *                                    This tag is passed to the caller's notification function .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reg_aud_cfg_cb(
        x_ginga_av_aud_cfg_nfy_fct  pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API allows to registe a callback of a Ginga audio setting change.  
 *  @param  [in]  pf_nfy            - Notification function provided by the caller,
 *                                    to notify that service need to be changed .
 *  @param  [in]  pv_tag            - Private tag provided by the caller.  
 *                                    This tag is passed to the caller's notification function .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_reg_svc_change_cb(
        x_ginga_svc_change_nfy_fct  pf_nfy,
        VOID*                       pv_tag);


/*------------------------------------------------------------------*/
/*! @brief  This API set the result of service selection.  
 *  @param  [in]  i4_result - the result of service selection
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32    x_ginga_set_svc_change_result(INT32 i4_result);

/*------------------------------------------------------------------*/
/*! @brief  This API register the tv video resize callback.  
 *  @param  [in]  pf_nfy                - Notification function provided by the caller,
 *                                        to notify that tv vid size changed.
 *  @param  [in]  pv_tag                - Private tag provided by the caller.  
 *                                        This tag is passed to the caller's notification function .
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32 x_ginga_reg_tv_vid_resize_cb(
        x_ginga_tv_vid_resize_nfy_fct   pf_nfy,
        VOID*                           pv_tag);

extern INT32 x_ginga_reg_attached_key_cb(
        x_ginga_attached_key_nfy_fct    pf_nfy,
        VOID*                           pv_tag);

extern INT32 x_ginga_enable_profileb(BOOL b_enable);

extern INT32 x_ginga_factory_reset();

extern INT32 x_ginga_reg_resume_main_tv_cb(
			x_ginga_resume_main_tv_nfy_fct	pf_nfy,
			VOID*							pv_tag);

extern INT32 x_ginga_reg_ott_status_cb(
            x_ginga_ott_status_nfy_fct pf_nfy,
            VOID*                      pv_tag);

INT32 x_ginga_sc_set_visible(BOOL b_visible);

INT32 x_ginga_sc_reg_status_cb(
            x_ginga_sc_status_nfy_fct  pf_nfy,
            VOID*                      pv_tag);

extern INT32    x_ginga_enable_app(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);

extern INT32    x_ginga_disable_app(
        x_ginga_eng_stat_nfy_fct    pf_nfy,
        VOID*                       pv_tag);
/*------------------------------------------------------------------*/
/*! @brief  This API set country code to Ginga library.  
 *  @param  [in]  e_country_code                - country code
 *  @return Return the error code
 *  @retval GINGAR_OK               - Register the callback successfully.
 *  @retval GINGAR_NOT_INIT         - Ginga not initialized yet.
 *  @retval GINGAR_OUT_OF_MEMORY    - Out of memory.
 */
/*------------------------------------------------------------------*/
extern INT32 x_ginga_set_country(GINGA_COUNTRY_CODE_T e_country_code);

extern INT32 x_ginga_enable_resize(BOOL b_resize);

/*----------------------------------------------------------------------------*/
/*! @} */
/*----------------------------------------------------------------------------*/

#endif /* _X_GINGA_H_ */

