mid_siutil_13818.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. /*! \addtogroup SIUTIL
  2. * @{
  3. */
  4. /******************************************************************************/
  5. /**
  6. * \file mid_siutil_13818.h
  7. *
  8. * \brief header for 13818 SI
  9. *
  10. * \note Copyright (C) 2006 SunMedia Co, chengdu
  11. * Author anlzhao@sunmedia.com.cn
  12. *
  13. * \author
  14. *
  15. * The source code in this file is written by anlzhao referring to
  16. * 13818 and owned by SunMedia Coporation. The header defines all
  17. * the macro and common struct. You should include it in all file.
  18. *
  19. * BUGS:
  20. *
  21. ******************************************************************************/
  22. #ifndef _MID_SIUTIL_13818_H
  23. #define _MID_SIUTIL_13818_H
  24. //add by kai.wang++
  25. #include <string.h>
  26. #include <types.h>
  27. //#include "drv_demux.h"
  28. #include "mid_common.h"
  29. #include "mid_siutil.h" //[kiwi 20090213]
  30. #ifdef CONFIG_SUPPORT_SSU_ENHANCE_UPGRADE
  31. #include "unt.h"
  32. #endif
  33. /* Packet Identifier Value */
  34. #define PID_PAT 0x0000 /**<\brief PID of Program Association Table */
  35. #define PID_CAT 0x0001 /**<\brief PID of Conditional Access Table */
  36. /* Table Identifier Value */
  37. #define TABLE_ID_PAT 0x00 /**<\brief table_id of Program Association Section*/
  38. #define TABLE_ID_CAT 0x01 /**<\brief table_id of Conditional Access Section */
  39. #define TABLE_ID_PMT 0x02 /**<\brief table_id of Program Map Section */
  40. //#ifdef DVB_OTA_AUTO_DETECT//yc.guan 2010-04-15 add for SSU//cong.xiao 2010-06-24 modify for zBook
  41. #if defined(DVB_OTA_AUTO_DETECT) || defined(SUPPORT_OTA_UPGRADE_USERSET)
  42. #define TABLE_ID_DSI 0x3B /**<\brief table_id of DSI Section */
  43. #define TABLE_ID_DDB 0x3C /**<\brief table_id of DDB Section */
  44. #ifdef CONFIG_SUPPORT_SSU_ENHANCE_UPGRADE
  45. #define TABLE_ID_UNT 0x4B /**<\brief table_id of UNT Section */
  46. #endif
  47. #define OTA_TYPE_SSU (0)
  48. #define OTA_TYPE_OAD (1)
  49. #define DSMCC_DESCR_LEN (5)
  50. #endif
  51. /*
  52. * Descriptor Tag Value
  53. * defined by ISO/IEC 13818-1 Table 2-39
  54. */
  55. /* 0x00-0x01, Reserved */
  56. #define DESCR_VIDEO_STREAM 0x02 /**<\brief tag of video_stream_descriptor */
  57. #define DESCR_AUDIO_STREAM 0x03 /**<\brief tag of audio_stream_descriptor */
  58. #define DESCR_HIERARCHY 0x04 /**<\brief tag of hierarchy_descriptor */
  59. #define DESCR_REGISTRATION 0x05 /**<\brief tag of registration_descriptor */
  60. #define DESCR_DATA_STREAM_ALIGN 0x06 /**<\brief tag of data_stream_alignment_descriptor */
  61. #define DESCR_TARGET_BACKGRID 0x07 /**<\brief tag of target_background_grid_descriptor */
  62. #define DESCR_VIDEO_WINDOW 0x08 /**<\brief tag of video_window_descriptor */
  63. #define DESCR_CA 0x09 /**<\brief tag of CA_descriptor_descriptor */
  64. #define DESCR_ISO_639_LANGUAGE 0x0A /**<\brief tag of ISO_639_language_descriptor */
  65. #define DESCR_SYSTEM_CLOCK 0x0B /**<\brief tag of system_clock_descriptor */
  66. #define DESCR_MULTIPLEX_BUFFER_UTIL 0x0C /**<\brief tag of multiplex_buffer_utilization_descriptor */
  67. #define DESCR_COPYRIGHT 0x0D /**<\brief tag of copyright_descriptor */
  68. #define DESCR_MAXIMUM_BITRATE 0x0E /**<\brief tag of maximum bitrate_descriptor */
  69. #define DESCR_PRIVATE_DATA_IND 0x0F /**<\brief tag of private data indicator_descriptor */
  70. #define DESCR_SMOOTHING_BUFFER 0x10 /**<\brief tag of smoothing buffer_descriptor */
  71. #define DESCR_STD 0x11 /**<\brief tag of STD_descriptor */
  72. #define DESCR_IBP 0x12 /**<\brief tag of IBP_descriptor */
  73. /*
  74. * Descriptor Tag Value
  75. * defined by ISO/IEC 13818-6
  76. */
  77. // CONFIG_SUPPORT_MHEG5 +
  78. #define DESCR_CAROUSEL_ID 0x13 ///<\brief 12.5.1 Carousel identifier descriptor
  79. #define DESCR_ASSO_TAG 0x14 ///<\brief 12.5.2 Association tag descriptor
  80. #define DESCR_DEFERRED_ASSO_TAG 0x15 ///<\brief 2.5.3 Deferred association tags descriptor
  81. // -
  82. /* Max section size */
  83. #define MAX_SECTION_SIZE_PAT 1024 /**<\brief max size of PAT section */
  84. #define MAX_SECTION_SIZE_PMT 1024 /**<\brief max size of PMT section */
  85. #define MAX_SECTION_SIZE_CAT 1024 /**<\brief max size of CAT section */
  86. /*
  87. * Stream_type defined by MPEG2 Organization
  88. */
  89. /* The below defined the stream-type which is defined in mpeg spec
  90. * mpeg spec defined, commented by zhaoal:
  91. * value desc
  92. * 0x00 ITU-T|ISO/IEC Reserved
  93. * 0x01 ITU-T|ISO11172 Video
  94. * 0x02 ITU-T Rec.H.262 | ISO/IEC 13818-2 Video
  95. * 0x03 ISO/IEC 11171 Audio
  96. * 0x04 ISO/IEC 13818 Audio
  97. * 0x05 ITU-T Rec.H.222.0 | ISO/IEC 13818-1 Private Segment
  98. * 0x06 ITU-T Rec.H.222.0 |ISO/IEC 13818-1 PEC Packet contained
  99. * private data
  100. * 0x07 ISO/IEC 13522 MPEG
  101. * 0x08 ITU-T Rec.H.262 | ISO/IEC 13818-1 DSM-CC
  102. * 0x09 ITU-T Rec.H.262 | ISO/IEC 13818-1 /11172-1
  103. * 0x0A-0x7F ITU-T Rec.H.262 | ISO/IEC 13818-1 Reserved
  104. * 0x80-0xFF Private
  105. */
  106. #ifdef CONFIG_DTMB_SYSTEM
  107. #define STREAM_TYPE_DRA_AUDIO 0x00
  108. #endif
  109. #define STREAM_TYPE_VIDEO_MPEG1 0x01
  110. #define STREAM_TYPE_VIDEO_MPEG2 0x02
  111. #define STREAM_TYPE_AUDIO_MPEG1 0x03
  112. #define STREAM_TYPE_AUDIO_MPEG2 0x04
  113. #define STREAM_TYPE_PRIVATE_SECTION 0x05
  114. #define STREAM_TYPE_PRIVATE_DATA 0x06
  115. #define STREAM_TYPE_13522_MPEG 0x07
  116. #define STREAM_TYPE_H220_13818_6_DSMCC 0x08
  117. #define STREAM_TYPE_H220_13818_1 0x09
  118. #define STREAM_TYPE_MULTIPROTOCOL_ENCAP 0x0A // Multi-protocol Encapsulation
  119. #define STREAM_TYPE_OBJECT_DATA_CAROUSEL 0x0B // DSM-CC U-N Messages
  120. #define STREAM_TYPE_DSMCC_DESCRIPTOR 0x0C // DSM-CC Stream Descriptors
  121. #ifdef CONFIG_SUPPORT_MHEG5
  122. #define STREAM_TYPE_ANY_DSMCC_DATA 0x0D // DSM-CC Sections (any type, including private data)
  123. #else
  124. #define STREAM_TYPE_13818_6_D 0x0D
  125. #endif
  126. #define STREAM_TYPE_AUDIO_MPEG2_AAC 0x0f // MPEG2 AAC-LC ADTS
  127. #define STREAM_TYPE_VIDEO_MPEG4 0x10
  128. #define STREAM_TYPE_AUDIO_AAC 0x11 // With the LATM transport syntax as defined in 14496-3/AMD1 [kiwi 20080814]
  129. #define STREAM_TYPE_VIDEO_AVC 0x1B // h.264
  130. #ifdef CONFIG_DTMB_SYSTEM
  131. #define STREAM_TYPE_VIDEO_AVS 0x42
  132. #endif
  133. #define STREAM_TYPE_VIDEO_HEVC 0x24
  134. //#define STREAM_TYPE_AUDIO_AVS 0x43
  135. #define STREAM_TYPE_AUDIO_AC3 0x81
  136. #define STREAM_TYPE_AUDIO_EAC3 0x87
  137. #define STREAM_TYPE_VC_1 0xEA // VC-1 [kiwi 20090706]
  138. /* Timeout */
  139. #undef PAT_TIMEOUT
  140. #define PAT_TIMEOUT 150
  141. #undef PMT_TIMEOUT
  142. #define PMT_TIMEOUT 150
  143. // ================ PAT related ======================= //
  144. #define PAT_LEN 8
  145. /**
  146. * \brief PAT structure
  147. */
  148. typedef struct _mid_siutil_pat_t
  149. {
  150. UINT8 table_id :8; /**<\brief 0x00*/
  151. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  152. UINT8 :2;
  153. UINT8 dummy :1; /**<\brief has to be 0 */
  154. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator*/
  155. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  156. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit*/
  157. UINT8 transport_stream_id_lo :8; /**<\brief transport_stream_id low bit*/
  158. UINT8 current_next_indicator :1; /**<\brief current_next_indicator*/
  159. UINT8 version_number :5; /**<\brief version_number*/
  160. UINT8 :2;
  161. UINT8 section_number :8; /**<\brief section_number*/
  162. UINT8 last_section_number :8; /**<\brief last_section_number*/
  163. }MID_SiutilPat_t, *LP_MID_SiutilPat_t;
  164. #define PAT_PROG_LEN 4 /**<\brief information length of each program in PAT*/
  165. /**
  166. * \brief SIUTIL PAT program structure
  167. */
  168. typedef struct _mid_siutil_pat_prog_t
  169. {
  170. UINT8 program_number_hi :8; /**<\brief program_number high bit*/
  171. UINT8 program_number_lo :8; /**<\brief program_number low bit*/
  172. UINT8 pid_hi :5; /**<\brief PMTID high bit*/
  173. UINT8 reserved :3;
  174. UINT8 pid_lo :8; /**<\brief PMTID low bit*/
  175. }MID_SiutilPatProg_t, *LP_MID_SiutilPatProg_t;
  176. /**
  177. * \brief SIUTIL PAT program maps
  178. */
  179. typedef struct _mid_siutil_prog_maps_t
  180. {
  181. UINT16 program_number; /**<\brief program_number*/
  182. UINT16 pid; /**<\brief PMTID*/
  183. UINT8 collection_failed; // collection timeout
  184. }MID_SiutilProgMaps_t, *LP_MID_SiutilProgMaps_t;
  185. /**
  186. * \brief SIUTIL PAT info
  187. */
  188. typedef struct _mid_siutil_pat_info_t
  189. {
  190. UINT16 transport_stream_id; /**<\brief transport_stream_id*/
  191. UINT8 version_number; /**<\brief version_number*/
  192. UINT16 maps_count; /**<\brief program count in PAT*/
  193. MID_SiutilProgMaps_t *pat_maps; /**<\brief program count in PAT*/
  194. }MID_SiutilPatInfo_t, *LP_MID_SiutilPatInfo_t;
  195. // ================ PMT related ======================= //
  196. #define PMT_LEN 12
  197. /**
  198. * \brief PMT structure
  199. */
  200. typedef struct _mid_siutil_pmt_t
  201. {
  202. UINT8 table_id :8; /**<\brief 0x02 */
  203. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  204. UINT8 :2;
  205. UINT8 dummy :1; /**<\brief has to be 0 */
  206. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  207. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  208. UINT8 program_number_hi :8; /**<\brief program_number high bit */
  209. UINT8 program_number_lo :8; /**<\brief program_number low bit */
  210. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  211. UINT8 version_number :5; /**<\brief version_number */
  212. UINT8 :2;
  213. UINT8 section_number :8; /**<\brief section_number */
  214. UINT8 last_section_number :8; /**<\brief last_section_number */
  215. UINT8 PCR_PID_hi :5; /**<\brief PCR_PID high bit*/
  216. UINT8 :3;
  217. UINT8 PCR_PID_lo :8; /**<\brief PCR_PID low bit */
  218. UINT8 program_info_length_hi :4; /**<\brief program_info_length high bit */
  219. UINT8 :4;
  220. UINT8 program_info_length_lo :8; /**<\brief program_info_length low bit*/
  221. }MID_SiutilPmt_t, *LP_MID_SiutilPmt_t;
  222. #define PMT_INFO_LEN 5
  223. /**
  224. * \brief PMT stream info structure
  225. */
  226. typedef struct _mid_pmt_stream_info_t
  227. {
  228. UINT8 stream_type :8; /**<\brief stream_type */
  229. UINT8 elementary_PID_hi :5; /**<\brief elementary_PID high bit*/
  230. UINT8 :3;
  231. UINT8 elementary_PID_lo :8; /**<\brief elementary_PID low bit*/
  232. UINT8 ES_info_length_hi :4; /**<\brief ES_info_length high bit*/
  233. UINT8 :4;
  234. UINT8 ES_info_length_lo :8; /**<\brief ES_info_length low bit*/
  235. }MID_SiutilPmtStreamInfo_t, *LP_MID_SiutilPmtStreamInfo_t;
  236. #define PMT_PROG_INFO_DESC_LEN 2 // saint222
  237. #define PMT_CA_SYSTEM_ID_LEN 2 // add by cflu 071207
  238. typedef struct _mid_siutil_pmt_prog_info_descr_t
  239. {
  240. UINT8 desc_tag :8;
  241. UINT8 desc_length :8;
  242. }MID_SiutilPmtProgInfoDescr_t, *LP_MID_SiutilPmtProgInfoDescr_t;
  243. /**
  244. * \brief PMT stream info descriptor structure
  245. */
  246. typedef struct _mid_siutil_pmt_stream_info_descr_t
  247. {
  248. UINT8 stream_type; /**<\brief stream_type */
  249. UINT16 elementary_pid; /**<\brief elementary_pid */
  250. UINT16 descLen; /**<\brief total descriptor length */
  251. UINT8 *p_desc; /**<\brief pointer to descriptor */
  252. }MID_SiutilPmtStreamInfoDescr_t, *LP_MID_SiutilPmtStreamInfoDescr_t;
  253. /**
  254. * \brief PMT info structure
  255. */
  256. typedef struct _mid_siutil_pmt_info_t
  257. {
  258. UINT16 program_number; /**<\brief program_number*/
  259. UINT16 pcr_pid; /**<\brief pcr_pid*/
  260. UINT8 version_number; /**<\brief version_number*/
  261. UINT8 current_next_indicator; /**<\brief current_next_indicator*/
  262. UINT16 section_len;
  263. UINT32 crc32;
  264. /* Add by anlzhao, 2006/05/25 */
  265. UINT16 info_len; /**<\brief info_len */
  266. UINT8 *p_info; /**<\brief pointer to info descriptors*/
  267. UINT16 comp_count; /**<\brief component count*/
  268. MID_SiutilPmtStreamInfoDescr_t *p_comp; /**<\brief pointer to component*/
  269. }MID_SiutilPmtInfo_t, *LP_MID_SiutilPmtInfo_t;
  270. //#ifdef DVB_OTA_AUTO_DETECT//yc.guan 2010-04-15 add for SSU//cong.xiao 2010-06-24 modify for zBook
  271. #if defined(DVB_OTA_AUTO_DETECT) || defined(SUPPORT_OTA_UPGRADE_USERSET)
  272. /*
  273. * common si struct
  274. */
  275. typedef struct
  276. {
  277. UINT8 table_id :8;
  278. UINT8 section_length_hi :4;
  279. UINT8 :3;
  280. UINT8 section_syntax_indicator :1;
  281. UINT8 section_length_lo :8;
  282. UINT8 id_hi :8;
  283. UINT8 id_lo :8;
  284. UINT8 current_next_indicator :1;
  285. UINT8 version_number :5;
  286. UINT8 :2;
  287. UINT8 section_number :8;
  288. UINT8 last_section_number :8;
  289. }SI_TBLE_HDR, *PSI_TBLE_HDR;
  290. typedef struct _DSMCC_SSU_GROUP_COMP_DESC_SUBDESC_INFO_T
  291. {
  292. UINT8 subDesType;
  293. UINT8 subDesLength;
  294. //UINT8* additionallnformation;
  295. }DSMCC_SSU_GROUP_COMP_DESC_SUBDESC_INFO_T;
  296. //cong.xiao add 2010-12-08 +++
  297. typedef struct _DSMCC_SSU_GROUP_COMP_DESC_INFO_T
  298. {
  299. UINT8 descType;
  300. UINT8 descLen;
  301. UINT8 specifierType;
  302. UINT8 oui[3];
  303. UINT16 model;
  304. UINT16 version;
  305. UINT8 subDesCount;
  306. DSMCC_SSU_GROUP_COMP_DESC_SUBDESC_INFO_T* pSubDesc;
  307. }DSMCC_SSU_GROUP_COMP_DESC_INFO_T;
  308. typedef struct _DSMCC_SSU_GROUP_COMP_DESC_T
  309. {
  310. UINT16 compaLen;
  311. UINT16 descCount;
  312. DSMCC_SSU_GROUP_COMP_DESC_INFO_T* pDesc;
  313. } DSMCC_SSU_GROUP_COMP_DESC_T;
  314. //cong.xiao add 2010-12-08 ---
  315. typedef struct _DSMCC_MSG_HEADER_T
  316. {
  317. UINT8 protocolDiscr;
  318. UINT8 DsmccType;
  319. UINT16 MsgID;
  320. UINT32 transaction_id;
  321. UINT8 Reserved;
  322. UINT8 adapLen;
  323. UINT16 msgLen;
  324. UINT8 *pDsmccAdapHeader;
  325. } DSMCC_MSG_HEADER_T;
  326. typedef struct _DSMCC_SSU_GROUP_T
  327. {
  328. UINT32 groupId;
  329. UINT32 groupSize;
  330. DSMCC_SSU_GROUP_COMP_DESC_T *pComp;
  331. UINT16 groupInfoLen;
  332. UINT8 *pGroupInfoByte;
  333. UINT16 privateDataLen;
  334. UINT8 *pPrivateDataByte;
  335. } DSMCC_SSU_GROUP_T;
  336. #define MAX_COMPONENT_A_PMT (20) /*compoent tag. the stream identifier descriptor() in the ES_info_loop of the PMT */
  337. typedef struct _SSU_location_tag{
  338. UINT8 tag; /*compoent tag. the stream identifier descriptor() in the ES_info_loop of the PMT*/
  339. UINT16 elementaryPid; /*the location of this component tag */
  340. }SSU_location_tag_t;
  341. #ifdef CONFIG_SUPPORT_SSU_ENHANCE_UPGRADE
  342. typedef struct _SSU_UNT_T
  343. {
  344. SSU_location_tag_t component[MAX_COMPONENT_A_PMT];/*compoent tag. the stream identifier descriptor() in the ES_info_loop of the PMT*/
  345. UINT8 action_Type;
  346. UINT8 OUI[3];
  347. UINT8 version_num;
  348. UINT8 processing_order;
  349. UINT16 common_descriptor_Len;
  350. UINT8* pCommon_descriptor_info;
  351. DSMCC_SSU_GROUP_COMP_DESC_T *pCompDesc;
  352. UINT16 platfrom_loop_length;
  353. UINT16 target_decriptor_loop_length;
  354. UINT8 *pTarget_decriptor_info;
  355. UINT16 operational_descriptor_loop;
  356. UINT8 *pOperational_descriptor_info;
  357. }SSU_UNT_T;
  358. #endif
  359. typedef struct _SSU_DSI_T
  360. {
  361. UINT32 u32Len;
  362. UINT8 version_num;
  363. DSMCC_MSG_HEADER_T *pDsmccHeader;
  364. UINT8 serverId[20];
  365. UINT16 compDescLen;
  366. UINT16 privateDataLen;
  367. UINT16 numberOfGroups;
  368. DSMCC_SSU_GROUP_T *pGroup;
  369. } SSU_DSI_T;
  370. typedef struct _SSU_DDB_T
  371. {
  372. DSMCC_MSG_HEADER_T *pDsmccHeader;
  373. UINT16 moduleid;
  374. UINT8 moduleVersion;
  375. UINT8 Reserved;
  376. UINT16 blockNum;
  377. UINT8* pPayload;
  378. }SSU_DDB_T;
  379. #ifdef DVB_OAD_AUTO_DETECT
  380. /************ OAD DSI ************************/
  381. typedef struct _DSMCC_OAD_BIOP_COMPONENT_DATA_T
  382. {
  383. UINT32 carousel_id;
  384. UINT16 module_id;
  385. UINT8 major_id;
  386. UINT8 minor_ver;
  387. UINT8 objectKey_len;
  388. UINT8* pObjectKey_data;
  389. }DSMCC_OAD_BIOP_COMPONENT_DATA_T;
  390. typedef struct _DSMCC_OAD_BIOP_CONNBINDER_T
  391. {
  392. UINT32 component_tag;
  393. UINT8 component_data_len;
  394. UINT8 taps_counts;
  395. UINT16 tap_id;
  396. UINT8 tap_use;
  397. UINT8 association_tag;
  398. UINT8 selector_type;
  399. UINT32 translation_id;
  400. UINT32 time_out;
  401. }DSMCC_OAD_BIOP_CONNBINDER_T;
  402. typedef struct _DSMCC_OAD_BIOP_LOCATION_OBJ_T
  403. {
  404. UINT32 component_tag;
  405. UINT8 component_data_len;
  406. DSMCC_OAD_BIOP_COMPONENT_DATA_T pComponent_data;
  407. }DSMCC_OAD_BIOP_LOCATION_OBJ_T;
  408. typedef struct _DSMCC_OAD_BIOP_PROTOCOL_PROFILE_T
  409. {
  410. UINT32 profileId_tag;
  411. UINT32 profile_data_len;
  412. UINT8 byte_order;
  413. UINT8 component_count;
  414. DSMCC_OAD_BIOP_LOCATION_OBJ_T* location_obj;
  415. DSMCC_OAD_BIOP_CONNBINDER_T* component_data;
  416. } DSMCC_OAD_BIOP_PROTOCOL_PROFILE_T;
  417. typedef struct _DSMCC_OAD_DOWNLOAD_SLOT_T
  418. {
  419. UINT32 slot_start_time;
  420. UINT32 slot_duration;
  421. UINT8 estimate_download_time;
  422. }DSMCC_OAD_DOWNLOAD_SLOT_T;
  423. typedef struct _DSMCC_OAD_PRIORITY_T
  424. {
  425. UINT8 download_priority;
  426. }DSMCC_OAD_PRIORITY_T;
  427. typedef struct _DSMCC_OAD_USERINFO_T
  428. {
  429. UINT8* pUser_information;
  430. }DSMCC_OAD_USERINFO_T;
  431. typedef struct _DSMCC_OAD_MIS_T
  432. {
  433. UINT8 manufacturer_info_tag;
  434. UINT16 manufacturer_info_len;
  435. UINT8 OUI[3];
  436. UINT32 version_id;
  437. UINT8 desc_tag;
  438. UINT8 desc_len;
  439. union{
  440. DSMCC_OAD_DOWNLOAD_SLOT_T download_slot;
  441. DSMCC_OAD_PRIORITY_T priority;
  442. DSMCC_OAD_USERINFO_T userinfo;
  443. }MIS_INFO;
  444. }DSMCC_OAD_MIS_T;
  445. typedef struct _DSMCC_OAD_SERVICE_INFO
  446. {
  447. UINT32 type_id_length;
  448. UINT8 type_id[4];
  449. UINT32 taggedProfiles_count;
  450. DSMCC_OAD_BIOP_PROTOCOL_PROFILE_T* profile_data;
  451. UINT8 downloadTaps_count;
  452. UINT8 serviceContext_count;
  453. UINT16 userInfo_len;
  454. DSMCC_OAD_MIS_T* pUserinfo_data;
  455. } DSMCC_OAD_SERVICE_INFO;
  456. typedef struct _OAD_DSI_T
  457. {
  458. DSMCC_MSG_HEADER_T *pDsmccHeader;
  459. UINT8 serverId[20];
  460. UINT16 compDescLen;
  461. UINT16 privateDataLen;
  462. DSMCC_OAD_SERVICE_INFO* pService_info;
  463. }OAD_DSI_T;
  464. typedef struct _OAD_SCTL_COUNT_T
  465. {
  466. UINT32 context_id;
  467. UINT16 context_data_len;
  468. UINT8* pContext_data_byte;
  469. }OAD_SCTL_COUNT_T;
  470. typedef struct _OAD_FILE_T
  471. {
  472. UINT8 Magic[4];
  473. UINT8 Magic_version;
  474. UINT8 Minor_version;
  475. UINT8 Byte_order;
  476. UINT8 Messige_type;
  477. UINT32 Messige_size;
  478. UINT8 Object_key_len;
  479. UINT8* pObject_key;
  480. UINT32 Object_kind_len;
  481. UINT8 Object_kind_data[4];
  482. UINT16 Object_info_len;
  483. UINT64 DSM_File_ContentSize;
  484. UINT8* pObject_data_byte;
  485. UINT8 ServiceContextList_count;
  486. OAD_SCTL_COUNT_T* pSCTL_count;
  487. UINT32 MessageBody_length;
  488. UINT32 Content_len;
  489. }OAD_FILE_T;
  490. typedef struct _OAD_DDB_T
  491. {
  492. DSMCC_MSG_HEADER_T *pDsmccHeader;
  493. UINT16 moduleid;
  494. UINT8 moduleVersion;
  495. UINT8 Reserved;
  496. UINT16 blockNum;
  497. OAD_FILE_T* pFile_data;
  498. UINT8* pPayload;
  499. }OAD_DDB_T;
  500. #endif
  501. typedef struct
  502. {
  503. UINT16 number;
  504. UINT16 len;
  505. UINT8 *pData;
  506. }sFILE_SEGM_LINK;
  507. #endif
  508. // ================ CAT related ======================= //
  509. #define CAT_LEN 8
  510. /**
  511. * \brief CAT structure
  512. */
  513. typedef struct _mid_siutil_cat_t
  514. {
  515. UINT8 table_id :8; /**<\brief 0x01 */
  516. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  517. UINT8 :2;
  518. UINT8 dummy :1; /**<\brief has to be 0 */
  519. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  520. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  521. UINT8 :8;
  522. UINT8 :8;
  523. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  524. UINT8 version_number :5; /**<\brief version_number */
  525. UINT8 :2;
  526. UINT8 section_number :8; /**<\brief section_number */
  527. UINT8 last_section_number :8; /**<\brief last_section_number*/
  528. }MID_SiutilCat_t, *LP_MID_SiutilCat_t;
  529. #define CAT_DESC_LEN 2
  530. /**
  531. * \brief CAT descriptor structure
  532. */
  533. typedef struct _mid_siutil_cat_descr_t
  534. {
  535. UINT8 desc_tag; /**<\brief descriptor tag */
  536. UINT8 descLen; /**<\brief descriptor length */
  537. UINT8 ca_system_id_hi; /**<\brief ca_system_id high bit */
  538. UINT8 ca_system_id_lo; /**<\brief ca_system_id low bit */
  539. UINT8 ca_pid_hi; /**<\brief ca_pid high bit */
  540. UINT8 ca_pid_lo; /**<\brief ca_pid low bit */
  541. UINT8 *p_data;
  542. }MID_SiutilCatDescr_t, *LP_MID_SiutilCatDescr_t;
  543. #if 0
  544. typedef struct _mid_siutil_cat_info_t
  545. {
  546. UINT8 version_number;
  547. MID_SiutilCatDescr_t *p_desc;
  548. }MID_SiutilCatInfo_t, *LP_MID_SiutilCatInfo_t;
  549. #else
  550. /**
  551. * \brief CAT info structure
  552. */
  553. typedef struct _mid_siutil_cat_info_t
  554. {
  555. INT16 length; /**<\brief length */
  556. UINT8 version_number; /**<\brief version_number */
  557. UINT8 *pContent;
  558. }MID_SiutilCatInfo_t, *LP_MID_SiutilCatInfo_t;
  559. #endif
  560. /* pat.c */
  561. /** \defgroup PAT
  562. * \ingroup Open_channels
  563. * @{ */
  564. /************************************************************************************/
  565. /**
  566. * \fn CHAN_INDEX MID_SIUTIL_OpenPAT(GL_Queue_t hChanEventQueueHdl)
  567. *
  568. * \param hChanEventQueueHdl : event queue handle
  569. *
  570. * \return index of channel handle which is mapped PAT
  571. *
  572. ************************************************************************************/
  573. CHAN_INDEX MID_SIUTIL_OpenPAT(GL_Queue_t hChanEventQueueHdl);
  574. /************************************************************************************/
  575. /**
  576. * \fn CHAN_INDEX MID_SIUTIL_OpenPATEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl)
  577. *
  578. * \param InputUnit : demux unit
  579. * \param hChanEventQueueHdl : event queue handle
  580. *
  581. * \return index of channel handle which is mapped PAT
  582. *
  583. ************************************************************************************/
  584. CHAN_INDEX MID_SIUTIL_OpenPATEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl);
  585. /************************************************************************************/
  586. /**
  587. * \fn void MID_SIUTIL_FreePAT(MID_SiutilPatInfo_t **ppPAT)
  588. *
  589. * \param ppPAT : pointer to MID_SiutilPatInfo_t which store information of PAT
  590. *
  591. * \return none
  592. *
  593. ************************************************************************************/
  594. void MID_SIUTIL_FreePAT(MID_SiutilPatInfo_t **ppPAT);
  595. /************************************************************************************/
  596. /**
  597. * \fn MID_SiutilPatInfo_t* MID_SIUTIL_ParsePAT(CHAN_INDEX chn_index)
  598. *
  599. * \param chn_index : index of channel handle which is mapped PAT
  600. *
  601. * \return the structure which store information of PAT
  602. *
  603. ************************************************************************************/
  604. MID_SiutilPatInfo_t* MID_SIUTIL_ParsePAT(CHAN_INDEX chn_index);
  605. /************************************************************************************/
  606. /**
  607. * \fn MID_SiutilPatInfo_t* MID_SIUTIL_ParsePATEx( CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit)
  608. *
  609. * \param chn_index : index of channel handle which is mapped PAT
  610. * \param InputUnit : primary or secondary demux
  611. *
  612. * \return the structure which store information of PAT
  613. *
  614. ************************************************************************************/
  615. MID_SiutilPatInfo_t* MID_SIUTIL_ParsePATEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit);
  616. /* @} end of defgroup PAT*/
  617. /* pmt.c */
  618. /** \defgroup PMT
  619. * \ingroup Open_channels
  620. * @{ */
  621. /************************************************************************************/
  622. /**
  623. * \fn CHAN_INDEX MID_SIUTIL_OpenPMT(GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  624. *
  625. * \param hChanEventQueueHdl : event queue handle
  626. * \param pid : the PMTID
  627. * \param program_id : program_number of this PMT
  628. *
  629. * \return index of channel handle which is mapped PMT
  630. *
  631. ************************************************************************************/
  632. CHAN_INDEX MID_SIUTIL_OpenPMT(GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id);
  633. /************************************************************************************/
  634. /**
  635. * \fn CHAN_INDEX MID_SIUTIL_OpenPMTEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  636. *
  637. * \param InputUnit : demux unit
  638. * \param hChanEventQueueHdl : event queue handle
  639. * \param pid : the PMTID
  640. * \param program_id : program_number of this PMT
  641. *
  642. * \return index of channel handle which is mapped PMT
  643. *
  644. ************************************************************************************/
  645. CHAN_INDEX MID_SIUTIL_OpenPMTEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id);
  646. /************************************************************************************/
  647. /**
  648. * \fn void MID_SIUTIL_FreePMT(MID_SiutilPmtInfo_t **ppPMT)
  649. *
  650. * \param ppPMT : pointer to MID_SiutilPmtInfo_t which store information of PMT
  651. *
  652. * \return none
  653. *
  654. ************************************************************************************/
  655. void MID_SIUTIL_FreePMT(MID_SiutilPmtInfo_t **ppPMT);
  656. /************************************************************************************/
  657. /**
  658. * \fn MID_SiutilPmtInfo_t* MID_SIUTIL_ParsePMT(CHAN_INDEX chn_index,
  659. * UINT16 pid,
  660. * UINT16 program_id,
  661. * UINT8 *p_info,
  662. * INT16 info_len,
  663. * UINT16 *p_comps,
  664. * INT16 compLen,
  665. * UINT8 *p_desc,
  666. * INT16 descLen)
  667. *
  668. * \param chn_index : index of channel handle which is mapped PMT
  669. * \param pid : the PMTID
  670. * \param program_id : program_number of this PMT
  671. * \param p_info : pointer to descriptor array
  672. * \param info_len : length of descriptor array
  673. * \param p_comps : pointer to components array
  674. * \param compLen : length of components array
  675. * \param p_desc : pointer to descriptor array
  676. * \param descLen : length of descriptor array
  677. *
  678. * \return the structure which store information of PMT
  679. *
  680. ************************************************************************************/
  681. MID_SiutilPmtInfo_t* MID_SIUTIL_ParsePMT(CHAN_INDEX chn_index,
  682. UINT16 pid,
  683. UINT16 program_id,
  684. UINT8 *p_info,
  685. INT16 info_len,
  686. UINT16 *p_comps,
  687. INT16 compLen,
  688. UINT8 *p_desc,
  689. INT16 descLen);
  690. /************************************************************************************/
  691. /**
  692. * \fn MID_SiutilPmtInfo_t* MID_SIUTIL_ParsePMTEx(CHAN_INDEX chn_index,
  693. * LIVE_INPUT_UNIT InputUnit,
  694. * UINT16 pid,
  695. * UINT16 program_id,
  696. * UINT8 *p_info,
  697. * INT16 info_len,
  698. * UINT16 *p_comps,
  699. * INT16 compLen,
  700. * UINT8 *p_desc,
  701. * INT16 descLen)
  702. *
  703. * \param chn_index : index of channel handle which is mapped PMT
  704. * \param InputUnit : primary or secondary demux
  705. * \param pid : the PMTID
  706. * \param program_id : program_number of this PMT
  707. * \param p_info : pointer to descriptor array
  708. * \param info_len : length of descriptor array
  709. * \param p_comps : pointer to components array
  710. * \param compLen : length of components array
  711. * \param p_desc : pointer to descriptor array
  712. * \param descLen : length of descriptor array
  713. *
  714. * \return the structure which store information of PMT
  715. *
  716. ************************************************************************************/
  717. MID_SiutilPmtInfo_t* MID_SIUTIL_ParsePMTEx( CHAN_INDEX chn_index,
  718. LIVE_INPUT_UNIT InputUnit,
  719. UINT16 pid,
  720. UINT16 program_id,
  721. UINT8 *p_info,
  722. INT16 info_len,
  723. UINT16 *p_comps,
  724. INT16 compLen,
  725. UINT8 *p_desc,
  726. INT16 descLen);
  727. /* @} end of defgroup PMT*/
  728. //#ifdef DVB_OTA_AUTO_DETECT//yc.guan 2010-04-15 add for SSU//cong.xiao 2010-06-24 modify for zBook
  729. #if defined(DVB_OTA_AUTO_DETECT) || defined(SUPPORT_OTA_UPGRADE_USERSET)
  730. /************************************************************************************/
  731. /**
  732. * \fn CHAN_INDEX MID_SIUTIL_OpenDSI(GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  733. *
  734. * \param hChanEventQueueHdl : event queue handle
  735. * \param pid : the DSI ID
  736. * \param program_id : program_number of this DSI
  737. *
  738. * \return index of channel handle which is mapped DSI
  739. *
  740. ************************************************************************************/
  741. CHAN_INDEX MID_SIUTIL_OpenDSI(GL_Queue_t hChanEventQueueHdl, UINT16 pid, INT16 program_id);
  742. /************************************************************************************/
  743. /**
  744. * \fn CHAN_INDEX MID_SIUTIL_OpenDSIEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  745. *
  746. * \param InputUnit : demux unit
  747. * \param hChanEventQueueHdl : event queue handle
  748. * \param pid : the DSI ID
  749. * \param program_id : program_number of this DSI
  750. *
  751. * \return index of channel handle which is mapped DSI
  752. *
  753. ************************************************************************************/
  754. CHAN_INDEX MID_SIUTIL_OpenDSIEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id);
  755. #ifdef CONFIG_SUPPORT_SSU_ENHANCE_UPGRADE
  756. CHAN_INDEX MID_SIUTIL_OpenUNT(GL_Queue_t hChanEventQueueHdl, UINT16 pid, INT16 program_id);
  757. void MID_SIUTIL_FreeSsuUnt(SSU_UNT_T **ppUnt);
  758. UINT8 MID_SsuUnt_ParseInfo(UINT8* pu8Info,UINT16 Len,UINT8 flag);
  759. SSU_UNT_T *ParseSsuUnt(CHAN_INDEX chn_index,UINT8 * p_untCommon, INT16 unt_commonLen,UINT8 * p_untTarget, INT16 unt_targetLen,UINT8 * p_untOperation, INT16 unt_operationLen);
  760. #endif
  761. //void MID_SIUTIL_FreeDSI(SSU_DSI_T* ppDSI);
  762. extern void MID_SIUTIL_FreeDSI(void **ppDSI);
  763. extern void MID_SIUTIL_FreeOADDSI(void** pDsi);
  764. extern void* ParseSsuDsi(CHAN_INDEX chn_index,UINT8* const u8ErrorType);//cong.xiao add for mantis bug id 0106976
  765. extern void *ParseOadDsi(CHAN_INDEX chn_index,UINT8* const u8ErrorType);//cong.xiao add for mantis bug id 0106976
  766. /************************************************************************************/
  767. /**
  768. * \fn CHAN_INDEX MID_SIUTIL_OpenDDB(GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  769. *
  770. * \param hChanEventQueueHdl : event queue handle
  771. * \param pid : the DDB ID
  772. * \param program_id : program_number of this DDB
  773. *
  774. * \return index of channel handle which is mapped DDB
  775. *
  776. ************************************************************************************/
  777. CHAN_INDEX MID_SIUTIL_OpenDDB(GL_Queue_t hChanEventQueueHdl, UINT16 pid, INT16 program_id);
  778. /************************************************************************************/
  779. /**
  780. * \fn CHAN_INDEX MID_SIUTIL_OpenDDBEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 program_id)
  781. *
  782. * \param InputUnit : demux unit
  783. * \param hChanEventQueueHdl : event queue handle
  784. * \param pid : the DDB ID
  785. * \param program_id : program_number of this DDB
  786. *
  787. * \return index of channel handle which is mapped DDB
  788. *
  789. ************************************************************************************/
  790. CHAN_INDEX MID_SIUTIL_OpenDDBEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 pid, INT16 program_id);
  791. //void MID_SIUTIL_FreeDSI(SSU_DSI_T* ppDSI);
  792. void MID_SIUTIL_FreeDDB(SSU_DDB_T **pddb);
  793. extern void MID_SIUTIL_FreeOADDDB(void* pDDB);
  794. void *ParseSsuDDB(UINT16 pid,UINT32 Diidownloadid,const sFILE_SEGM_LINK* pSeg, const UINT16 u16MaxFileSegNum);
  795. void *ParseSsuDDBEx(LIVE_INPUT_UNIT InputUnit, UINT16 pid,UINT32 Diidownloadid,const sFILE_SEGM_LINK* pSeg,const UINT16 u16MaxFileSegNum);
  796. extern void* ParseOadDDB(UINT16 pid,UINT16 module_id, UINT32* u32BIOP_len,const sFILE_SEGM_LINK* pSeg,const UINT16 u16MaxFileSegNum);
  797. extern void* ParseOadDDBEx(LIVE_INPUT_UNIT InputUnit, UINT16 pid,UINT16 module_id, UINT32* u32BIOP_len,const sFILE_SEGM_LINK* pSeg,const UINT16 u16MaxFileSegNum);
  798. #endif
  799. /* cat.c */
  800. /** \defgroup CAT
  801. * \ingroup Open_channels
  802. * @{ */
  803. /************************************************************************************/
  804. /**
  805. * \fn CHAN_INDEX MID_SIUTIL_OpenCAT(GL_Queue_t hChanEventQueueHdl)
  806. *
  807. * \param hChanEventQueueHdl : event queue handle
  808. *
  809. * \return index of channel handle which is mapped CAT
  810. *
  811. ************************************************************************************/
  812. CHAN_INDEX MID_SIUTIL_OpenCAT(GL_Queue_t hChanEventQueueHdl);
  813. /************************************************************************************/
  814. /**
  815. * \fn CHAN_INDEX MID_SIUTIL_OpenCATEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl)
  816. *
  817. * \param InputUnit : demux unit
  818. * \param hChanEventQueueHdl : event queue handle
  819. *
  820. * \return index of channel handle which is mapped CAT
  821. *
  822. ************************************************************************************/
  823. CHAN_INDEX MID_SIUTIL_OpenCATEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl);
  824. /************************************************************************************/
  825. /**
  826. * \fn void MID_SIUTIL_FreeCAT(MID_SiutilCatInfo_t **ppCAT)
  827. *
  828. * \param ppCAT : pointer to MID_SiutilCatInfo_t which store information of CAT
  829. *
  830. * \return none
  831. *
  832. ************************************************************************************/
  833. void MID_SIUTIL_FreeCAT(MID_SiutilCatInfo_t **ppCAT);
  834. /************************************************************************************/
  835. /**
  836. * \fn MID_SiutilCatInfo_t* MID_SIUTIL_ParseCAT(CHAN_INDEX chn_index)
  837. *
  838. * \param chn_index : index of channel handle which is mapped CAT
  839. *
  840. * \return the structure which store information of CAT
  841. *
  842. ************************************************************************************/
  843. MID_SiutilCatInfo_t* MID_SIUTIL_ParseCAT(CHAN_INDEX chn_index);
  844. /************************************************************************************/
  845. /**
  846. * \fn MID_SiutilCatInfo_t* MID_SIUTIL_ParseCAT(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit)
  847. *
  848. * \param chn_index : index of channel handle which is mapped CAT
  849. * \param InputUnit : primary or secondary demux
  850. *
  851. * \return the structure which store information of CAT
  852. *
  853. ************************************************************************************/
  854. MID_SiutilCatInfo_t* MID_SIUTIL_ParseCATEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit);
  855. /* @} end of defgroup CAT*/
  856. #endif /* #ifndef _MID_SIUTIL_13818_H */