/* DMW_PsiDatabase.h DST TV MW PSI Scan Module PSI Database management implementation Copyright 2006~2010 Digital STREAM Technology, Inc. All Rights Reserved */ #ifndef __DMW_PSI_DATABASE_H__ #define __DMW_PSI_DATABASE_H__ #include "DMW_PsiConfig.h" #include "DMW_PsiTypes.h" #include "DMW_PsiAPI.h" #ifdef __cplusplus extern "C" { #endif #if COMMENT ____Overview____(){} #endif /* ÀÌ ¸ðµâ¿¡¼­´Â PSI DBÀÇ °¢Á¾ Å×ÀÌºí¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Â functionÀ» ±¸ÇöÇÑ´Ù. PSI DB¿¡ Á¢±ÙÇϱâ À§Çؼ­ »ç¿ëÇÏ´Â mutex lock API. ------------- Rule ------------- PsiTask ¿¡¼­ DB´Â ÀÚÀ¯·Ó°Ô ÀÐÀ» ¼ö ÀÖÀ½. PsiTask ¿¡¼­´Â Lock ÈÄ DB ¼öÁ¤ °¡´É. ÀÓÀÇ task¿¡¼­´Â Lock ÈÄ DB Àб⠰¡´É. ÀÓÀÇ task¿¡¼­ DBÀÇ º¯°æÀº Àý´ë ±ÝÁö. --------- End of Rule --------- ÀÏ¹Ý Caller task¿¡¼­´Â DB ³»¿ëÀ» Àбâ Àü¿¡ ¹Ýµå½Ã DMW_PSI_LockDB() API¸¦ ÀÌ¿ëÇÏ¿© lock µÈ ÈÄ¿¡ Àоî¾ß ÇÑ´Ù. ³»ºÎ ¸ðµâ¿¡¼­´Â PSIDB_LockDB() ¸¦ »ç¿ëÇØµµ µÈ´Ù. ÀÏ¹Ý caller task¿¡¼­ Á÷Á¢ DB ³»¿ëÀ» ¼öÁ¤ÇÏ´Â °ÍÀº Àý´ë ÇØ¼­´Â ¾ÈµÈ´Ù. */ #if COMMENT ____Get____(){} #endif /* all of these call do unlocked access. so, caller should be careful to race condition. */ MPEG_PAT *PSIDB_GetPAT(int id); MPEG_PMT **PSIDB_GetPMTs(int id); mgtSectionPtr_t PSIDB_GetMgt(int id); xvctPtr_t PSIDB_GetVct(int id); sttSectionPtr_t PSIDB_GetStt(int id); eitPtr_t *PSIDB_GetEits(int id, int source_id); eitPtr_t PSIDB_GetEit(int id, int source_id, int iEit); S_PSIM_MGT_DIGEST *PSIDB_GetMgtDigest(int id); BOOL PSIDB_IsPmtsCompleted(int id); BOOL PSIDB_IsSubChScanReadyToStart(int id); BOOL PSIDB_IsSubChEitsCompleted(int id, int source_id); BOOL PSIDB_IsAllSubChEitsCompleted(int id, int iEit); BOOL PSIDB_IsSubChEttVRequired(int id, int source_id); BOOL PSIDB_IsSubChEttSlotCompleted(int id, int source_id, int iEit); BOOL PSIDB_IsSubChAllEttsCompleted(int id, int source_id); #if COMMENT ____DB_Op____(){} #endif STATUS PSIDB_AllocateChInfoNode(int id); STATUS PSIDB_RemoveChInfoNode(int id); #if COMMENT ____Update____(){} #endif /* all of these update API do mutex lock internally. they change something in database. */ STATUS PSIDB_UpdatePAT(int id, MPEG_PAT *pat); STATUS PSIDB_UpdatePMT(int id, MPEG_PMT *pmt); STATUS PSIDB_UpdateMgt(int id, mgtSectionPtr_t mgt); STATUS PSIDB_UpdateVct(int id, xvctPtr_t vct); STATUS PSIDB_UpdateStt(int id, sttSectionPtr_t stt, UINT32 tick_stt_get); STATUS PSIDB_InvalidateStt(int id); STATUS PSIDB_UpdateRrt(int id, rrtSectionPtr_t rrt); STATUS PSIDB_UpdateEit(int id, eitPtr_t eit, int index); STATUS PSIDB_UpdateEtt(int id, ettSectionPtr_t ett, int index); void PSIDB_DeleteTables(int id); void PSIDB_DeleteAllTables(void); void PSIDB_LockDB(BOOL bLock); S_PSIM_CHINFO *PSIDB_GetPsiChInfo(int id); S_PSIM_SUBCHINFO *PSIDB_GetPsiSubChInfo(int id, int source_id); void PSIDB_PrintAllTables(int id, int source_id, BOOL bDetail); #if COMMENT ____Private____(){} #endif // do not use these functions if you don't know what it does void PSIDB_FreeEtts(S_PSIM_SUBCHINFO *subchInfo, int iEit); void PSIDB_FreeEitAndRelatedEtts(S_PSIM_SUBCHINFO *subchInfo, int iEit); void PSIDB_FreeSubChInfo(S_PSIM_SUBCHINFO *subchInfo); void PSIDB_FreeChInfo(S_PSIM_CHINFO *chInfo); #ifdef __cplusplus } /* extern "C" */ #endif #endif // __DMW_PSI_DATABASE_H__