/**
* Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
*
* @file
*
* @brief this file defines subtitle interface for afw layer.
*
* The interface includes: subtitle init and uninit function that is used by afw module,
* subtitle parsing descriptor function that is used by psi listener module.
* When pmt monitor listener callback function gets the pes private datas and if the pes
* private datas inlcude subtitle descriptor, the subtitle parsing descriptor function will
* be used to start to parse subtitle descriptor.
*/

#ifndef __AI_SBTVD_SUBTITLE_H__
#define __AI_SBTVD_SUBTITLE_H__

#include "al_basictypes.h"

#ifdef __cplusplus
	extern "C"{
#endif


/**
* @brief subtitle init function.
*
* This api is used to create mutex for protecting the shared resource and so on.
*
* @param al_void.
*
* @return AL_SUCCESS if initialization is successful, AL_FAILURE otherwise.
*/
AL_Return_t AI_SBSUB_Init(al_void);

/**
* @brief subtitle uninit function.
*
* This api is used to delete mutex for protecting the shared resource and so on.
*
* @param al_void.
*
* @return AL_SUCCESS if uninitialization is successful, AL_FAILURE otherwise.
*/
AL_Return_t AI_SBSUB_Uninit(al_void);

/**
* @brief the function can parse subtitle descriptor in PMT.
*
* After parsing PMT, PSI listener will start to work. When the stream
* type is private data of PES packet, and the descriptor type is stream identifier
* descriptor, the  stream identifier descriptor will be parsing. When parsing the
* stream identifier descriptor, the information will be stored to subtitle buffer.
*
* @param *Data  stream identifier descpriptor data.
*
* @param DataLen the number of bytes of descriptors.
*
* @param Pid  stream identifier pid.
*
* @return AL_SUCCESS if parsing  stream identifier descriptor is successful,
* AL_FAILURE otherwise .
*/
AL_Return_t AI_SBSUB_ParseDesc(al_uint8 *Data, al_uint16 DataLen, al_uint16 Pid);

#ifdef __cplusplus
}
#endif
#endif

