⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 db_api.h

📁 DVB软件,基于CT216软件的开发源程序.
💻 H
📖 第 1 页 / 共 3 页
字号:
	bit 6 : scrambled indicator
			0 : not scrambled
			1 : scrambled
	bit 5 : user watch service program
			1 : user watch service program
	bit 4 : service deleted flag or stamping flag
			1 : service is deleted(or stamp) in SDRAM database
	bit 3 : Favor service flag
			1 : this service is favor service
	bit 2 : audio channel
			0: channel_1 
			1: channel_2
	bit 1..0 : audio mode
			00 : stereo
			01 : mono
			10 : both left
			11 : both right
	\endverbatim
	*/
	u8	u8AudioVolume; /* Store audio volume step by service */	//Marlin 20060504 Add
	u16 u16EitHeaderIdx; /**< This is a index point to EIT header. */
	u16 u16TTXPid;  /**< the TTX PID */ 
	u16 u16TypeEX;  /**< used for favorites and skip bit. */ 
	u16 u16PMTPid;
	u16 u16CASystemID;

#ifdef ATSC_SYSTEM
	u16 u16SourceID;
#endif

	//Used when defined ENABLE_LCN_SUPPORT <-- START
	u16	b1VisibleService	: 1;
	u16	b1LCNEnable			: 1;
	u16 u16LCN				:14;

	u16 u16NID; /* Network ID */
	u16 u16TSID; /* Transport Stream ID */
	u16 u16ONID; /* Original Network ID */
	u16 u16AC3Flag;

    u16 bitLCNGet			: 1;
#ifdef LCN_COUNTRY_CHECK_DISABLE    
    u16 bitCollison         : 1;
    #ifdef SUPPORT_SECOND_AUDIO_LANGUAGE
    u8  u8MultiAudio		: 1;
    u16 u16Reserved         :13;
    #else
    u16 u16Reserved         :14;
    #endif//SUPPORT_SECOND_AUDIO_LANGUAGE
#else
    #ifdef SUPPORT_SECOND_AUDIO_LANGUAGE
	u8  u8MultiAudio		: 1;
	u16 u16Reserved			:14;
	#else
	u16 u16Reserved			:15;
	#endif//SUPPORT_SECOND_AUDIO_LANGUAGE
    
#endif
#ifdef LCN_COUNTRY_CHECK_DISABLE    
        u16 u16PCN; /* the stream parsed order (channel number)*/
#endif
#ifdef  HDTV_DETECTION_ENABLE
	u8 u8StreamType;
#endif
    //Used when defined ENABLE_LCN_SUPPORT <-- END
}_Pack_Struct_
DVB_ServiceInfo;

extern u8 u8DVB_DBStartBank;

bool8 DVB_DatabaseClean(void);
/*! \fn void DVB_DatabaseClean(void)
\brief Clean database in dram.
\return TRUE - success
\return FALSE - fail
*/

bool8 DVB_DatabaseInit(void);
/*! \fn void DVB_DatabaseInit(void)
\brief Initial the database.
\return TRUE - success
\return FALSE - fail
*/

bool8 DVB_DatabaseRead (void);
/*! \fn bool8 DVB_DatabaseRead (void)
\brief Read database from flash.  This function needs called in system initial.
\return TRUE - success
\return FALSE - fail
*/


bool8 DVB_DatabaseWrite (void);
/*! \fn bool8 DVB_DatabaseWrite (void)
\brief Write database to flash.  When the database changed, the application needs 
this function to store the database information to flash.
\return TRUE - success
\return FALSE - fail
*/

bool8 DVB_DatabaseUpdateNotSave (void);
/*! \fn bool8 DVB_GetDatabaseUpdateNotSave (void)
\brief Get the sync state of database in SDRAM and flash.
\return TRUE - The database is update in SDRAM but it is not yet save to flash.
\return FALSE - The database in SDRAM and flash is synchornization.
*/

void DVB_DatabaseAbandonUpdate(void);
/*! \fn void DVB_DatabaseAbandonUpdate(void)
\brief Set database sync between SDRAM and Flash.
*/

void DVB_SatDelete (u8 u8SatIdx);
/*! \fn void DVB_SatDelete (u8 u8SatIdx)
\brief Delete a satellite record.  The "Others" satellite can't be deleted.
This function also deletes the related transponders and services.
\param u8SatIdx (Input) the satellite index
*/

void DVB_TPDelete(u16 tpIndex, u16* pu16NofTV, u16* pu16NofRadio );
/*! \fn void DVB_TPDelete(u16 tpIndex, u16* pu16NofTV, u16* pu16NofRadio )
\brief Delete a transponder record.
This function also deletes the related services.
\param u16TpIdx (Input) the transponder index
\param pu16NofTV (Output) Number of deleted TV service
\param pu16NofRadio (Output) Number of deleted TV service
*/

void DVB_ServiceDelete (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx);
/*! \fn void DVB_ServiceDelete (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx)
\brief Delete a service record.  The service maybe is video or radio.
For the performance issue, this function only set a flag in database.
If the application want to remove the record from database, it needs call
the \a DVB_ServicePack() function.
\param enServiceType (Input) the service type.
\param u16SrvIdx (Input) the service index
*/

void DVB_ServicePack (EN_SERVICE_TYPE enServiceType);
/*! \fn void DVB_ServicePack (EN_SERVICE_TYPE enServiceType)
\brief Check the service database and delete the services that delete flag is ON.
\param enServiceType(Input)  the service type
*/


bool8 DVB_SatAdd(u8 *pu8SatIdx, DVB_SatInfo *pstSat);
/*! \fn bool8 DVB_SatAdd(u8 *pu8SatIdx, DVB_SatInfo *pstSat)
\brief Add a new satellite record to database.
\param pu8SatIdx (Output) the satellite index in database
\param pstSat (Input) the pointer of satellite record
\return TRUE - success
\return FALSE - the database is full.
*/

bool8 DVB_TPAdd(u16 *pu16TpIdx, DVB_TPInfo *pstTP);
/*! \fn bool8 DVB_TPAdd(u16 *pu16TpIdx, DVB_TPInfo *pstTP)
\brief Add a new transponder record to database.
\param pu16TpIdx (Output) the transponder index in database
\param pstTP (Input) the pointer of transponder record
\return TRUE - success
\return FALSE - the database is full.
*/
bool8 DVB_ServiceAdd(EN_SERVICE_TYPE enServiceType, u16 *pu16SrvIdx, DVB_ServiceInfo *pstService);
/*! \fn bool8 DVB_ServiceAdd(EN_SERVICE_TYPE enServiceType, u16 *pu16SrvIdxx, DVB_ServiceInfo *pstService)
\brief Add a new service record to database.
\param enServiceType (Input)  the service type
\param pu16SrvIdx (Output) the service index in database
\param pstService (Input) the pointer of service record
\return TRUE - success
\return FALSE - the database is full.
*/

bool8 DVB_SatUpdate (u8 u8SatIdx, DVB_SatInfo *pstSat);
/*! \fn bool8 DVB_SatUpdate (u8 u8SatIdx, DVB_SatInfo *pstSat)
\brief Update a satellite record to database by satellite index.
\param u8SatIdx (Input) the satellite index
\param pstSat (Input) the pointer of satellite record
\return TRUE - success
\return FALSE - The index number can't be found.
*/


bool8 DVB_TPUpdate (u16 u16TpIdx, DVB_TPInfo *pstTP);
/*! \fn bool8 DVB_TPUpdate (u16 u16TpIdx, DVB_TPInfo *pstTP)
\brief Update a transponder record to database by transponder index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Input) the pointer of transponder record
\return TRUE - success
\return FALSE - The index number can't be found.
*/
bool8 DVB_TerreTPUpdate(u16 u16TpIndex, DVB_TerreTPInfoEx *pstTpInfo);
/*! \fn bool8 DVB_TPUpdate (u16 u16TpIdx, DVB_TPInfo *pstTP)
\brief Update a transponder record to database by transponder index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Input) the pointer of transponder record
\return TRUE - success
\return FALSE - The index number can't be found.
*/

bool8 DVB_CableTPUpdate(u16 u16TpIndex, DVB_CableTPInfoEx *pstTpInfo);
/*! \fn bool8 DVB_CableTPUpdate(u16 u16TpIndex, DVB_CableTPInfoEx *pstTpInfo)
\brief Update a transponder record to database by transponder index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Input) the pointer of transponder record
\return TRUE - success
\return FALSE - The index number can't be found.
*/

bool8 DVB_ServiceUpdate (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx, DVB_ServiceInfo *pstService);
/*! \fn bool8 DVB_ServiceUpdate (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx, DVB_ServiceInfo *pstService)
\brief Update a service record to database by service index.
\param enServiceType (Input)  the service type
\param u16SrvIdx (Input) the service index
\param pstService (Input) the pointer of service record
\return TRUE - success
\return FALSE - The index number can't be found.
*/


bool8 DVB_SatRead (u8 u8SatIdx, DVB_SatInfo *pstSat);
/*! \fn bool8 DVB_SatRead (u8 u8SatIdx, DVB_SatInfo *pstSat)
\brief Read a satellite record by index.
\param u8SatIdx (Input) the satellite index
\param pstSat (Output) the satellite record
\return TRUE - success
\return FALSE - fail
*/

bool8 DVB_TPRead (u16 u16TpIdx, DVB_TPInfo *pstTP);
/*! \fn bool8 DVB_TPRead (u16 u16TpIdx, DVB_TPInfo *pstTP)
\brief Read a transponder record by index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Output) the transponder record
\return TRUE - success
\return FALSE - fail
*/
bool8 DVB_TerreTPRead(u16 u16TpIndex, DVB_TerreTPInfoEx *pstTpInfo);
/*! \fn bool8 DVB_TerreTPRead (u16 u16TpIdx, DVB_TerreTPInfoEx *pstTpInfo)
\brief Read a transponder record by index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Output) the transponder record
\return TRUE - success
\return FALSE - fail
*/
bool8 DVB_CableTPRead(u16 u16TpIndex, DVB_CableTPInfoEx *pstTpInfo);
/*! \fn bool8 DVB_CableTPRead (u16 u16TpIdx, DVB_TerreTPInfoEx *pstTpInfo)
\brief Read a transponder record by index.
\param u16TpIdx (Input) the transponder index
\param pstTP (Output) the transponder record
\return TRUE - success
\return FALSE - fail
*/
bool8 DVB_ServiceRead (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx, DVB_ServiceInfo *pstService);
/*! \fn bool8 DVB_ServiceRead (EN_SERVICE_TYPE enServiceType, u16 u16SrvIdx, DVB_ServiceInfo *pstService)
\brief Read a service record by index.
\param enServiceType (Input)  the service type
\param u16SrvIdx (Input) the service index
\param pstService (Output) the service record
\return TRUE - success
\return FALSE - fail
*/

s16 DVB_Get_OthersSatIdx(void);
/*! \fn s16 DVB_Get_OthersSatIdx(void)
\brief Get the "Others" satellite index in database.
\return return_value < 0 : The "Others" satellite can't found.
\return return_value >= 0 : success
*/

u16 DVB_SatGetTotal (void);
/*! \fn u16 DVB_SatGetTotal (void)
\brief Get the total satellite number.
\return the number of total satellite
*/

u16 DVB_TPGetTotal (void);
/*! \fn u16 DVB_TPGetTotal (void)
\brief Get the total transponder number.
\return the number of total transponder
*/

u16 DVB_ServiceGetTotal (EN_SERVICE_TYPE enServiceType);
/*! \fn u16 DVB_ServiceGetTotal (EN_SERVICE_TYPE enServiceType)
\brief Get the total service number.
\param enServiceType (Input)  the service type
\return the number of total service for a specific service
*/

u16 DVB_ServiceGetTotalbySatellite (EN_SERVICE_TYPE enServiceType, u8 u8SatIdx);
/*! \fn u16 DVB_ServiceGetTotalbySatellite (EN_SERVICE_TYPE enServiceType, u8 u8SatIdx)
\brief Get the total service number.
\param enServiceType (Input)  the service type
\param u8SatIdx (Input) the satellite index
\return the number of total service for a specific service and specific satellite
*/

bool8 DVB_GetFirstServicebyTP (EN_SERVICE_TYPE enServiceType, u16 u16TPIdx, DVB_ServiceInfo *pstService, u16 *pu16Index);
/*! \fn bool8 DVB_GetFirstServicebyTP (EN_SERVICE_TYPE enServiceType, u16 u16TPIdx, DVB_ServiceInfo *pstService, u16 *pu16Index)
\brief Read the first service record by transponder index.
\param enServiceType (Input)  the service type
\param u16TPIdx (Input) the transponder index
\param pstService (Output) the service record
\param pu16Index (Output) the service index
\return TRUE - success
\return FALSE - fail
*/

bool8 DVB_GetFirstServicebyFB (EN_SERVICE_TYPE enServiceType, u32 u32Freq, u8 u8BandWidth, DVB_ServiceInfo *pstService, u16 *pu16Index);
/*! \fn bool8 DVB_GetFirstServicebyFB (EN_SERVICE_TYPE enServiceType, u32 u32Freq, u8 u8BandWidth, DVB_ServiceInfo *pstService, u16 *pu16Index)
\brief Read the first service record by Frequency & Bandwidth.
\param enServiceType (Input)  the service type
\param u32Freq (Input) the frequency
\param u8BandWidth (Input) the bandwidth
\param pstService (Output) the service record
\param pu16Index (Output) the service index
\return TRUE - success
\return FALSE - fail
*/

u16 DVB_GetNextFavorService(EN_SERVICE_TYPE tvRadioMode, u16 pgmIndex);
/*! \fn u16 DVB_GetNextFavorService(EN_SERVICE_TYPE tvRadioMode, u16 pgmIndex)
\brief Get the next favor service.
\param enServiceType (Input)  the service type
\param u16CurrentIdx (Input) This is the current service index.
\return the favor service index

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -