dvb_epg.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. /**
  2. * Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
  3. *
  4. * @file
  5. *
  6. * @brief Definitions for DVB EPG.
  7. *
  8. * @note This file is from ETSI EN 300 468 and ISO 13818.
  9. *
  10. * @note D Book/E Book/Z Book/Nordig and freeview are defined here.
  11. *
  12. * This file is the EPG data which forms a part of DVB bitstreams.
  13. *
  14. * @htmlonly
  15. * The diagram below shows the DVB delivery model.
  16. * @endhtmlonly
  17. *
  18. * @image html dvb_delivery_model.PNG "DVB Delivery Model"
  19. *
  20. * @htmlonly
  21. * The diagram below shows the service information relationship.
  22. * @endhtmlonly
  23. *
  24. * @image html organization_service_information.PNG
  25. * "Service Information Relationship"
  26. */
  27. #ifndef SUNMEDIA_MID_EPG_INCLUDED
  28. #define SUNMEDIA_MID_EPG_INCLUDED
  29. #include "types.h"
  30. #include "umf_debug.h"
  31. #ifdef CONFIG_EPG_USE_RESERVE_MM
  32. extern void *EPG_MM_Malloc(size_t size);
  33. extern void EPG_MM_Free(void *address);
  34. #define EPG_MALLOC(size) EPG_MM_Malloc(size)
  35. #define EPG_FREE(ptr) EPG_MM_Free(ptr)
  36. #else
  37. #define EPG_MALLOC(size) malloc(size)
  38. #define EPG_FREE(ptr) free(ptr)
  39. #endif
  40. #define MAGIC_NO (0x5678)
  41. /** Match any service id */
  42. #define RESERVED_SERVICE_ID (0xFFFF)
  43. /** Match any transport stream id */
  44. #define RESERVED_TRANSPORT_ID (0xFFFF)
  45. /** Match any original network id */
  46. #define RESERVED_ORIGINAL_NET_ID (0xFFFF)
  47. #define MAX_ISO_LANG_CODE (4)
  48. #if 0//defined(CONFIG_DRAMSIZE) && CONFIG_DRAMSIZE == 64
  49. #define MAX_DATA_SIZE (255)
  50. #define EPG_EXTEND_EVENT_DESC_NUM (16)
  51. #else
  52. #define MAX_DATA_SIZE (512)//(255)/* modify by qinhe on 2014/04/27 for new font show UTF8 length is 298 for si02_21c_2k_64qam_cr23_gi32_7.30.ts SIT888 & #2426_Russia_578000_DVBT.ts mantis 23917 */
  53. #define EPG_EXTEND_EVENT_DESC_NUM (19) //(16) , increase to 19 for 16 is not enough for some event. mantis 0038265: [T1][RDA8528]DTV,DVB-C,播放ZDF_20110925_130918.TS,節目ZDF,進到EPG,在ZDF.umwelt按info key,最後面的內容有少.
  54. #endif
  55. #define MAX_CONTENT_NUM_IN_CONTENT_DESCRIPTOR (127)
  56. /** Remove lator */
  57. #define MID_EPG_DBG_FLAG (0)
  58. #define MID_EPG_ERROR_FLAG (1)
  59. /**< Debug and error print defines */
  60. #if MID_EPG_DBG_FLAG
  61. #define EPG_PRINT(fmt, arg...) \
  62. do { \
  63. UMFDBG(0,"[Debug]%s: %d Line\n", __FUNCTION__, __LINE__); \
  64. UMFDBG(0,fmt, ##arg); \
  65. } while(0)
  66. #else
  67. #define EPG_PRINT(fmt, arg...);
  68. #endif
  69. #if MID_EPG_ERROR_FLAG
  70. #define EPG_ERROR(fmt, arg...) \
  71. do { \
  72. UMFDBG(0,"[ERR]%s: %d Line\n", __FUNCTION__, __LINE__); \
  73. UMFDBG(0,fmt, ##arg); \
  74. } while(0)
  75. #else
  76. #define EPG_ERROR(fmt, arg...);
  77. #endif
  78. #ifdef __cplusplus
  79. extern "C"
  80. {
  81. #endif
  82. /**
  83. * @brief The epg events types.
  84. */
  85. typedef enum
  86. {
  87. EVENT_TYPE_NOW = 0,
  88. EVENT_TYPE_NEXT,
  89. EVENT_TYPE_SCHEDULE,
  90. EVENT_TYPE_OTHER,
  91. } MID_EPG_EventType;
  92. /**
  93. * @brief ST Date
  94. */
  95. typedef struct _ST_DATE
  96. {
  97. UINT16 usYear; /**< year */
  98. UINT8 ucMonth; /**< month */
  99. UINT8 ucDay; /**< day */
  100. } ST_DATE;
  101. /**
  102. * @brief ST time
  103. */
  104. typedef struct _ST_TIME
  105. {
  106. UINT8 ucHour; /**< hour */
  107. UINT8 ucMin; /**< minute */
  108. UINT8 ucSec; /**< second */
  109. } ST_TIME;
  110. /**
  111. * @brief ST event date and time
  112. */
  113. typedef struct _ST_EVENT_TIME
  114. {
  115. ST_DATE stStartDate; /**< start date */
  116. ST_TIME stStartTime; /**< start time */
  117. ST_DATE stEndDate; /**< end date */
  118. ST_TIME stEndTime; /**< end time */
  119. } ST_EVENT_TIME;
  120. /**
  121. * @brief return types
  122. */
  123. typedef enum
  124. {
  125. MID_EPG_SUCCESS,
  126. MID_EPG_FAILED,
  127. MID_EPG_INVALID_PARAM,
  128. MID_EPG_STATE_ERROR,
  129. } MID_EPG_Return_t;
  130. /**
  131. * @brief Identifies a specific EPG Handle.
  132. *
  133. * It is an opaque type specific to the target implement. It is used to
  134. * identify the EPG.
  135. *
  136. * @note 0 is invalid handle.
  137. */
  138. typedef INT32 MID_EPG_Handle_t;
  139. /**
  140. * @brief Identifies a specific EPG event Handle.
  141. *
  142. * It is an opaque type specific to the target implement. It is used to
  143. * identify the EPG event.
  144. *
  145. * @note 0 is invalid handle.
  146. */
  147. typedef UINT32 MID_EPG_EventHandle_t;
  148. /**
  149. * The epg events that are passed to the application through callback
  150. */
  151. typedef enum MID_EPGEvent_t
  152. {
  153. EPG_EVENT_NOW_ADDED, /**< Now event added */
  154. EPG_EVENT_NOW_MODIFIED, /**< Now event modified */
  155. EPG_EVENT_NOW_DELETE, /**< Now event deleted */
  156. /** EPG Schedule Event */
  157. EPG_EVENT_ADDED, /**< Entry added */
  158. EPG_EVENT_MODIFIED, /**< Entry modified(Reserved) */
  159. EPG_EVENT_DELETED, /**< Entry deleted */
  160. EPG_ALLEVENTS_DELETED, /**< All Events deleted */
  161. EPG_GET_SYSTEMTIME, /**< get current system time */
  162. EPG_CHECK_SRVEXIST, /**< check the service is exist in database */
  163. } MID_EPGEvent_t;
  164. /**
  165. * The epg mode, for example normal and time shift
  166. */
  167. typedef enum MID_EPGMode_t
  168. {
  169. EPG_MODE_NORMAL,
  170. EPG_MODE_TIMESHIFT,
  171. } MID_EPGMode_t;
  172. /**
  173. * @brief The prototype of the callback to be registed with epg.
  174. *
  175. * @param enEvent EPG event, see #MID_EPGEvent_t.
  176. *
  177. * @param pParam A pointer to the EPG event that has changed, see #MID_EPGEventCallback_t.
  178. */
  179. typedef void (*fMidEpgCallback)(MID_EPGEvent_t enEvent, void* pParam);
  180. /**
  181. * struct MID_ServLocator_t
  182. * @brief dvb service locator.
  183. *
  184. * This structure defines the dvb service locator.
  185. */
  186. typedef struct MID_ServLocator_t
  187. {
  188. /** Service information */
  189. UINT16 original_network_id; /**< Original network ID */
  190. UINT16 tranport_id; /**< transport id */
  191. UINT16 service_id; /**< service id */
  192. } MID_ServLocator_t;
  193. /**
  194. * struct MID_EPGEventParam_t
  195. * @brief epg callback parameter.
  196. *
  197. * This structure defines the parameter of epg callback.
  198. */
  199. typedef struct MID_EPGEventCallback_t
  200. {
  201. MID_EPG_EventHandle_t epg_handle;
  202. UINT16 event_id; /**< event id */
  203. UINT16 event_type; /** <event type */
  204. /** Service information */
  205. UINT16 original_network_id; /**< Original network ID */
  206. UINT16 tranport_id; /**< transport id */
  207. UINT16 service_id; /**< service id */
  208. } MID_EPGEventCallback_t;
  209. /**
  210. * struct MID_EPGInit_t
  211. * @brief EPG module initializing parameter.
  212. *
  213. * Structure defines the parameters to be set during initializing epg module.
  214. */
  215. typedef struct MID_EPGInit_t
  216. {
  217. UINT8 db_type; /**< Database type such as DVB-T, DVB-C or DVB-S etc */
  218. UINT8 epg_mode;
  219. UINT16 serv_max; /**< The maximum of services to cache */
  220. UINT32 total_size; /**< The epg total size */
  221. UINT32 capability; /**< Reserved for future */
  222. fMidEpgCallback fCallback; /**< EPG callback function */
  223. } MID_EPGInit_t;
  224. /**
  225. * struct MID_EPGEventParam_t
  226. * @brief epg callback parameter.
  227. *
  228. * This structure defines the parameter of epg callback.
  229. */
  230. typedef struct MID_EPGEventInfo_t
  231. {
  232. UINT16 event_id;
  233. /**
  234. * running status values:
  235. * 0 undefined
  236. * 1 not running
  237. * 2 starts in a few seconds
  238. * 3 pausing
  239. * 4 running
  240. * 5 service off-air
  241. * 6 and 7 reserved for future use
  242. */
  243. UINT8 running_status;
  244. /**
  245. * free_CA_mode values:
  246. * 0 indicates that all the component streams of the service are not
  247. * scramble.
  248. * 1 indicates that access to one or more streams \a may be controlled
  249. * by a CA system.
  250. */
  251. UINT8 free_CA_mode;
  252. UINT32 start_time; /**< Interpreted as a value from epoch time in second */
  253. UINT32 duration; /**< Duration of the event in second */
  254. UINT16 event_type; /** <event type */
  255. } MID_EPGEventInfo_t;
  256. /**
  257. * struct MID_EPGEventDetails_t(#DESCR_SHORT_EVENT and #DESCR_EXTENDED_EVENT)
  258. * @brief event descriptor structure for 0x4D
  259. *
  260. * The event descriptor provides the item of the event and a descriptor
  261. * of the event in text form.
  262. * see (ETSI EN 300 468 section 6.2.37 and 6.2.15).
  263. */
  264. typedef struct
  265. {
  266. UINT8 iso_639_code[MAX_ISO_LANG_CODE]; /**< ISO_639_language_code */
  267. UINT8 event_name_length; /**< length of the multilingual event name */
  268. UINT8 event_name[MAX_DATA_SIZE]; /**< name of the multilingual event name */
  269. UINT8 text_length; /**< length of the multilingual service_name */
  270. UINT8 text[MAX_DATA_SIZE]; /**< name of the multilingual service_name */
  271. UINT8 content_classify;
  272. UINT8 event_rating;
  273. UINT32 extend_num;
  274. UINT32 event_offset;
  275. } MID_SIDesc_EventDetail_t;
  276. /**
  277. * struct MID_EPGEventDetails_t(#DESCR_SHORT_EVENT and #DESCR_EXTENDED_EVENT)
  278. * @brief event descriptor structure for 0x4E.
  279. *
  280. * The event descriptor provides the item of the event and a descriptor
  281. * of the event in text form.
  282. * see (ETSI EN 300 468 section 6.2.37 and 6.2.15).
  283. */
  284. typedef struct
  285. {
  286. UINT8 iso_639_code[MAX_ISO_LANG_CODE]; /**< ISO_639_language_code */
  287. UINT8 item_name_length; /**< length of the multilingual service_provider_name */
  288. UINT8 item_name[MAX_DATA_SIZE]; /**< name of the multilingual service provider */
  289. UINT8 text_length; /**< length of the multilingual service_name */
  290. UINT8 text[MAX_DATA_SIZE]; /**< name of the multilingual service_name */
  291. } MID_SIDesc_ExtEventDetail_t;
  292. /**
  293. * @brief EIT Content_Nibble_Level_1_Type
  294. * Reference EN 300 468 clause 6.2.9 Content Descriptor.
  295. * Reference to table Content_nibble level 1 and 2 assignments
  296. */
  297. typedef enum
  298. {
  299. MID_EPG_CONTENT_TYPE_UNDEFINE = 0x0,
  300. MID_EPG_CONTENT_TYPE_MOVIE = 0x1,
  301. MID_EPG_CONTENT_TYPE_NEWS = 0x2,
  302. MID_EPG_CONTENT_TYPE_SHOW = 0x3,
  303. MID_EPG_CONTENT_TYPE_SPORTS = 0x4,
  304. MID_EPG_CONTENT_TYPE_CHILDREN_PROGRAM = 0x5,
  305. MID_EPG_CONTENT_TYPE_MUSIC = 0x6,
  306. MID_EPG_CONTENT_TYPE_ARTS= 0x7,
  307. MID_EPG_CONTENT_TYPE_SOCIAL= 0x8,
  308. MID_EPG_CONTENT_TYPE_EDUCATION = 0x9,
  309. MID_EPG_CONTENT_TYPE_LEISURE_HOBBIES = 0xA,
  310. MID_EPG_CONTENT_TYPE_SPECIAL = 0xB,
  311. } MID_EPG_Content_Nibble_Level_1_Type_t;
  312. /**
  313. * struct MID_SIDesc_ContentDescriptor_t(#DESCR_CONTENT)
  314. * @brief event descriptor structure for 0x54.
  315. *
  316. * The event descriptor provides the item of the event and a descriptor
  317. * of the event in text form.
  318. * see (ETSI EN 300 468 section 6.2.9).
  319. */
  320. typedef struct
  321. {
  322. UINT8 content_nibble_level_1;
  323. } MID_SIDesc_ContentDescriptor_t;
  324. /**
  325. * @brief Initializes the epg module.
  326. *
  327. * This attempts to initialize epg module, allocate the necessary resources.
  328. *
  329. * @param pstInitParam Initializing paramenter.
  330. *
  331. * @param handle The returned EPG module handle.
  332. *
  333. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  334. * value is returned.
  335. */
  336. MID_EPG_Return_t MID_EPGInit(MID_EPGInit_t *pstInitParam, MID_EPG_Handle_t *handle);
  337. /**
  338. * @brief Uninitializes the EPG module and deallocates resources.
  339. *
  340. * This attempts to uninitialize EPG module.
  341. *
  342. * @note Once the EPG module has been uninitialized, calling this API again
  343. * will do nothing and will simply return successful infomation.
  344. *
  345. * @param handle The EPG module handle retrived from #MID_EPGInit.
  346. *
  347. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  348. * value is returned.
  349. */
  350. MID_EPG_Return_t MID_EPGDeInit(MID_EPG_Handle_t *handle);
  351. /**
  352. * @brief Start EPG module appointed by EPG handle.
  353. *
  354. * Enables EPG processing.
  355. *
  356. * @note Once the EPG module has been started, calling this API again
  357. * will do nothing and will simply return successful infomation.
  358. *
  359. * @param handle The EPG module handle retrived from #MID_EPGInit.
  360. *
  361. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  362. * value is returned.
  363. */
  364. MID_EPG_Return_t MID_EPGStart(MID_EPG_Handle_t handle);
  365. /**
  366. * @brief Stop demux.
  367. *
  368. * Disables EPG processing.
  369. *
  370. * @note Once the EPG module has been stopped, calling this API again
  371. * will do nothing and will simply return successful infomation.
  372. *
  373. * @param handle The EPG module handle retrived from #MID_EPGInit.
  374. *
  375. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  376. * value is returned.
  377. */
  378. MID_EPG_Return_t MID_EPGStop(MID_EPG_Handle_t handle);
  379. /**
  380. * === EPG Event navagation ===
  381. */
  382. /**
  383. * @brief Get the first event in the list.
  384. *
  385. * This is used to get the frist event in the list.
  386. *
  387. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  388. *
  389. * @param p_stServLoc Service locator.
  390. *
  391. * @param event_handle The returned event handle.
  392. *
  393. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  394. * value is returned.
  395. */
  396. MID_EPG_Return_t MID_EPGGetFirstEvent(MID_EPG_Handle_t handle,
  397. MID_ServLocator_t *p_stServLoc, MID_EPG_EventHandle_t *event_handle, MID_EPGEventInfo_t *p_stEventInfo);
  398. /**
  399. * @brief Get the last event in the list.
  400. *
  401. * This is used to get the last event in the list.
  402. *
  403. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  404. *
  405. * @param p_stServLoc Service locator.
  406. *
  407. * @param event_handle The returned event handle.
  408. *
  409. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  410. * value is returned.
  411. */
  412. MID_EPG_Return_t MID_EPGGetLastEvent(MID_EPG_Handle_t handle,
  413. MID_ServLocator_t *p_stServLoc, MID_EPG_EventHandle_t *event_handle, MID_EPGEventInfo_t *p_stEventInfo);
  414. /**
  415. * @brief Get the next event referred by event_handle in the list.
  416. *
  417. * This is used to get the next event in the list.
  418. *
  419. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  420. *
  421. * @param event_handle The reference event handle. Each call the returned
  422. * event handle is put here.
  423. *
  424. * @return On success, Pointer to #EPGCACHE_Event_t is returned, On failure, #gsl_null
  425. * value is returned.
  426. */
  427. MID_EPG_Return_t MID_EPGGetNextEvent(MID_EPG_Handle_t handle,
  428. MID_ServLocator_t *p_stServLoc, MID_EPG_EventHandle_t *event_handle, MID_EPGEventInfo_t *p_stEventInfo);
  429. /**
  430. * @brief Get the previous event referred by p_stRef in the list.
  431. *
  432. * This is used to get the previous event in the list.
  433. *
  434. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  435. *
  436. * @param event_handle The reference event handle. Each call the returned
  437. * event handle is put here.
  438. *
  439. * @return On success, Pointer to #EPGCACHE_Event_t is returned, On failure, #gsl_null
  440. * value is returned.
  441. */
  442. MID_EPG_Return_t MID_EPGPrevEvent(MID_EPG_Handle_t handle,
  443. MID_ServLocator_t *p_stServLoc, MID_EPG_EventHandle_t *event_handle, MID_EPGEventInfo_t *p_stEventInfo);
  444. /**
  445. * @brief Get the event associated with time.
  446. *
  447. * This is used to the event associated with time in the list.
  448. *
  449. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  450. *
  451. * @param p_stServLoc Service locator.
  452. *
  453. * @param time Anchor time.
  454. *
  455. * @param event_handle The returned event handle.
  456. *
  457. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  458. * value is returned.
  459. */
  460. MID_EPG_Return_t MID_EPGGetEventAt(MID_EPG_Handle_t handle,
  461. MID_ServLocator_t *p_stServLoc, UINT32 time,
  462. MID_EPG_EventHandle_t *event_handle, MID_EPGEventInfo_t *p_stEventInfo);
  463. /**
  464. * @brief Get the curr or next.
  465. *
  466. * This is used to the event associated with event type.
  467. *
  468. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  469. *
  470. * @param p_stServLoc Service locator.
  471. *
  472. * @param b_Curr get current event or next event.
  473. *
  474. * @param event_handle The returned event handle.
  475. *
  476. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  477. * value is returned.
  478. */
  479. MID_EPG_Return_t MID_EPGGetCurrNextEvent(MID_EPG_Handle_t handle,
  480. MID_ServLocator_t *p_stServLoc, bool b_Curr,
  481. MID_EPG_EventHandle_t *event_handle);
  482. /**
  483. * @brief Remove service(s) of the EPG module and deallocates service resources.
  484. *
  485. * This attempts to remove service(s) of EPG module.
  486. *
  487. * @note When any of original network id, transport stream id or service id
  488. * is of insignificance. It means it does not care about the value and match
  489. * any.
  490. *
  491. * @note RESERVED_ORIGINAL_NET_ID means that original_network_id is of insignificance.
  492. *
  493. * @note RESERVED_TRANSPORT_ID means that transport_id is of insignificance.
  494. *
  495. * @note RESERVED_SERVICE_ID means that service_id is of insignificance.
  496. *
  497. * @param handle The EPG module handle retrived from #MID_EPGInit.
  498. *
  499. * @param stServLoc Service locator.
  500. *
  501. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  502. * value is returned.
  503. */
  504. MID_EPG_Return_t MID_EPGClearChannel(MID_EPG_Handle_t handle,
  505. MID_ServLocator_t stServLoc);
  506. /**
  507. * @brief Lock channels.
  508. *
  509. * This is used to lock channels to avoid removing from memory buffer.
  510. *
  511. * @note When this interface is called again, the previous settings are
  512. * removed automatically.
  513. *
  514. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  515. *
  516. * @param p_stServLoc Service locator.
  517. *
  518. * @param channel_num The number of p_stServLoc.
  519. *
  520. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  521. * value is returned.
  522. */
  523. MID_EPG_Return_t MID_EPGLockChannels(MID_EPG_Handle_t handle,
  524. MID_ServLocator_t *p_stServLoc, UINT16 channel_num);
  525. /**
  526. * @brief Get the event information.
  527. *
  528. * This is used to get event information.
  529. *
  530. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  531. *
  532. * @param event_handle The event handle.
  533. *
  534. * @param p_stEventInfo Event information to be stored.
  535. *
  536. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  537. * value is returned.
  538. */
  539. MID_EPG_Return_t MID_EPGGetEventInfo(MID_EPG_Handle_t handle,
  540. MID_EPG_EventHandle_t event_handle, MID_ServLocator_t *SrvLoc, MID_EPGEventInfo_t *p_stEventInfo);
  541. /**
  542. * @brief Get the event descriptor for 0x4D or 0x4E.
  543. *
  544. * This is used to get 0x4D or 0x4E descriptor.
  545. *
  546. * @note when the size is equal to zero, it means it receive the first
  547. * descriptor if existed.
  548. *
  549. * @note The memory for p_stEventDetail is allocated dynamically.
  550. *
  551. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  552. *
  553. * @param event_handle The event handle.
  554. *
  555. * @param tag The descriptor tag.
  556. *
  557. * @param lang Pointer to array of ISO 639 language code.
  558. *
  559. * @param size The size of array.
  560. *
  561. * @param p_stEventDetail Event descriptor(0x4D or 0x4E) to be stored.
  562. *
  563. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  564. * value is returned.
  565. */
  566. MID_EPG_Return_t MID_EPGGetEventDetail(MID_EPG_Handle_t handle,
  567. MID_EPG_EventHandle_t event_handle, MID_ServLocator_t *SrvLoc, UINT8 **lang, UINT16 size,
  568. MID_SIDesc_EventDetail_t *p_stEventDetail, MID_EPGEventInfo_t *p_stEventInfo);
  569. /**
  570. * @brief Get the event 0x4E.
  571. *
  572. * This is used to get 0x4E descriptor.
  573. *
  574. * @note when the size is equal to zero, it means it receive the first
  575. * descriptor if existed.
  576. *
  577. * @note The memory for p_stEventDetail is allocated dynamically.
  578. *
  579. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  580. *
  581. * @param event_handle The event handle.
  582. *
  583. * @param tag The descriptor tag.
  584. *
  585. * @param lang Pointer to array of ISO 639 language code.
  586. *
  587. * @param size The size of array.
  588. *
  589. * @param p_stEventDetail Event descriptor(0x4D or 0x4E) to be stored.
  590. *
  591. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  592. * value is returned.
  593. */
  594. MID_EPG_Return_t MID_EPGGetExtendEvent(MID_EPG_Handle_t handle,
  595. MID_EPG_EventHandle_t event_handle, MID_ServLocator_t *SrvLoc, UINT8 **lang, UINT16 size,
  596. UINT16 *offset, MID_SIDesc_ExtEventDetail_t *p_stExtEventInfo);
  597. /**
  598. * @brief Get the event descriptor.
  599. *
  600. * This is used to get epg descriptor.
  601. *
  602. * @note Currently this interface just returns raw descriptor data. and
  603. * maybe it will be modified later.
  604. *
  605. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  606. *
  607. * @param event_handle The event handle.
  608. *
  609. * @param tag The descriptor tag.
  610. *
  611. * @param offset The offset to get the descriptor from.
  612. *
  613. * @param status When status is #gsl_true, the descriptor is parsed. If the
  614. * decDescTag is contained in buffer, but the parsing processing is not
  615. * implemented, then the raw data(including tag and length field) is returned
  616. * and the status is set to #gsl_false.
  617. *
  618. * @param pDesc Event descriptor data to be stored.
  619. *
  620. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  621. * value is returned.
  622. */
  623. MID_EPG_Return_t MID_EPGGetDesc(MID_EPG_Handle_t handle,
  624. MID_EPG_EventHandle_t event_handle, MID_ServLocator_t *SrvLoc, UINT8 tag, UINT16 *offset, bool *status, void *pDesc);
  625. /**
  626. * @brief Get the number of events in the service.
  627. *
  628. * This is used to get the number of events in the service.
  629. *
  630. * @param handle The EPG cache handle retrived from #MID_EPGInit.
  631. *
  632. * @param count The returned total number of events.
  633. *
  634. * @return On success, MID_EPG_SUCCESS is returned, On failure, the other
  635. * value is returned.
  636. */
  637. MID_EPG_Return_t MID_EPGGetTotalEvent(MID_EPG_Handle_t handle,
  638. MID_ServLocator_t *p_stServLoc, UINT32 *count);
  639. MID_EPG_Return_t MID_EPGSetCurrTSIDORGID(UINT16 ORGID, UINT16 TSID);
  640. MID_EPG_Return_t MID_EPGSetCountryCode(INT8 *countrycode);
  641. #ifdef SUPPORT_CLEAN_EX_DESCRIPTOR
  642. MID_EPG_Return_t MID_EPGCleanExDescriptor(MID_EPG_Handle_t handle);
  643. MID_EPG_Return_t MID_EPGReceiveExDescriptor(MID_EPG_Handle_t handle);
  644. #endif
  645. #ifdef SUPPORT_CLEAN_EPG
  646. MID_EPG_Return_t MID_EPGCleanEPG(MID_EPG_Handle_t handle);
  647. MID_EPG_Return_t MID_EPGReceiveEPG(MID_EPG_Handle_t handle);
  648. #endif
  649. #ifdef __cplusplus
  650. }
  651. #endif
  652. #endif /* SUNMEDIA_MID_EPG_INCLUDED */