#ifndef  _C_RSF_H_
#define  _C_RSF_H_

/*-----------------------------------------------------------------------------
 include files
 -----------------------------------------------------------------------------*/
#include "u_rsf.h"

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

/*-----------------------------------------------------------------------------
 functions declarations
 -----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
 * Name: c_rsf_init
 *
 * Description: This function for section filter initialization 
 *
 * Inputs:  -
 *
 * Outputs: -
 *
 * Returns: RSF_OK                      Success to initialize section filter
 *          RSF_INIT_FAIL               Fail to initialize section filter
 ----------------------------------------------------------------------------*/
INT32 c_rsf_init( VOID);

/*-----------------------------------------------------------------------------
 * Name: c_rsf_alloc_source
 *
 * Description: This function for setting the tuner mode
 *
 * Inputs:  e_source_type         Contains a tuner mode
 *
 * Outputs: -
 *
 * Returns: RSF_OK                         Success to set the tuner type
 *          RSF_NOT_INIT                   Raw section filter not inited
 *          RSF_INV_ARG                    Invalid arguments
 *          RSF_LOCK_ERROR                 Fail to get or release raw section filter lock
 *          RSF_UNLOCK_ERROR               Fail to release raw section filter lock
 *          RSF_OPERATION_NOT_AVAILABLE    system error or operation invalid
 *          RSF_SET_TUNER_TYPE_FAIL        Fail to set tuner type
 ----------------------------------------------------------------------------*/
INT32 c_rsf_alloc_source(RSF_SOURCE_TYPE_T e_source_type,UINT16 u2_id);

/*-----------------------------------------------------------------------------
 * Name: c_rsf_open_filter
 *
 * Description: This function for starting to load section by the reserved  filter 
 *
 * Inputs:  pt_req              the filter request arguments
 *          pv_nfy_tag          Contains a user data from API caller. 
 *          pv_nfy              The callback function when section is avaiable
 *
 * Outputs: pui4_filter_id  the id of filter
 *
 * Returns: RSF_OK                         Success to start to load section
 *          RSF_INV_ARG                    Invalid arguments
 *          RSF_LOCK_ERROR                 Fail to get or release raw section filter lock
 *          RSF_UNLOCK_ERROR               Fail to release raw section filter lock
 *          RSF_ALREADY_STARTED            The filter filter has already started
 *          RSF_SRC_CONN_ERROR             Tuner connection status error, can not load section
 *          RSF_OPERATION_NOT_AVAILABLE    system error or operation invalid
 ----------------------------------------------------------------------------*/
INT32 c_rsf_open_filter(UINT32* pui4_filter_id, RSF_FILTER_REQ_T* pt_req,
                        VOID* pv_nfy_tag, x_rsf_nfy_fct pf_nfy);

/*-----------------------------------------------------------------------------
 * Name: c_rsf_close_filter
 *
 * Description: This function for free a filter
 *
 * Inputs:  ui4_client_hdl        the id of filter
 *
 * Outputs: -
 *
 * Returns: RSF_OK                         Success to stop loading section
 *          RSF_INV_ARG                    Invalid arguments
 *          RSF_LOCK_ERROR                 Fail to get or release raw section filter lock
 *          RSF_UNLOCK_ERROR               Fail to release raw section filter lock
 *          RSF_ALREADY_STOPPED            The filter has already stopped
 *          RSF_NOT_START                  The filter has not started
 *          RSF_SECTION_BUFFER_NOT_FREE    The section buffer is not freed completely
 *          RSF_OPERATION_NOT_AVAILABLE    system error or operation invalid
 ----------------------------------------------------------------------------*/
INT32 c_rsf_close_filter(UINT32 ui4_client_hdl);

#endif /* _C_RSF_H_ */

