/* DMW_EpgInterface.h New EPG Middleware Interface 1 (EPG1 compatible version) There are one interface supported, which is mostly compatible with old EPG 1.0 MW.. Copyright 2004 Digital STREAM Technology, Inc. All Rights Reserved $Id: DMW_EpgBase.h v1.00 2004/07 cafrii Exp $ */ #ifndef __DMW_EPG_INTERFACE_H__ #define __DMW_EPG_INTERFACE_H__ #include "DMW_EpgBase.h" /* Epg 2.0 New Core Header file */ #include "DMW_ChannelDemux.h" /* cafrii 050624 add for xvct */ #include "DHL_AVCAP.h" /* 2010.02.02 foxhunt : add for AudioType */ /*---------- EIA-766 Rating ---------------*/ typedef enum { RATING766_NONE = 0, /* Missing RatingÀ» ÀǹÌÇÔ. TV_None, MPAA-NRÀÌ ¾Æ´Ô. */ RATING766_US_Entire_Audience, RATING766_US_Children, RATING766_US_MPAA, RATING766_CANADA_English, RATING766_CANADA_French, } RATING766_T; typedef struct { RATING766_T type; UINT8 value; UINT8 D, L, S, V, FV; } DMW_Rating766; /*---------- Region 5 Rating --------------- */ #define MAX_RATING_DIMS_NUM 20 /* D-RRT guide line ¹®¼­ */ #define MAX_RATING_RGNS_NUM 8 /* refer ATSC A65B $6.9.4 up to 8 regions allowed per event */ typedef struct { UINT8 region_id; UINT8 num_dimensions; struct { UINT8 index; /* dimension index */ UINT8 value; /* value */ } dimension[MAX_RATING_DIMS_NUM]; /* »ç¿ëµÇ°í ÀÖÁö ¾Ê¾Æ¼­ »èÁ¦ UINT16 rating_description_length; UINT8 *rating_description; */ } DMW_RatingRegion; typedef struct { UINT8 region_count; DMW_RatingRegion region[MAX_RATING_RGNS_NUM]; } DMW_Rating5; /* Audio Program Information cafrii 060609, add userparam. */ typedef struct { UINT16 elementaryPid; UINT32 ISO639_LanguageCode; UINT8 serviceType; /* service type in PMT info. not important now. */ tDHL_AudioCodingType audioType; /* probably AC3, but keep it for later use */ UINT32 userData; /* user (app) can use this variable for free. */ } DMW_AudioElement, *DMW_AudioElementPtr; /* ÇÏÀ§ 16 bit´Â ¹Þ±â¸¦ ¿øÇÏ´Â ÃÖ´ë event °¹¼öÀÌ´Ù. ÀϹÝÀûÀ¸·Î OSD Á¦ÇÑ ¶§¹®¿¡ ÀÏÁ¤ °¹¼ö ÀÌ»óÀº ÇÊ¿äÇÏÁö ¾Ê´Â °æ¿ì°¡ ÀÖÀ» ¼ö ÀÖ´Ù. */ #define GET_EVENT_BASIC 0x000000 #define GET_EVENT_RATING 0x010000 #define GET_EVENT_CAPTION 0x020000 #define GET_EVENT_TITLE 0x040000 #define GET_EVENT_TEXT 0x080000 #define GET_EVENT_STATIC_MEM 0x100000 //neverdai 110713 static memory¸¦ »ç¿ëÇÔ. // -ÀÎÀÚ Áß ÇϳªÀÎ aFoundEvents·Î static memory¸¦ Àü´ÞÇÔ // -caller´Â ³Ë³ËÇÑ memory size¸¦ ÇÒ´çÇØ¾ß ÇÒ ÇÊ¿ä ÀÖÀ½. // -¶ÇÇÑ titleText, eventETM°°ÀÌ ¾ò¾î¿Ã µ¥ÀÌÅÍ¿¡ ´ëÇØ¼­µµ ¸Þ¸ð¸® ÇÒ´çÀÌ µÇ¾î ÀÖ¾î¾ß ÇÔ. // -captionÀº µû·Î ¸Þ¸ð¸®°¡ ÇÒ´çµÇÁö ¾ÊÀ½. // -¸Þ¸ð¸® ÃʱâÈ­µµ callerÀÇ ¸ò #define GET_EVENT_ALL 0x0FFFFF//0xFFFFFF //neverdai ÇÏÀ§ 16bit´Â °¹¼ö, ¹Ù·Î À§ »óÀ§ 4bit´Â ¾ò¾î¿Ã µ¥ÀÌÅÍ, ±× À§ »óÀÇ 4bit´Â optionÀÓ. //µû¶ó¼­ Get_EVENT_ALLÀ» 0x0FFFFF·Î ÇÏ´Â°Ô ÁÁÀ½. #define DEFAULT_MAX_EVENT_NUMBER 200 /* cafrii 060620 add */ #define RRT1_MAX_DIM 3 /* iskang 0800619 add RRT regionÀÇ ÃÖ´ë dimension number */ typedef struct { UINT16 programId; /* EIT event °¢°¢ÀÇ event ID¸¦ ÀǹÌÇÑ´Ù. */ /* EIT³»ÀÇ event Á¤º¸¿¡ ÀÖ´Â ½Ã°£ Á¤º¸ */ UINT32 programLength; /* seconds units */ UINT32 startTime; /* number of GPS seconds */ #if 0 // 2010.01.29 foxhunt : DMW_Rating5¸¦ »ç¿ëÇÏÀÚ. ratingRegionCount´Â DMW_Rating5ÀÇ region_count ÀÓ UINT8 ratingRegionCount; /*Content Advisory descriptor*/ DMW_Rating *rating; /* event descriptorÀÎ contentAdvisoryDesc ³»¿ëÀ» ºÐ¼®Çؼ­ ¸¸µç °ªµéÀÌ´Ù. region count°¹¼ö¸¸Å­ ÀÖ°í, dimensionÀº Ç®¾î¼­ ±â·ÏÇϰí ÀÖÀ½. */ #else DMW_Rating5 rating; /* ÀÌ field´Â pointer°¡ ¾Æ´Ï´Ù. */ #endif /* cafrii 030608 add */ captionServiceDescriptorPtr_t caption; /* EIT ³»ÀÇ event ³»ÀÇ title Á¤º¸ÀÌ´Ù. */ UINT8 titleTextLength; UINT8 *titleText; /* ÀÌ event¶û ¿¬°áµÈ ETM Á¤º¸ÀÌ´Ù. ETT·ÎºÎÅÍ ¾ò¾î¿Ô´Ù. */ UINT16 eventETMLength; UINT8 *eventETM; } DMW_EpgEvent, *DMW_EpgEventPtr; typedef DmcEpgEventType EpgUpdateEventType; /* ¿ø·¡ enum °ªÀ¸·Î Á¤ÀÇµÈ »ó¼öÀε¥ ´õÀÌ»ó »ç¿ëÇÏÁö ¾ÊÀ» °ÍÀ̹ǷΠenumÀº »èÁ¦ÇÏ¿´°í ÀÌ typeÀº compatibility¸¦ À§ÇØ ±×³É intÇüÀ¸·Î Á¤ÀÇÇÔ. */ typedef STATUS (*EpgUpdateCallbackFn) (EpgUpdateEventType evt, UINT32 param1, UINT32 param2); /*---------------------------- // Porting½ÃÀÇ ÁÖÀÇ »çÇ×: // // EventProc¿¡¼­ ³Ñ°ÜÁÖ´Â »ç¿ëÀÚ event typeÀÇ Çü½ÄÀÌ // ±âÁ¸ÀÇ EpgUpdateEventType ¿¡¼­ ---> DmcEpgEventType ·Î º¯°æµÇ¾úÀ½.. // // EpgUpdateEventType À̸§µé: evtEpgUpdateStarted, evtEpgXXX.. // // DmcEpgEventType À̸§µé: epgEventStarted, epgEventXXX.. // // ÀÌ À̺¥Æ® µéÀº ±× ¼ýÀÚÀÇ Àǹ̰¡ Á¤È®È÷ ÀÏÄ¡ÇÏÁö ¾ÊÀ¸¸ç (´ë·« ºñ½ÁÇϱä ÇÏÁö¸¸) // °°ÀÌ ³Ñ°ÜÁÖ´Â parameterµéµµ Àǹ̰¡ ¿ÏÀüÈ÷ ´Ù¸£´Ù. // // µû¶ó¼­ EpgEventProcÀº ´Ù½Ã ÀÛ¼ºÇÏ´Â°Ô ÁÁÀ» µí.. */ /*---------------------------- // Àüü ±¸Á¶ // // // ±âº»ÀûÀ¸·Î ¸ðµç EpgInterface µéÀº EpgBase ±â¹Ý À§¿¡¼­ Á¤ÀǵȴÙ. // Update¸¦ ½ÃÀÛ/Á¾·á ÇÏ´Â °ÍÀº EpgBase API¸¦ ÀÌ¿ëÇØ¼­ ¼öÇàµÇÁö¸¸, // EpgData retrieve´Â ¾Æ·¡ Interface¸¦ ÅëÇØ¼­ ÀÌ·ç¾îÁø´Ù. */ /* compatible APIs */ STATUS DMW_EPG_Init(void); /* ÃʱâÈ­ */ STATUS DMW_EPG_UpdateCurrentRf(int rf, int source_id, EpgUpdateCallbackFn callback); /* RF ä³ÎÀÇ EPG °Ë»ö */ STATUS DMW_EPG_UpdateCurrentChannel(int iUCMId, EpgUpdateCallbackFn func); /* UID ä³ÎÀÇ EPG °Ë»ö */ STATUS DMW_EPG_DeleteAll(void); /* ¸ðµç ä³Î Á¤º¸ »èÁ¦.. */ STATUS DMW_EPG_GetEventsInRange(int iUCMId, UINT32 nStartTime, UINT32 nDuration, DMW_EpgEventPtr *aFoundEvents, int *piEventCounts, UINT32 flag); /* nStartTime GPS ½Ã°£ ºÎÅÍ nDuration ¿µ¿ªÀÇ ½Ã°£ ±¸°£°ú °ãÄ¡´Â event Á¤º¸¸¦ ¸®ÅÏ.. ºñ·Ï Epg Update´Â RF ´ÜÀ§°¡ ±âº»ÀÌÁö¸¸, EpgEvent Á¤º¸ µ¥ÀÌÅ͸¦ ÀÐÀ» ¶§¿¡´Â Minor channel (subchannel) ´ÜÀ§·Î °¡Á®¿Â´Ù.. */ STATUS DMW_EPG_GetEventInTime(int iUCMId, UINT32 nTime, DMW_EpgEventPtr *pFoundEvent, UINT32 flag); /* cafrii 060605 add */ STATUS DMW_EPG_GetEventInTimeByRf(int rf, int source_id, UINT32 nTime, DMW_EpgEventPtr *pFoundEvent, UINT32 flag); void DMW_EPG_FreeEpgEvents(DMW_EpgEvent *pEvent, int iCount); /* GetEventsXX ÇÔ¼ö·Î °¡Á®¿Â event Á¤º¸¸¦ free ½ÃŰ´Â ÇÔ¼ö ÇϳªÇϳª¾¿ free ÇÒ ¼ö ¾ø°í Åë°·Î free¸¦ ½ÃÄÑ¾ß ÇÔ.. (Áß¿ä!) pEvent´Â iCount °¹¼ö ¸¸Å­ÀÇ EpgEvent °¡ ÀúÀåµÈ arrayÀÇ ¼±µÎ Æ÷ÀÎÅÍÀÌ´Ù. */ /* cafrii 091105 add */ STATUS DMW_EPG_GetEventByEvid(int iUCMId, UINT16 evid, DMW_EpgEventPtr *pFoundEvent, UINT32 flag); STATUS DMW_EPG_GetEventByEvidAndRf(int rf, int source_id, UINT16 evid, DMW_EpgEventPtr *ppReturnEvent, UINT32 flag); /* cafrii 060814 add */ void DMW_EPG_GetScanStatus(int uid, DmcEpgStatus *pStat); /*------------------- utility APIs */ STATUS DMW_GetPsipDescriptor(UINT8 *descriptors, UINT16 len, UINT8 tag, UINT16 instance, UINT8 **descriptor); /* descriptor list ¿¡¼­ ÁöÁ¤ÇÑ tag¸¦ °®´Â ƯÁ¤ descriptor¸¦ ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù. */ STATUS DMW_ParseRatingDescriptor(UINT8 *descriptors, int descriptor_length, DMW_Rating5 *pRating); /* descriptor list ¿¡¼­ CA descriptor¸¦ ã°í ºÐ¼®ÇÏ¿© DMW_Rating Á¤º¸¸¦ ¿Ï¼ºÇÏ¿© ¸®ÅÏÇÑ´Ù. */ /* Rating info */ STATUS DMW_EPG_GetRatingInfo(int iUCMId, UINT32 nTime, DMW_Rating5 *pRating); STATUS DMW_EPG_GetRatingInfoByRF(int rf, UINT16 source_id, UINT32 nTime, DMW_Rating5 *pRating); STATUS DMW_EPG_GetRatingInfoInPMT(DMW_Rating5 *pRating); /* Caption Info */ STATUS DMW_EPG_GetCaptionDescriptor(int iUCMId, UINT32 nTime, captionServiceDescriptorPtr_t *pccdesc); STATUS DMW_EPG_GetCaptionDescriptorInPMT(captionServiceDescriptorPtr_t *pCC_Service); /* EIA-766 Rating */ void DMW_EPG_ConvertToRating766Info(DMW_RatingRegion *pRegion, DMW_Rating766 *pR766); BOOL DMW_EPG_IsValidRating766Info(DMW_Rating766 *pr766); char *DMW_EPG_Rating766String(DMW_Rating766 *pInfo, char *buf); /* cafrii 060609, support RRT(region 5) API */ BOOL DMW_EPG_CheckRatingBlockByRRT(DMW_Rating5 *pRating, BOOL *pbNoRating); STATUS DMW_EPG_GetRatingStringByRRT(DMW_Rating5 *pRating, UINT16 *str, int nBufSize); /*------------------- EpgUTIL */ #if 0 UINT16 DMW_Decode_MultipleStringStructure(UINT8 text_length, UINT8 *text_p, char *lang, UINT16 max_dec_length, UINT16 *decoded_text); #endif void DMW_EPG_FreeMLInfo(DMW_AudioElementPtr aLingualInfos); STATUS DMW_EPG_GetMLInfoInPMT(MPEG_PMT* pmt, DMW_AudioElementPtr *aLingualInfos, int *iLingualCount); STATUS DMW_EPG_GetMLInfoInVctDescriptors(UINT8 *descriptors, int descriptor_length, DMW_AudioElementPtr *aMLInfo, int *piCount); /* cafrii 050725 add */ STATUS DMW_EPG_GetMLInfoInVct(xvctChannelPtr_t vctch, DMW_AudioElementPtr *aMLInfo, int *piCount); /* cafrii 050627 add */ #if 0 STATUS DMW_EPG_GetLanguageCodeFromDescriptors(UINT8 *pDesc, int nDescLen, int instance, UINT32 *pLangCode, int *pServiceType); /* cafrii 050617 add ÁÖ¾îÁø descriptors ¸®½ºÆ®¿¡¼­ Language Á¤º¸¸¦ ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù. */ #endif void DMW_EPG_RegisterEpgIntfSymbols(void); void DMW_EPG_FreeEpgEvent(DMW_EpgEvent *pEvent); /* iskang */ /*---------------------------- // Epg data scan policy // // // Background scan: // ä³Î Æ©´× ÀÌÈÄ¿¡, ¶Ç´Â DTV sleep time ½Ã¿¡ À¯ÈÞ ½Ã°£À» ÀÌ¿ëÇÏ¿© Epg data¸¦ ¼öÁýÇÏ´Â ¹æ¹ý // DMW_EPG_UpdateCurrentRf ¸¦ »ç¿ëÇÏ¿© timeout ¾øÀÌ RF ´ÜÀ§·Î Scan.. // EpgBase API¸¦ Á÷Á¢ »ç¿ëÇÑ´Ù¸é eit_only flag¸¦ ¸ÕÀú »ç¿ëÇÒ ¼öµµ ÀÖÀ» °ÍÀÓ.. // // Forground scan: // EPG OSD¸¦ ¶ç¿ö¾ß ÇÏ´Â »óȲ¿¡¼­ forground·Î epg data¸¦ ¼öÁýÇϱâ // OSD¿¡¼­ ¸ÕÀú º¸¿©Áà¾ß ÇÏ´Â µ¥ÀÌÅͺÎÅÍ ¿ì¼± ¼öÁýÇÑ´Ù. // Çö½ÇÀûÀ¸·Î ¸ðµç µ¥ÀÌÅͰ¡ ´Ù ¼ö½ÅµÇ±â¸¦ ±â´Ù¸± ¼ö´Â ¾øÀ¸¹Ç·Î timeoutÀ» µÎ°í // º¹¼ö°³ÀÇ Ã¤³ÎÀ» ¼ø¼­´ë·Î µ¹¾Æ°¡¸é¼­ ¼ö½Å.. // OSD¸¦ º¸¿©ÁØ µÚ¿¡µµ °è¼Ó background·Î scan ÀÛ¾÷À» Çϵµ·Ï ÇÏ¿©, updateµÉ ¶§¸¶´Ù // OSD¸¦ updateÇÑ´Ù. // TestGetMultiChannelEpg ¿¹Á¦¸¦ Âü°íÇϱ⠹ٶ÷. */ #endif /* __DMW_EPG_INTERFACE_H__ */ /******************************************************************** $Log: DMW_EpgInterface.h,v $ 1.02 2004/12/23 descriptor parser API ¸î°³ Ãß°¡ 1.01 2004/11/30 DMW_EPG2_GetRating prototype changed 1.00 2004/11/? History °ü¸® ½ÃÀÛ *********************************************************************/