dvb_epg.h 21 KB

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