mid_siutil_dvb.h 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364
  1. /******************************************************************************/
  2. /**
  3. * \file mid_siutil_dvb.h
  4. *
  5. * \brief header for dvb SI
  6. *
  7. * \note Copyright (C) 2006 SunMedia Co, chengdu \n
  8. * Author anlzhao@sunmedia.com.cn \n
  9. * The source code in this file is written by anlzhao referring to \n
  10. * ETSI EN 300 468 and owned by SunMedia Coporation. The header defines all \n
  11. * the macro and common struct. You should include it in all file.
  12. *
  13. * \author Unknow
  14. *
  15. *
  16. ******************************************************************************/
  17. #ifndef _MID_SIUTIL_DVB_H
  18. #define _MID_SIUTIL_DVB_H
  19. #include <string.h>
  20. #include <types.h>
  21. //#include "drivers/drv_demux.h"
  22. #include "mid_common.h"
  23. #include "mid_siutil.h" //[kiwi 20090213]
  24. #define INVALID_ORGNETID 0xffff
  25. #define INVALID_TSID 0xffff
  26. /* Packet Identifier Value */
  27. #define PID_NIT 0x0010 /**<\brief PID of Network Information Table */
  28. #define PID_SDT 0x0011 /**<\brief PID of Service Description Table */
  29. #define PID_BAT 0x0011 /**<\brief PID of Bouquet Association Table */
  30. #define PID_EIT 0x0012 /**<\brief PID of Event Information Table */
  31. #define PID_RST 0x0013 /**<\brief PID of Running Status Table */
  32. #define PID_TDT 0x0014 /**<\brief PID of Time and Date Table */
  33. #define PID_TOT 0x0014 /**<\brief PID of Time Offset Table */
  34. #define PID_DIT 0x001E /**<\brief PID of Discontinuity Information Table*/
  35. #define PID_SIT 0x001F /**<\brief PID of Selection Information Table*/
  36. /* Table Identifier Value */
  37. /* 0x04 ~ 0x3F is reserved */
  38. #define TABLE_ID_NIT_ACT 0x40 /**<\brief table_id of actual Network Information Section*/
  39. #define TABLE_ID_NIT_OTH 0x41 /**<\brief table_id of other Network Information Section*/
  40. #define TABLE_ID_SDT_ACT 0x42 /**<\brief table_id of Service Description Section actual*/
  41. /* 0x43 ~ 0x45 is reserved */
  42. #define TABLE_ID_SDT_OTH 0x46 /**<\brief table_id of Service Description Section other*/
  43. /* 0x47 ~ 0x49 is reserved */
  44. #define TABLE_ID_BAT 0x4A /**<\brief table_id of Bouquet Association Section */
  45. /* 0x4B ~ 0x4D is reserved */
  46. #define TABLE_ID_EIT_ACT 0x4E /**<\brief table_id of Event Information Section actual, present/following */
  47. #define TABLE_ID_EIT_OTH 0x4F /**<\brief table_id of Event Information Section other, present/following */
  48. #define TABLE_ID_EIT_ACT_SCH_FIRSR 0x50 /**<\brief table_id of Event Information Section actual schedule */
  49. #define TABLE_ID_EIT_ACT_SCH_LAST 0x5F /**<\brief table_id of Event Information Section actual schedule */
  50. #define TABLE_ID_EIT_OTH_SCH_FIRST 0x60 /**<\brief table_id of Event Information Section other schedule */
  51. #define TABLE_ID_EIT_OTH_SCH_LAST 0x6F /**<\brief table_id of Event Information Section other schedule */
  52. #define TABLE_ID_TDT 0x70 /**<\brief table_id of Time adn Date Section */
  53. #define TABLE_ID_RST 0x71 /**<\brief table_id of Running Status Section*/
  54. #define TABLE_ID_TOT 0x73 /**<\brief table_id of Time Offset Section */
  55. #ifdef CONFIG_SUPPORT_HBBTV
  56. #define TABLE_ID_AIT 0x74 /**<\brief table_id of Application Information Section */
  57. #endif
  58. #ifdef SUPPORT_ASTRA_LCN
  59. #define TABLE_ID_SGT 0x91 /**<\brief table_id of service guide Section */
  60. #endif
  61. /* 0x80 ~ 0xFE,User defined;0xFF Reserved */
  62. #ifdef CONFIG_SUPPORT_FAST_SCANNING
  63. #define TABLE_ID_FNT 0xBC /**<\brief table_id of Fast Scan Network Table */
  64. #define TABLE_ID_FST 0xBD /**<\brief table_id of Fast Scan Service Table */
  65. #endif
  66. /*
  67. * Descriptor Tag Value of SSU UNT descriptors
  68. * defined by ETSI TS 102 006 V1.3.1 Table 19
  69. * begin
  70. */
  71. #define DESCR_SCHEDULING 0x01 /**<\brief descriptor_tag of scheduling_descriptor*/
  72. #define DESCR_UPDATE 0x02 /**<\brief descriptor_tag of update_descriptor*/
  73. #define DESCR_SSU_LOCATION 0x03 /**<\brief descriptor_tag of ssu_location_descriptor*/
  74. #define DESCR_MESSAGE 0x04 /**<\brief descriptor_tag of message_descriptor*/
  75. #define DESCR_SSU_EVENT_NAME 0x05 /**<\brief descriptor_tag of ssu_event_name_descriptor*/
  76. #define DESCR_TARGET_SMARTCARD 0x06 /**<\brief descriptor_tag of target_smartcard_descriptor*/
  77. #define DESCR_TARGET_MAC_ADD 0x07 /**<\brief descriptor_tag of target_MAC_descriptor*/
  78. #define DESCR_TARGET_SERIAL_NUM 0x08 /**<\brief descriptor_tag of target_serial_number_descriptor*/
  79. #define DESCR_TARGET_IP_ADD 0x09 /**<\brief descriptor_tag of target_IP_address_descriptor*/
  80. #define DESCR_TARGET_IPV6_ADD 0x0A /**<\brief descriptor_tag of target_IPv6_descriptor*/
  81. #define DESCR_SSU_SUBGROUP 0x0B /**<\brief descriptor_tag of ssu_subgroup_association_descriptor*/
  82. /*
  83. * reverver 0x00
  84. * reserved for future SSU use 0x0c to 0x3f
  85. * in the scope of DVB SI 0x40 to 0x7f
  86. * telephone_descriptor 0x57
  87. * private_data_specifier_descriptor 0x5f
  88. * user private 0x80 to 0xfe
  89. * reverved 0xff
  90. * end
  91. */
  92. /*
  93. * Descriptor Tag Value
  94. * defined by ETSI EN 300 468 Table 12
  95. */
  96. #define DESCR_NW_NAME 0x40 /**<\brief tag of network_name_descriptor */
  97. #define DESCR_SERVICE_LIST 0x41 /**<\brief tag of service_list_descriptor */
  98. #define DESCR_STUFFING 0x42 /**<\brief tag of stuffing_descriptor */
  99. #define DESCR_SAT_DEL_SYS 0x43 /**<\brief tag of satellite_delivery_system_descriptor*/
  100. #define DESCR_CABLE_DEL_SYS 0x44 /**<\brief tag of cable_delivery_system_descriptor*/
  101. #define DESCR_VBI_DATA 0x45 /**<\brief tag of VBI_data_descriptor*/
  102. #define DESCR_VBI_TELETEXT 0x46 /**<\brief tag of VBI_teletext_descriptor*/
  103. #define DESCR_BOUQUET_NAME 0x47 /**<\brief tag of bouquet_name_descriptor*/
  104. #define DESCR_SERVICE 0x48 /**<\brief tag of service_descriptor*/
  105. #define DESCR_COUNTRY_AVAIL 0x49 /**<\brief tag of country_availability_descriptor*/
  106. #define DESCR_LINKAGE 0x4A /**<\brief tag of linkage_descriptor*/
  107. #define DESCR_NVOD_REF 0x4B /**<\brief tag of NVOD_reference_descriptor*/
  108. #define DESCR_TIME_SHIFTED_SERVICE 0x4C /**<\brief tag of time_shifted_service_descriptor*/
  109. #define DESCR_SHORT_EVENT 0x4D /**<\brief tag of short_event_descriptor*/
  110. #define DESCR_EXTENDED_EVENT 0x4E /**<\brief tag of extended_event_descriptor*/
  111. #define DESCR_TIME_SHIFTED_EVENT 0x4F /**<\brief tag of time_shifted_event_descriptor*/
  112. #define DESCR_COMPONENT 0x50 /**<\brief tag of component_descriptor*/
  113. #define DESCR_MOSAIC 0x51 /**<\brief tag of mosaic_descriptor*/
  114. #define DESCR_STREAM_ID 0x52 /**<\brief tag of stream_identifier_descriptor*/
  115. #define DESCR_CA_IDENT 0x53 /**<\brief tag of CA_identifier_descriptor*/
  116. #define DESCR_CONTENT 0x54 /**<\brief tag of content_descriptor*/
  117. #define DESCR_PARENTAL_RATING 0x55 /**<\brief tag of parental_rating_descriptor*/
  118. #define DESCR_TELETEXT 0x56 /**<\brief tag of teletext_descriptor*/
  119. #define DESCR_TELEPHONE 0x57 /**<\brief tag of telephone_descriptor*/
  120. #define DESCR_LOCAL_TIME_OFF 0x58 /**<\brief tag of local_time_offset_descriptor*/
  121. #define DESCR_SUBTITLING 0x59 /**<\brief tag of subtitling_descriptor*/
  122. #define DESCR_TERR_DEL_SYS 0x5A /**<\brief tag of terrestrial_delivery_system_descriptor */
  123. #define DESCR_ML_NW_NAME 0x5B /**<\brief tag of multilingual_network_name_descriptor*/
  124. #define DESCR_ML_BQ_NAME 0x5C /**<\brief tag of multilingual_bouquet_name_descriptor*/
  125. #define DESCR_ML_SERVICE_NAME 0x5D /**<\brief tag of multilingual_service_name_descriptor*/
  126. #define DESCR_ML_COMPONENT 0x5E /**<\brief tag of multilingual_component_descriptor*/
  127. #define DESCR_PRIV_DATA_SPEC 0x5F /**<\brief tag of private_data_specifier_descriptor*/
  128. #define DESCR_SERVICE_MOVE 0x60 /**<\brief tag of service_move_descriptor*/
  129. #define DESCR_SHORT_SMOOTH_BUF 0x61 /**<\brief tag of short_smoothing_buffer_descriptor*/
  130. #define DESCR_FREQUENCY_LIST 0x62 /**<\brief tag of frequency_list_descriptor*/
  131. #define DESCR_PARTIAL_TP_STREAM 0x63 /**<\brief tag of partial_transport_stream_descriptor (Only found in Partial Transport Streams)*/
  132. #define DESCR_DATA_BROADCAST 0x64 /**<\brief tag of data_broadcast_descriptor*/
  133. #define DESCR_CA_SYSTEM 0x65 /**<\brief tag of scrambling_descriptor*/
  134. #define DESCR_DATA_BROADCAST_ID 0x66 /**<\brief tag of data_broadcast_id_descriptor*/
  135. #define DESCR_TRANSPORT_STREAM 0x67 /**<\brief tag of transport_stream_descriptor (Only in the TSDT (Transport Streams Description Table))*/
  136. #define DESCR_DSNG 0x68 /**<\brief tag of DSNG_descriptor (Only in the TSDT (Transport Streams Description Table))*/
  137. #define DESCR_PDC 0x69 /**<\brief tag of PDC_descriptor*/
  138. #define DESCR_AC3 0x6A /**<\brief tag of AC-3_descriptor*/
  139. #define DESCR_ANCILLARY_DATA 0x6B /**<\brief tag of ancillary_data_descriptor*/
  140. #define DESCR_CELL_LIST 0x6C /**<\brief tag of cell_list_descriptor*/
  141. #define DESCR_CELL_FREQ_LINK 0x6D /**<\brief tag of cell_frequency_link_descriptor*/
  142. #define DESCR_ANNOUNCEMENT_SUPPORT 0x6E /**<\brief tag of announcement_support_descriptor*/
  143. #define DESCR_APPLICATION_SIGNALLING 0x6F /**<\brief tag of application_signalling_descriptor*/
  144. #define DESCR_APPLICATION_FIELD_DATA 0x70 /**<\brief tag of adaptation_field_data_descriptor*/
  145. #define DESCR_SERVICEIDENTIFIER 0x71 /**<\brief tag of service_identifier_descriptor*/
  146. #define DESCR_SERVICE_AVAILABILITY 0x72 /**<\brief tag of service_availability_descriptor*/
  147. #define DESCR_DEFAULT_AUTHORITY 0x73 /**<\brief tag of default_authority_descriptor*/
  148. #define DESCR_CONTENT_IDENTIFIER 0x76 /**<\brief tag of content_identifier_descriptor*/
  149. #define DESCR_EAC3 0x7A /**<\brief tag of enhanced_AC-3_descriptor*/
  150. #define DESCR_AAC 0x7C /**<\brief tag of AAC_descriptor*/
  151. #define DESCR_FTA_CONTENT_MGR 0x7E /**<\brief tag of FTA_content_management_descriptor*/
  152. #define DESCR_EXTENSION 0x7F /**<\brief tag of extension_descriptor*/
  153. #define TABLE_ID_EWS 0x80 /**<\brief table_id of Indonesia EWS Table */
  154. #define PID_EWS 0x038F /**<\brief PID of Indonesia EWS Table*/
  155. #if defined(DVB_C)
  156. #define DESCR_BAT_LCN 0x82
  157. #define DESCR_VOLUME_COMPENSATING 0x83
  158. #endif
  159. #define DESCR_LCN 0x83 /**<\brief tag of LCN_descriptor */
  160. #define DESCR_LCN_B0 0xB0 /**<\brief tag of LCN_descriptor with 0xB0 */
  161. #define DESCR_LCN_V2 0x87 /**<\brief tag of LCN_Version 2_descriptor */
  162. #define DESCR_LCN_9C 0x9C /**<\brief tag of LCN_descriptor for KDG */
  163. #define DESCR_HD_SIMULCAST_LCN 0x88 /**<\brief tag of HD_simulcast_LCN_descriptor */
  164. #define DESCR_PREFERRED_NAME_LIST 0x84 /**<\brief tag of preffered_name_list_descriptor */
  165. #define DESCR_PREFERRED_NAME_IDENTIFIER 0x85 /**<\brief tag of preffered_name_identifier_descriptor */
  166. #define DESCR_SERVICE_ATTRIBUTE 0x86 /**<\brief tag of service_attribute_descriptor */
  167. #define DESCR_SERVICE_LIST_NAME 0x88 /**<\brief tag of service_list_name_descriptor */
  168. #define DESCR_BOUQUET_LIST 0x93 /**<\brief tag of bouquet_list_descriptor */
  169. #define DESCR_VIRTUAL_SERVICE_ID 0xD1 /**<\brief tag of virtual_service_id_descriptor */
  170. #ifdef CONFIG_DTMB_SYSTEM
  171. #define DESCR_DRA_REGISTRATION 0x05 /**<\brief tag of DRA_Registration_Descriptor */
  172. #define DESCR_DRA_AUDIO_STREAM 0xA0 /**<\brief tag of DRA_audio_stream_descriptor */
  173. #else
  174. #define DESCR_CONTENT_PROTECTION 0xA0 /**<\brief tag of content_protection_descriptor for Nordig */
  175. #endif
  176. #define DESCR_TFCAS 0xA1
  177. #define DESCR_CI_PROTECTION_DESC 0xCE /**<\brief tag of CI Protection descriptor */
  178. #define DESCR_PARTIAL_RECEPTION 0xFB
  179. #ifdef CONFIG_ISDB_SYSTEM
  180. #define DESCR_TS_INFORMATION 0xCD
  181. #define DESCR_LOGO_TRANSMISSION 0xCF /**<\brief tag of logo transmission descriptor */
  182. #define DESCR_DIGITAL_COPY_CTR 0xC1 /**<\brief tag of Digital copy control descriptor */
  183. #define DESCR_CONTENT_AVAILABILITY 0xDE /**<\brief tag of Content availability descriptor */
  184. #ifdef SUPPORT_PREFER_ADDIO_DESC//2010/06/09 yhong 0090319 Desc prefer audio.
  185. #define DESCR_AUDIO_COMPONENT 0xC4 /**<\brief tag of Content availability descriptor */
  186. #endif
  187. #endif
  188. /*
  189. * Extension Descriptor Tag Value
  190. * defined by ETSI EN 300 468 Table 101
  191. */
  192. #define DESCR_EXT_TARGET_REGION 0x09 /**<\brief extension tag of tartget region descriptor */
  193. #define DESCR_EXT_TARGET_REGION_NAME 0x0A /**<\brief extension tag of tartget region name descriptor */
  194. #define DESCR_EXT_T2SYSTEM 0X04 /**<\brief extension tag of T2_delivery_system_descriptor */
  195. /* Max section size */
  196. #define MAX_SECTION_SIZE_NIT 1024 /**<\brief max size of NIT section */
  197. #define MAX_SECTION_SIZE_BAT 1024 /**<\brief max size of BAT section */
  198. #define MAX_SECTION_SIZE_EIT 4096 /**<\brief max size of EIT section */
  199. #define MAX_SECTION_SIZE_SDT 1024 /**<\brief max size of SDT section */
  200. #define MAX_SECTION_SIZE_TDT 8 /**<\brief max size of TDTsection */
  201. #define MAX_SECTION_SIZE_TOT 1024 /**<\brief max size of TOTsection */
  202. // service type coding defined in Service descriptor(0x48)
  203. #define SERVICE_RESERVED_FOR_FUTURE 0x00 /**<\brief service type of RESERVED_FOR_FUTURE*/
  204. #define SERVICE_DIGITAL_TELEVISION 0x01/**<\brief service type of DIGITAL_TELEVISION */
  205. #define SERVICE_DIGITAL_RADIO 0x02 /**<\brief service type of DIGITAL_RADIO*/
  206. #define SERVICE_TELETEXT 0x03 /**<\brief service type of TELETEXT*/
  207. #define SERVICE_NVOD_REFERENCE 0x04 /**<\brief service type of NVOD_REFERENCE*/
  208. #define SERVICE_NVOD_TIMESHIFT 0x05 /**<\brief service type of NVOD_TIMESHIFT*/
  209. #define SERVICE_MOSAIC 0x06 /**<\brief service type of MOSAIC*/
  210. #define SERVICE_PAL_CODED_SIGNAL 0x07 /**<\brief service type of PAL_CODED_SIGNAL*/
  211. #define SERVICE_SECAM_CODED_SIGNAL 0x08 /**<\brief service type of SECAM_CODED_SIGNAL*/
  212. #define SERVICE_D_D2_MAC 0x09 /**<\brief service type of D_D2_MAC*/
  213. #define SERVICE_ADVANCED_DIGITAL_RADIO 0x0A /**<\brief service type of ADVANCED_DIGITAL_RADIO*/
  214. #define SERVICE_NTSC_CODED_SIGNAL 0x0B /**<\brief service type of NTSC_CODED_SIGNAL*/
  215. #define SERVICE_DATABROADCAST 0x0C /**<\brief service type of DATABROADCAST*/
  216. #define SERVICE_COMMON_INTERFACE 0x0D /**<\brief service type of COMMON_INTERFACE*/
  217. #define SERVICE_RCS_MAP 0x0E /**<\brief service type of RCS_MAP*/
  218. #define SERVICE_RCS_FLS 0x0F /**<\brief service type of RCS_FLS*/
  219. #define SERVICE_DVB_MHP 0x10 /**<\brief service type of DVB_MHP*/
  220. #define SERVICE_MPEG2_HD_DIGITAL_TELEVISION 0x11 /**<\brief service type of MPEG2_HD_DIGITAL_TELEVISION*/
  221. #define SERVICE_ADVANCED_SD_DIGITAL_TV 0x16 /**<\brief service type of ADVANCED_SD_DIGITAL_TV*/
  222. #define SERVICE_ADVANCED_HD_DIGITAL_TV 0x19 /**<\brief service type ofn ADVANCED_HD_DIGITAL_TV*/
  223. #define SERVICE_ADVANCED_HD_NVOD_TIMESHIFT 0x1A /**<\brief service type of ADVANCED_HD_NVOD_TIMESHIFT*/
  224. #define SERVICE_ADVANCED_HD_NVOD_REFERENCE 0x1B /**<\brief service type of ADVANCED_HD_NVOD_REFERENCE*/
  225. #define SERVICE_HEVC 0x1F /**<\brief service type of HEVC*/
  226. //BRAD : we use only 6-bits to presernt service_type in SDT
  227. #define SERVICE_MAX_VALUE_FOR_6BIT 0x3D/**<\brief service type of MAX_VALUE_FOR_6BIT*/
  228. //BRAD : Used to indicate that SDT does not include this service
  229. #define SERVICE_NOT_IN_SDT 0x3E /**<\brief service type of NOT_IN_SDT*/
  230. //BRAD : Used to indicate that there is no SDT in current channel
  231. #define SERVICE_NO_SDT 0x3F/**<\brief service type of NO_SDT*/
  232. #define SERVICE_USEER_DEFINE 0xd3 /**<\brief service type of user define*/
  233. /**
  234. * zhongbaoxing added the following service types according to ABNTNBR 15603-2 begin
  235. */
  236. #define SERVICE_SPECIAL_VIDEO 0xA1/**<\brief service type of SPECIAL_VIDEO*/
  237. #define SERVICE_SPECIAL_AUDIO 0xA2/**<\brief service type of SPECIAL_AUDIO*/
  238. #define SERVICE_SPECIAL_DATA 0xA3/**<\brief service type of SPECIAL_DATA*/
  239. #define SERVICE_ENGINEERING 0xA4/**<\brief service type of ENGINEERING, such as software upgrade*/
  240. #define SERVICE_PROMOTIONAL_VIDEO 0xA5/**<\brief service type of PROMOTIONAL_VIDEO*/
  241. #define SERVICE_PROMOTIONAL_AUDIO 0xA6/**<\brief service type of PROMOTIONAL_AUDIO*/
  242. #define SERVICE_PROMOTIONAL_DATA 0xA7/**<\brief service type of PROMOTIONAL_DATA*/
  243. #define SERVICE_DATA_FOR_ANTICIPATED_STORAGE 0xA8/**<\brief service type of DATA_FOR_ANTICIPATED_STORAGE*/
  244. #define SERVICE_EXCLUSIVE_DATA_FOR_STORAGE 0xA9/**<\brief service type of EXCLUSIVE_DATA_FOR_STORAGE*/
  245. #define SERVICE_BOOKMARK_SERVICE_LIST 0xAA/**<\brief service type of BOOKMARK_SERVICE_LIST*/
  246. #define SERVICE_SIMULTANEOUS_SERVER 0xAB/**<\brief service type of SIMULTANEOUS_SERVER*/
  247. #define SERVICE_INDEPENDENT_FILE 0xAC/**<\brief service type of INDEPENDENT_FILE*/
  248. #define SERVICE_DATA 0xC0/**<\brief service type of DATA*/
  249. /**
  250. * zhongbaoxing added the following service types according to ABNTNBR 15603-2 end
  251. */
  252. // service flag
  253. // 0000 0001 // from service attribute descriptor
  254. #define SERVICE_NON_VISIBLE 0x01 /**<\brief SERVICE_NON_VISIBLE*/
  255. // 0000 0010
  256. #define SERVICE_TEMP 0x02 /**<\brief SERVICE_TEMP*/
  257. // 0000 0100
  258. #define SERVICE_SCRAMBLED 0x04 /**<\brief SERVICE_SCRAMBLED*/
  259. // 0000 1000 // from service attribute descriptor
  260. #define SERVICE_NON_SELECTABLE 0x08 /**<\brief SERVICE_NON_SELECTABLE*/
  261. // 0001 0000 // EI_present_folllowing_flag
  262. #define SERVICE_EIT_PF 0x10 /**<\brief SERVICE_EIT_PF*/
  263. // 0010 0000 // free_CA_mode
  264. #define SERVICE_FREE_CA_MODE 0x20 /**<\brief SERVICE_FREE_CA_MODE*/
  265. // 0100 0000 // invalid
  266. #define SERVICE_INVALID 0x40 /**<\brief SERVICE_INVALID*/
  267. #define SERVICE_NOT_ENABLE 0X80
  268. //running status
  269. #define RS_NOT_RUNNING 0x1 /**<\brief RS_NOT_RUNNING*/
  270. #define RS_START_IN_FEW_SECONDS 0x2/**<\brief RS_START_IN_FEW_SECONDS*/
  271. #define RS_PAUSING 0x3 /**<\brief RS_PAUSING*/
  272. #define RS_RUNNING 0x4 /**<\brief RS_RUNNING*/
  273. #define RS_SERVICE_OFF_AIR 0x5 /**<\brief RS_SERVICE_OFF_AIR*/
  274. /* ci shunning data define */
  275. #define CI_SHUNNING_INVALID 0x0 /**<\brief shunning data invalid*/
  276. #define CI_SHUNNING_PRESENT 0x1 /**<\brief shunning data PRESENT*/
  277. #define CI_SHUNNING_ABSENT 0x2 /**<\brief shunning data ABSENT*/
  278. /* Timeout */
  279. #undef SDT_TIMEOUT
  280. #define SDT_TIMEOUT 1500 /**<\brief SDT_TIMEOUT*/
  281. #undef NIT_TIMEOUT
  282. #define NIT_TIMEOUT 1500 /**<\brief NIT_TIMEOUT*/
  283. #undef TDT_TIMEOUT
  284. #define TDT_TIMEOUT 4000 /**<\brief TDT_TIMEOUT*/
  285. #undef TOT_TIMEOUT
  286. #define TOT_TIMEOUT 4000 /**<\brief TOT_TIMEOUT*/
  287. #define DTGCMG_TBL_NONE 0x00 /**<\brief DTGCMG_TBL_NONE*/
  288. #define DTGCMG_TBL_NIT_1ST_LOOP 0x10/**<\brief DTGCMG_TBL_NIT_1ST_LOOP*/
  289. #define DTGCMG_TBL_NIT_2ND_LOOP 0x20/**<\brief DTGCMG_TBL_NIT_2ND_LOOP*/
  290. #define DTGCMG_TBL_SDT 0x40 /**<\brief DTGCMG_TBL_SDT*/
  291. #define DTGCMG_TBL_EIT 0x80 /**<\brief DTGCMG_TBL_EIT*/
  292. /*
  293. *TDT structure
  294. */
  295. #define MjdToEpochTime(x) (((x##_hi << 8 | x##_lo)-40587)*86400) /**<\brief MjdToEpochTime*/
  296. #define BcdTimeToSeconds(x) ((3600 * ((10*((x##_h & 0xF0)>>4)) + \
  297. (x##_h & 0xF))) + \
  298. (60 * ((10*((x##_m & 0xF0)>>4)) + \
  299. (x##_m & 0xF))) + \
  300. ((10*((x##_s & 0xF0)>>4)) + (x##_s & 0xF))) /**<\brief BcdTimeToSeconds*/
  301. #define BCDToDecimal(x) (10*((x & 0xF0)>>4)) + (x & 0xF) /**<\brief BCDToDecimal*/
  302. #define BCD2DEC(x) ((((x & 0xF0) >> 4) * 10) + (x & 0x0F)) /**<\brief BCD2DEC*/
  303. // ================ TDT related ======================= //
  304. #define TDT_LEN 8 /**<\brief TDT_LEN*/
  305. /**
  306. * \brief TDT structure
  307. */
  308. typedef struct _mid_siutil_tdt_t
  309. {
  310. UINT8 table_id :8; /**<\brief 0x70*/
  311. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  312. UINT8 reserved :3; /**<\brief reserved */
  313. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator*/
  314. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  315. UINT8 utc_mjd_hi :8; /**<\brief utc_mjd high bit*/
  316. UINT8 utc_mjd_lo :8; /**<\brief utc_mjd low bit*/
  317. UINT8 utc_time_h :8; /**<\brief utc_time hour*/
  318. UINT8 utc_time_m :8; /**<\brief utc_time minute*/
  319. UINT8 utc_time_s :8; /**<\brief utc_time second*/
  320. }MID_SiutilTdt_t, *LP_MID_SiutilTdt_t; /**<\brief LP_MID_SiutilTdt_t*/
  321. /**
  322. * \brief ASC Time
  323. */
  324. typedef struct _mid_siutil_time_date_t
  325. {
  326. int Year; /**<\brief Year;*/
  327. char Month; /**<\brief Month*/
  328. char Day; /**<\brief Day*/
  329. char Hour; /**<\brief Hour*/
  330. char Min; /**<\brief Minute*/
  331. char Second; /**<\brief Second*/
  332. }MID_SiutilTimeDate_t, *LP_MID_SiutilTimeDate_t;/**<\brief LP_MID_SiutilTimeDate_t*/
  333. /**
  334. * \brief TDT and TOT struct
  335. */
  336. typedef struct _mid_siutil_tdt_tot_t
  337. {
  338. INT8 table_id; /**<\brief TDT:0x70 TOT:0x73*/
  339. INT32 curtime; /**<\brief current time*/
  340. MID_SiutilTimeDate_t asc_time; /**<\brief ASC time*/
  341. char RawUTC[5]; ///<20100301 JennyLee added for mantis 80113 /**<\brief RawUTC*/
  342. UINT16 descLen; /**<\brief only TOT used*/
  343. UINT8 *p_descr; /**<\brief p_descr*/
  344. }MID_SiutilTdtTot_t, *LP_MID_SiutilTdtTot_t;/**<\brief LP_MID_SiutilTdtTot_t*/
  345. // ================ SDT related ======================= //
  346. #define SDT_LEN 11 /**<\brief SDT_LEN*/
  347. /**
  348. * \brief SDT structure
  349. */
  350. typedef struct _mid_siutil_sdt_t
  351. {
  352. UINT8 table_id :8; /**<\brief Actual:0x42 Other:0x46*/
  353. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  354. UINT8 reserved :3; /**<\brief reserved */
  355. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  356. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  357. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit */
  358. UINT8 transport_stream_id_lo :8; /**<\brief low bit */
  359. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  360. UINT8 version_number :5; /**<\brief version_number */
  361. UINT8 reserved1 :2; /**<\brief reserved */
  362. UINT8 section_number :8; /**<\brief section_number*/
  363. UINT8 last_section_number :8; /**<\brief last_section_number*/
  364. UINT8 original_network_id_hi :8; /**<\brief original_network_id high bit */
  365. UINT8 original_network_id_lo :8; /**<\brief original_network_id low bit */
  366. UINT8 reserved2 :8; /**<\brief reserved */
  367. }MID_SiutilSdt_t, *LP_MID_SiutilSdt_t;/**<\brief LP_MID_SiutilSdt_t*/
  368. #define SDT_DESCR_LEN 5 /**<\brief SDT_DESCR_LEN*/
  369. /**
  370. * \brief one program info structure in SDT
  371. */
  372. typedef struct _mid_siutil_sdt_descr_t
  373. {
  374. UINT8 service_id_hi :8; /**<\brief service_id high bit */
  375. UINT8 service_id_lo :8; /**<\brief service_id low bit */
  376. UINT8 eit_present_following_flag :1; /**<\brief eit_present_following_flag */
  377. UINT8 eit_schedule_flag :1; /**<\brief eit_schedule_flag*/
  378. UINT8 reserved :6; /**<\brief reserved */
  379. UINT8 descriptors_loop_length_hi :4; /**<\brief descriptors_loop_length high bit */
  380. UINT8 free_ca_mode :1; /**<\brief free_ca_mode */
  381. UINT8 running_status :3; /**<\brief running_status */
  382. UINT8 descriptors_loop_length_lo :8; /**<\brief descriptors_loop_length low bit */
  383. }MID_SiutilSdtDescr_t, *LP_MID_SiutilSdtDescr_t;/**<\brief LP_MID_SiutilSdtDescr_t*/
  384. /**
  385. * \brief one program service_descr structure in SDT
  386. */
  387. typedef struct _mid_siutil_sdt_service_descr_t
  388. {
  389. MID_SiutilSdtDescr_t sdt_service;/**<\brief sdt_service */
  390. UINT16 descLen;/**<\brief descLen */
  391. UINT8 *p_descr;/**<\brief p_descr */
  392. }MID_SiutilSdtServiceDescr_t, *LP_MID_SiutilSdtServiceDescr_t; /**<\brief LP_MID_SiutilSdtServiceDescr_t*/
  393. /**
  394. * \brief one program info_t structure in SDT
  395. */
  396. typedef struct _mid_siutil_sdt_info_t
  397. {
  398. UINT16 transport_stream_id;/**<\brief transport_stream_id */
  399. UINT16 original_network_id;/**<\brief original_network_ide */
  400. UINT8 table_id;/**<\brief table_id */
  401. UINT8 version_number;/**<\brief version_number */
  402. UINT16 services_count;/**<\brief services_count */
  403. MID_SiutilSdtServiceDescr_t *p_sdt_descr_t; /**<\brief p_sdt_descr_t */
  404. }MID_SiutilSdtInfo_t, *LP_MID_SiutilSdtInfo_t;/**<\brief LP_MID_SiutilSdtInfo_t*/
  405. // ================ NIT related ======================= //
  406. #define NIT_LEN 10 /**<\brief NIT_LEN*/
  407. /**
  408. * \brief NIT structure
  409. */
  410. typedef struct _mid_siutil_nit_t
  411. {
  412. UINT8 table_id :8; /**<\brief Actual:0x40 Other:0x41*/
  413. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  414. UINT8 reserved1 :3; /**<\brief reserved*/
  415. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  416. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  417. UINT8 network_id_hi :8; /**<\brief network_id high bit */
  418. UINT8 network_id_lo :8; /**<\brief network_id low bit */
  419. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  420. UINT8 version_number :5; /**<\brief version_number */
  421. UINT8 reserved2 :2; /**<\brief reserved*/
  422. UINT8 section_number :8; /**<\brief section_number */
  423. UINT8 last_section_number :8; /**<\brief last_section_number*/
  424. UINT8 network_descriptor_length_hi :4; /**<\brief network_descriptor_length high bit*/
  425. UINT8 reserved3 :4; /**<\brief reserved*/
  426. UINT8 network_descriptor_length_lo :8; /**<\brief network_descriptor_length low bit*/
  427. }MID_SiutilNit_t, *LP_MID_SiutilNit_t; /**<\brief LP_MID_SiutilNit_t*/
  428. #define NIT_TS_LEN 6 /**<\brief NIT_TS_LEN*/
  429. /**
  430. * \brief NIT TS structure
  431. */
  432. typedef struct _mid_siutil_nit_ts_t
  433. {
  434. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit*/
  435. UINT8 transport_stream_id_lo :8; /**<\brief transport_stream_id low bit*/
  436. UINT8 original_network_id_hi :8; /**<\brief original_network_id high bit*/
  437. UINT8 original_network_id_lo :8; /**<\brief original_network_id low bit*/
  438. UINT8 transport_descriptors_length_hi :4; /**<\brief transport_descriptors_length high bit*/
  439. UINT8 reserved :4; /**<\brief reserved*/
  440. UINT8 transport_descriptors_length_lo :8; /**<\brief transport_descriptors_length low bit*/
  441. }MID_SiutilNitTs_t, *LP_MID_SiutilNitTs_t;/**<\brief LP_MID_SiutilNitTs_t*/
  442. /**
  443. * \brief NIT TS descriptor structure
  444. */
  445. typedef struct _mid_siutil_nit_ts_desc_t
  446. {
  447. UINT16 trans_id; /**<\brief transport_stream_id */
  448. UINT16 original_network_id; /**<\brief original_network_id */
  449. UINT16 trans_descLen; /**<\brief descriptor length */
  450. UINT8 *p_transDescr; /**<\brief pointer to descriptors */
  451. }MID_SiutilNitTsDescr_t, *LP_MID_SiutilNitTsDescr_t;/**<\brief LP_MID_SiutilNitTsDescr_t*/
  452. /**
  453. * \brief NIT info structure
  454. */
  455. typedef struct _mid_siutil_nit_info_t
  456. {
  457. UINT16 network_id; /**<\brief network_id */
  458. UINT8 version_number; /**<\brief version_number */
  459. UINT16 descLen; /**<\brief network descriptor length */
  460. UINT8 *p_descr; /**<\brief pointer to descriptor */
  461. #ifdef SUPPORT_MONITOR_ONLY_NIT_OTHER
  462. UINT8 table_id;
  463. #endif
  464. /* transport streams */
  465. UINT16 trans_count; /**<\brief trans_count */
  466. MID_SiutilNitTsDescr_t *p_trans; /**<\brief p_trans */
  467. }MID_SiutilNitInfo_t, *LP_MID_SiutilNitInfo_t; /**<\brief LP_MID_SiutilNitInfo_t */
  468. //=============================Bat related========================
  469. #define BAT_LEN 10
  470. typedef struct _mid_siutil_bat_t
  471. {
  472. UINT8 table_id :8;
  473. UINT8 section_length_hi :4;
  474. UINT8 :3;
  475. UINT8 section_syntax_indicator :1;
  476. UINT8 section_length_lo :8;
  477. UINT8 bouquet_id_hi :8;
  478. UINT8 bouquet_id_lo :8;
  479. UINT8 current_next_indicator :1;
  480. UINT8 version_number :5;
  481. UINT8 :2;
  482. UINT8 section_number :8;
  483. UINT8 last_section_number :8;
  484. UINT8 bouquet_descriptor_length_hi :4;
  485. UINT8 :4;
  486. UINT8 bouquet_descriptor_length_lo :8;
  487. } MID_SiutilBat_t, *LP_MID_SiutilBat_t;
  488. #define BAT_TS_LEN 6
  489. typedef struct _mid_siutil_bat_info_t
  490. {
  491. UINT16 bouquet_id;
  492. UINT8 version_number;
  493. /* bouquet descriptor length */
  494. UINT16 descLen;
  495. UINT8 *p_descr;
  496. /* transport streams */
  497. UINT16 trans_count;
  498. MID_SiutilNitTsDescr_t *p_trans;
  499. } MID_SiutilBatInfo_t,*LP_MID_SiutilBatInfo_t;
  500. #ifdef CONFIG_SUPPORT_INDONESIA_EWS
  501. //=============================TxDW related========================
  502. #define TXDW_LEN 8 /**<\brief TXDW_LEN*/
  503. /**
  504. * \brief TxDW structure
  505. */
  506. typedef struct _mid_siutil_txdw_t
  507. {
  508. UINT8 table_id :8; /**<\brief 0x80 */
  509. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  510. UINT8 reserved1 :2; /**<\brief reserved*/
  511. UINT8 private_indicator :1; /**<\brief private_indicator */
  512. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  513. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  514. UINT8 table_id_ext_hi :8; /**<\brief table_id_extension high bit */
  515. UINT8 table_id_ext_lo :8; /**<\brief table_id_extension low bit */
  516. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  517. UINT8 version_number :5; /**<\brief version_number */
  518. UINT8 reserved2 :2; /**<\brief reserved*/
  519. UINT8 section_number :8; /**<\brief section_number */
  520. UINT8 last_section_number :8; /**<\brief last_section_number*/
  521. }MID_SiutilTxdw_t, *LP_MID_SiutilTxdw_t; /**<\brief LP_MID_SiutilTxdw_t*/
  522. #define TRDW_LEN 5 /**<\brief TRDW_LEN*/
  523. /**
  524. * \brief TRDW structure
  525. */
  526. typedef struct _mid_siutil_trdw_t
  527. {
  528. UINT8 disaster_code_hi :8; /**<\brief disaster_code high bit*/
  529. UINT8 disaster_code_lo :8; /**<\brief disaster_code low bit */
  530. UINT8 location_type_code :8; /**<\brief location_type_code */
  531. UINT8 package_id :8; /**<\brief package_id */
  532. UINT8 number_of_location :8; /**<\brief number_of_location_code */
  533. }MID_SiutilTrdw_t, *LP_MID_SiutilTrdw_t; /**<\brief LP_MID_SiutilTrdw_t*/
  534. #define TRDW_REGION_LEN 4 /**<\brief TRDW_REGION_LEN*/
  535. /**
  536. * \brief TRDW region structure
  537. */
  538. typedef struct _mid_siutil_trdw_region_t
  539. {
  540. UINT8 location_code_hi :8; /**<\brief location_code high bit*/
  541. UINT8 location_code_mi :8; /**<\brief location_code middle bit*/
  542. UINT8 location_code_lo :8; /**<\brief location_code low bit */
  543. UINT8 length_location_code :8; /**<\brief length_location_code*/
  544. }MID_SiutilTrdwRegion_t, *LP_MID_SiutilTrdwRegion_t; /**<\brief LP_MID_SiutilTrdwRegion_t*/
  545. #define TCDW_LEN 1 /**<\brief TCDW_LEN*/
  546. /**
  547. * \brief TCDW structure
  548. */
  549. typedef struct _mid_siutil_tcdw_t
  550. {
  551. UINT8 number_of_disaster :8; /**<\brief number_of_disaster_code */
  552. }MID_SiutilTcdw_t, *LP_MID_SiutilTcdw_t; /**<\brief LP_MID_SiutilTcdw_t*/
  553. #define TCDW_CODE_LEN 4 /**<\brief TCDW_CODE_LEN*/
  554. /**
  555. * \brief TCDW code structure
  556. */
  557. typedef struct _mid_siutil_tcdw_code_t
  558. {
  559. UINT8 package_id :8; /**<\brief package_id*/
  560. UINT8 authority :8; /**<\brief authority*/
  561. UINT8 disaster_code_hi :8; /**<\brief disaster_code high bit*/
  562. UINT8 disaster_code_lo :8; /**<\brief disaster_code low bit */
  563. }MID_SiutilTcdwCode_t, *LP_MID_SiutilTcdwCode_t; /**<\brief LP_MID_SiutilTcdwCode_t*/
  564. #define TMDW_LEN 2 /**<\brief TMDW_LEN*/
  565. /**
  566. * \brief TMDW structure
  567. */
  568. typedef struct _mid_siutil_tmdw_t
  569. {
  570. UINT8 location_type_code :8; /**<\brief location_type_code */
  571. UINT8 package_id :8; /**<\brief package_id */
  572. }MID_SiutilTmdw_t, *LP_MID_SiutilTmdw_t; /**<\brief LP_MID_SiutilTmdw_t*/
  573. #define TMDW_MSG_LEN 4 /**<\brief TMDW_MSG_LEN*/
  574. /**
  575. * \brief TMDW message structure
  576. */
  577. typedef struct _mid_siutil_tmdw_msg_code_t
  578. {
  579. UINT8 length_info_message_hi :8; /**<\brief length_information_message high bit*/
  580. UINT8 length_info_message_lo :8; /**<\brief length_information_message low bit */
  581. }MID_SiutilTmdwMsg_t, *LP_MID_SiutilTmdwMsg_t; /**<\brief LP_MID_SiutilTcdwCode_t*/
  582. typedef struct si_string
  583. {
  584. UINT16 nbytes;
  585. UINT8* str_ptr;
  586. } SI_STRING_DESC;
  587. typedef struct
  588. {
  589. UINT32 location_code;
  590. SI_STRING_DESC* location_name;
  591. } SI_EWS_TRDW_LOCATION;
  592. typedef struct _mid_siutil_trdw_info_t
  593. {
  594. UINT16 disaster_code;
  595. UINT8 location_type_code;
  596. UINT8 package_id;
  597. UINT8 number_locations;
  598. SI_EWS_TRDW_LOCATION* locations;
  599. }MID_SiutilTrdwInfo_t, *LP_MID_SiutilTrdwInfo_t; /**<\brief LP_MID_SiutilTrdwInfo_t*/
  600. typedef struct _mid_siutil_tcdw_info_t
  601. {
  602. UINT8 package_id;
  603. UINT8 authority;
  604. UINT16 disaster_code;
  605. SI_STRING_DESC* disaster_name;
  606. SI_STRING_DESC* disaster_position;
  607. SI_STRING_DESC* disaster_date;
  608. SI_STRING_DESC* disaster_characteristic;
  609. }MID_SiutilTcdwInfo_t, *LP_MID_SiutilTcdwInfo_t; /**<\brief LP_MID_SiutilTcdwInfo_t*/
  610. typedef struct _mid_siutil_tmdw_info_t
  611. {
  612. UINT8 location_type_code;
  613. UINT8 package_id;
  614. UINT8 num_messages;
  615. SI_STRING_DESC** messages;
  616. }MID_SiutilTmdwInfo_t, *LP_MID_SiutilTmdwInfo_t; /**<\brief LP_MID_SiutilTmdwInfo_t*/
  617. /* table_type */
  618. #define SI_EWS_TABLE_TRDW 0x01
  619. #define SI_EWS_TABLE_TCDW 0x02
  620. #define SI_EWS_TABLE_TMDW 0x03
  621. typedef struct _mid_siutil_txdw_info_t
  622. {
  623. UINT16 table_type;
  624. UINT8 version;
  625. UINT8 num_entries;
  626. UINT32 crc32;
  627. union {
  628. void *generic_entry;
  629. MID_SiutilTrdwInfo_t *trdw_entry;
  630. MID_SiutilTcdwInfo_t *tcdw_entry;
  631. MID_SiutilTmdwInfo_t *tmdw_entry;
  632. };
  633. }MID_SiutilTxdwInfo_t, *LP_MID_SiutilTxdwInfo_t; /**<\brief LP_MID_SiutilTxdwInfo_t*/
  634. CHAN_INDEX MID_SIUTIL_OpenTRDW(GL_Queue_t hChanEventQueueHdl, UINT16 pid);
  635. CHAN_INDEX MID_SIUTIL_OpenTCDW(GL_Queue_t hChanEventQueueHdl, UINT16 pid);
  636. CHAN_INDEX MID_SIUTIL_OpenTMDW(GL_Queue_t hChanEventQueueHdl, UINT16 pid);
  637. CHAN_INDEX MID_SIUTIL_OpenTxDWEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl);
  638. void MID_SIUTIL_FreeTxDW(MID_SiutilTxdwInfo_t ** ppTXDW);
  639. MID_SiutilTxdwInfo_t *MID_SIUTIL_ParseTxDWEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit);
  640. MID_SiutilTxdwInfo_t *MID_SIUTIL_ParseTxDW(CHAN_INDEX chn_index);
  641. #endif // CONFIG_SUPPORT_INDONESIA_EWS
  642. #ifdef SUPPORT_ASTRA_LCN
  643. // ================ SGT related ======================= //
  644. #define MAX_SGT_PID_NUM 5
  645. #define MAX_SGT_SEVLIST_NUM 10
  646. #define SGT_LEN 12 /**<\brief SGT_LEN*/
  647. /**
  648. * \brief SGT structure
  649. */
  650. typedef struct _mid_siutil_sgt_t
  651. {
  652. UINT8 table_id :8; /**<\brief 0x91*/
  653. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  654. UINT8 reserved1 :3; /**<\brief reserved*/
  655. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  656. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  657. UINT8 service_list_id_hi :8; /**<\brief service_list_id high bit */
  658. UINT8 service_list_id_lo :8; /**<\brief service_list_id low bit */
  659. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  660. UINT8 version_number :5; /**<\brief version_number */
  661. UINT8 reserved2 :2; /**<\brief reserved*/
  662. UINT8 section_number :8; /**<\brief section_number */
  663. UINT8 last_section_number :8; /**<\brief last_section_number*/
  664. UINT8 reserved3 :8; /**<\brief reserved*/
  665. UINT8 reserved4 :8; /**<\brief reserved*/
  666. UINT8 service_list_descriptor_length_hi :4; /**<\brief service_list_descriptor_length high bit*/
  667. UINT8 reserved5 :4; /**<\brief reserved*/
  668. UINT8 service_list_descriptor_length_lo :8; /**<\brief service_list_descriptor_length low bit*/
  669. }MID_SiutilSgt_t, *LP_MID_SiutilSgt_t; /**<\brief LP_MID_SiutilNit_t*/
  670. #define SGT_SRV_LEN 12
  671. /**
  672. * \brief SGT service structure
  673. */
  674. typedef struct _mid_siutil_srv_t
  675. {
  676. UINT8 service_id_hi :8; /**<\brief service_id high bit*/
  677. UINT8 service_id_lo :8; /**<\brief service_id low bit*/
  678. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit*/
  679. UINT8 transport_stream_id_lo :8; /**<\brief transport_stream_id low bit*/
  680. UINT8 original_network_id_hi :8; /**<\brief original_network_id high bit*/
  681. UINT8 original_network_id_lo :8; /**<\brief original_network_id low bit*/
  682. UINT8 logical_channel_number_hi :8;
  683. UINT8 new_service_flag :1;
  684. UINT8 visible_service_flag :1;
  685. UINT8 logical_channel_number_lo :6;
  686. UINT8 genre_code_hi :8;
  687. UINT8 genre_code_lo :8;
  688. UINT8 service_descriptors_length_hi :4; /**<\brief service_descriptors_length high bit*/
  689. UINT8 reserved :4; /**<\brief reserved*/
  690. UINT8 service_descriptors_length_lo :8; /**<\brief service_descriptors_length low bit*/
  691. }MID_SiutilSgtSrv_t, *LP_MID_SiutilSgtSrv_t;/**<\brief LP_MID_SiutilSgtSrv_t*/
  692. /**
  693. * \brief one program service structure in SGT
  694. */
  695. typedef struct _mid_siutil_sgt_service_descr_t
  696. {
  697. MID_SiutilSgtSrv_t sgt_service;/**<\brief sdt_service */
  698. UINT16 srv_descLen;/**<\brief descLen */
  699. UINT8 *p_srv_descr;/**<\brief p_descr */
  700. }MID_SiutilSgtServiceDescr_t, *LP_MID_SiutilSgtServiceDescr_t; /**<\brief LP_MID_SiutilSgtServiceDescr_t*/
  701. /**
  702. * \brief service list structure in SGT
  703. */
  704. typedef struct _mid_siutil_sgt_info_t
  705. {
  706. UINT16 pid;
  707. UINT16 service_list_id;/**<\brief service_list_id */
  708. UINT8 version_number;/**<\brief version_number */
  709. UINT8 section_number;
  710. UINT8 last_section_number;
  711. UINT16 descLen; /**<\brief service list descriptor length */
  712. UINT8 *p_descr; /**<\brief pointer to descriptor */
  713. UINT16 services_count;/**<\brief services_count */
  714. MID_SiutilSgtServiceDescr_t *p_srv; /**<\brief service info */
  715. }MID_SiutilSgtInfo_t, *LP_MID_SiutilSgtInfo_t;/**<\brief LP_MID_SiutilSdtInfo_t*/
  716. CHAN_INDEX MID_SIUTIL_OpenSGT(GL_Queue_t hChanEventQueueHdl, UINT16 pid, bool bIsMultiSection);
  717. CHAN_INDEX MID_SIUTIL_OpenSGTEx(LIVE_INPUT_UNIT InputUnit,GL_Queue_t hChanEventQueueHdl, UINT16 pid);
  718. void MID_SIUTIL_FreeSGT(MID_SiutilSgtInfo_t ** ppSGT, bool bFreeSrvDes, bool bFreeSrvLisDes);
  719. MID_SiutilSgtInfo_t *MID_SIUTIL_ParseSGT(CHAN_INDEX chn_index, UINT16 pid,
  720. UINT8 * p_SrvListDesc, INT16 SrvList_DescLen, UINT16 * p_service,
  721. INT16 srv_len, UINT8 * p_SrvDesc, INT16 Srv_DescLen);
  722. MID_SiutilSgtInfo_t *MID_SIUTIL_ParseSGTEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit,
  723. UINT16 pid, UINT8 * p_SrvListDesc, INT16 SrvList_DescLen, UINT16 * p_service,
  724. INT16 srv_len, UINT8 * p_SrvDesc, INT16 Srv_DescLen);
  725. #endif
  726. #ifdef CONFIG_SUPPORT_HBBTV
  727. /**
  728. * \brief service list structure in AIT
  729. */
  730. /**
  731. * \brief AIT structure
  732. */
  733. typedef struct _mid_siutil_ait_t
  734. {
  735. UINT8 table_id :8; /**<\brief 0x74*/
  736. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  737. UINT8 reserved1 :3; /**<\brief reserved*/
  738. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator */
  739. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  740. UINT8 application_type_hi :7; /**<\brief application_type high bit */
  741. UINT8 test_application_flag :1; /**<\brief test_application_flag */
  742. UINT8 application_type_lo :8; /**<\brief application_type low bit */
  743. UINT8 current_next_indicator :1; /**<\brief current_next_indicator */
  744. UINT8 version_number :5; /**<\brief version_number */
  745. UINT8 reserved2 :2; /**<\brief reserved*/
  746. UINT8 section_number :8; /**<\brief section_number */
  747. UINT8 last_section_number :8; /**<\brief last_section_number*/
  748. UINT8 common_des_length_hi :4; /**<\brief section_length low bit */
  749. UINT8 reserved3 :4; /**<\brief application_type high bit */
  750. UINT8 common_des_length_lo :8; /**<\brief application_type low bit */
  751. } MID_SiutilAit_t, *LP_MID_SiutilAit_t; /**<\brief LP_MID_SiutilAit_t*/
  752. #define AIT_LEN (10)
  753. /**
  754. * \brief AIT descriptor structure
  755. */
  756. typedef struct MID_SiutilAitApp_s
  757. {
  758. UINT32 organization_id;
  759. UINT8 application_id_hi :8;
  760. UINT8 application_id_lo :8;
  761. UINT8 application_control_code :8;
  762. UINT8 application_descriptors_loop_length_hi :4;
  763. UINT8 reserved_future_use :4;
  764. UINT8 application_descriptors_loop_length_lo :8;
  765. } MID_SiutilAitApp_t, *LP_MID_SiutilAitApp_t;/**<\brief LP_MID_SiutilNitTsDescr_t*/
  766. #define AIT_APPDES_LEN (9) /**<\brief AIT_APPDES_LEN*/
  767. /**
  768. * \brief AIT TS descriptor structure
  769. */
  770. typedef struct _mid_siutil_ait_appdesc_s
  771. {
  772. UINT32 organization_id;
  773. UINT16 application_id;
  774. UINT8 application_control_code;
  775. UINT8 appDec_len;
  776. UINT8 *p_AppDescr; /**<\brief pointer to descriptors */
  777. } MID_SiutilAitAppDescr_t, *LP_MID_SiutilAitAppDescr_t;/**<\brief LP_MID_SiutilNitTsDescr_t*/
  778. typedef struct _mid_siutil_ait_info_s
  779. {
  780. //MID_SiutilAit_t Ait_header;
  781. UINT8 test_applicatio_flag;
  782. UINT16 application_type;
  783. UINT8 version_number;
  784. UINT16 descLen;
  785. UINT8 *p_descr;
  786. UINT16 app_count;
  787. MID_SiutilAitAppDescr_t *p_Apps;
  788. } MID_SiutilAitInfo_t, *LP_MID_SiutilAitInfo_t;/**<\brief LP_MID_SiutilSdtInfo_t*/
  789. CHAN_INDEX MID_SIUTIL_OpenAIT(GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 App_Type);
  790. CHAN_INDEX MID_SIUTIL_OpenAITEx(LIVE_INPUT_UNIT InputUnit,GL_Queue_t hChanEventQueueHdl, UINT16 pid, UINT16 App_Type);
  791. void MID_SIUTIL_FreeAIT(MID_SiutilAitInfo_t ** ppAIT);
  792. MID_SiutilAitInfo_t *MID_SIUTIL_ParseAITEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit, UINT16 pid, UINT8 * p_aitDesc, INT16 ait_descLen,
  793. UINT16 * p_AppId, INT16 AppIdLen, UINT8 * p_Innerdesc, INT16 InnerdescLen);
  794. MID_SiutilAitInfo_t *MID_SIUTIL_ParseAIT(CHAN_INDEX chn_index, UINT16 pid, UINT8 *p_aitDesc, INT16 ait_descLen,
  795. UINT16 *p_AppId, INT16 AppIdLen, UINT8 *p_Innerdesc, INT16 InnerdescLen);
  796. #endif
  797. /************************************************************************************/
  798. /**
  799. * \fn CHAN_INDEX MID_SIUTIL_OpenSDT(GL_Queue_t hChanEventQueueHdl,
  800. * UINT8 bAct)
  801. *
  802. * \param hChanEventQueueHdl : event queue handle
  803. * \param bAct : TRUE for actual, FALSE for others
  804. *
  805. * \return index of channel handle which is mapped SDT
  806. *
  807. ************************************************************************************/
  808. CHAN_INDEX MID_SIUTIL_OpenSDT(GL_Queue_t hChanEventQueueHdl,
  809. UINT8 bAct);
  810. /************************************************************************************/
  811. /**
  812. * \fn CHAN_INDEX MID_SIUTIL_OpenSDTEx(LIVE_INPUT_UNIT InputUnit,
  813. * GL_Queue_t hChanEventQueueHdl,
  814. * UINT8 bAct)
  815. *
  816. * \param InputUnit : demux unit
  817. * \param hChanEventQueueHdl : event queue handle
  818. * \param bAct : TRUE for actual, FALSE for others
  819. *
  820. * \return index of channel handle which is mapped SDT
  821. *
  822. ************************************************************************************/
  823. CHAN_INDEX MID_SIUTIL_OpenSDTEx(LIVE_INPUT_UNIT InputUnit,
  824. GL_Queue_t hChanEventQueueHdl,
  825. UINT8 bAct);
  826. /************************************************************************************/
  827. /**
  828. * \fn CHAN_INDEX MID_SIUTIL_OpenSDT2Tbl(GL_Queue_t hChanEventQueueHdl,
  829. * UINT8 bAct)
  830. *
  831. * \param hChanEventQueueHdl : event queue handle
  832. * \param bAct : TRUE for actual, FALSE for others
  833. *
  834. * \return index of channel handle which is mapped SDT
  835. *
  836. * \note it's opened to receive two types of SDT table. actual & other at the same time.
  837. *
  838. ************************************************************************************/
  839. CHAN_INDEX MID_SIUTIL_OpenSDT2Tbl(GL_Queue_t hChanEventQueueHdl, bool bIsMultiSection);
  840. /************************************************************************************/
  841. /**
  842. * \fn CHAN_INDEX MID_SIUTIL_OpenSDT2TblEx(LIVE_INPUT_UNIT InputUnit,
  843. * GL_Queue_t hChanEventQueueHdl,
  844. * UINT8 bAct)
  845. *
  846. * \param InputUnit : demux unit
  847. * \param hChanEventQueueHdl : event queue handle
  848. * \param bAct : TRUE for actual, FALSE for others
  849. *
  850. * \return index of channel handle which is mapped SDT
  851. *
  852. * \note it's opened to receive two types of SDT table. actual & other at the same time.
  853. *
  854. ************************************************************************************/
  855. CHAN_INDEX MID_SIUTIL_OpenSDT2TblEx(LIVE_INPUT_UNIT InputUnit,
  856. GL_Queue_t hChanEventQueueHdl,
  857. UINT8 bAct);
  858. /************************************************************************************/
  859. /**
  860. * \fn void MID_SIUTIL_FreeSDT(MID_SiutilSdtInfo_t **ppSDT)
  861. *
  862. * \param ppSDT : pointer to MID_SiutilSdtInfo_t which store information of SDT
  863. *
  864. * \return none
  865. *
  866. ************************************************************************************/
  867. void MID_SIUTIL_FreeSDT(MID_SiutilSdtInfo_t **ppSDT);
  868. /************************************************************************************/
  869. /**
  870. * \fn MID_SiutilSdtInfo_t* MID_SIUTIL_ParseSDT(CHAN_INDEX chn_index,
  871. * UINT16 *p_service,
  872. * INT16 serLen,
  873. * UINT8 *p_desc,
  874. * INT16 descLen,
  875. * UINT8 bAct)
  876. *
  877. * \param chn_index : index of channel handle which is mapped SDT
  878. * \param p_service : pointer to service array
  879. * \param serLen : length of service array
  880. * \param p_desc : pointer to descriptor array
  881. * \param descLen : length of descriptor array
  882. * \param bAct : TRUE for actual, FALSE for others
  883. *
  884. * \return the structure which store information of SDT
  885. *
  886. ************************************************************************************/
  887. MID_SiutilSdtInfo_t* MID_SIUTIL_ParseSDT(CHAN_INDEX chn_index,
  888. UINT16 *p_service,
  889. INT16 serLen,
  890. UINT8 *p_desc,
  891. INT16 descLen,
  892. UINT8 bAct);
  893. /************************************************************************************/
  894. /**
  895. * \fn MID_SiutilSdtInfo_t* MID_SIUTIL_ParseSDTEx(CHAN_INDEX chn_index,
  896. * LIVE_INPUT_UNIT InputUnit,
  897. * UINT16 *p_service,
  898. * INT16 serLen,
  899. * UINT8 *p_desc,
  900. * INT16 descLen,
  901. * UINT8 bAct)
  902. *
  903. * \param chn_index : index of channel handle which is mapped SDT
  904. * \param InputUnit : primary or secondary demux
  905. * \param p_service : pointer to service array
  906. * \param serLen : length of service array
  907. * \param p_desc : pointer to descriptor array
  908. * \param descLen : length of descriptor array
  909. * \param bAct : TRUE for actual, FALSE for others
  910. *
  911. * \return the structure which store information of SDT
  912. *
  913. ************************************************************************************/
  914. MID_SiutilSdtInfo_t* MID_SIUTIL_ParseSDTEx(CHAN_INDEX chn_index,
  915. LIVE_INPUT_UNIT InputUnit,
  916. UINT16 *p_service,
  917. INT16 serLen,
  918. UINT8 *p_desc,
  919. INT16 descLen,
  920. UINT8 bAct);
  921. /************************************************************************************/
  922. /**
  923. * \fn CHAN_INDEX MID_SIUTIL_OpenNIT(GL_Queue_t hChanEventQueueHdl, UINT8 bAct)
  924. *
  925. * \param hChanEventQueueHdl : event queue handle
  926. * \param bAct : TRUE for actual, FALSE for others
  927. *
  928. * \return index of channel handle which is mapped NIT
  929. *
  930. ************************************************************************************/
  931. CHAN_INDEX MID_SIUTIL_OpenNIT(GL_Queue_t hChanEventQueueHdl
  932. , UINT8 bAct);
  933. CHAN_INDEX MID_SIUTIL_OpenNIT2Table(GL_Queue_t hChanEventQueueHdl);
  934. /************************************************************************************/
  935. /**
  936. * \fn CHAN_INDEX MID_SIUTIL_OpenNITEx(LIVE_INPUT_UNIT InputUnit,
  937. * GL_Queue_t hChanEventQueueHdl,
  938. * UINT8 bAct)
  939. *
  940. * \param InputUnit : demux unit
  941. * \param hChanEventQueueHdl : event queue handle
  942. * \param bAct : TRUE for actual, FALSE for others
  943. *
  944. * \return index of channel handle which is mapped NIT
  945. *
  946. ************************************************************************************/
  947. CHAN_INDEX MID_SIUTIL_OpenNITEx(LIVE_INPUT_UNIT InputUnit,
  948. GL_Queue_t hChanEventQueueHdl,
  949. UINT8 bAct);
  950. /************************************************************************************/
  951. /**
  952. * \fn void MID_SIUTIL_FreeNIT(MID_SiutilNitInfo_t **ppNIT)
  953. *
  954. * \param ppNIT : pointer to MID_SiutilNitInfo_t which store information of NIT
  955. *
  956. * \return none
  957. *
  958. ************************************************************************************/
  959. void MID_SIUTIL_FreeNIT(MID_SiutilNitInfo_t **ppNIT);
  960. /************************************************************************************/
  961. /**
  962. * \fn MID_SiutilNitInfo_t* MID_SIUTIL_ParseNIT(CHAN_INDEX chn_index,
  963. * UINT8 *p_netDesc,
  964. * INT16 net_descLen,
  965. * UINT16 *p_tranID,
  966. * INT16 tranID_len,
  967. * UINT8 *p_transDesc,
  968. * INT16 trans_descLen,
  969. * UINT8 bAct)
  970. *
  971. * \param chn_index : index of channel handle which is mapped NIT
  972. * \param p_netDesc : pointer to descriptor array
  973. * \param net_descLen : length of descriptor array
  974. * \param p_tranID : pointer to transport_stream_id array
  975. * \param tranID_len : length of transport_stream_id array
  976. * \param p_transDesc : pointer to descriptor array
  977. * \param trans_descLen : length of descriptor array
  978. * \param bAct : TRUE for actual, FALSE for others
  979. *
  980. * \return the structure which store information of NIT
  981. *
  982. ************************************************************************************/
  983. MID_SiutilNitInfo_t* MID_SIUTIL_ParseNIT(CHAN_INDEX chn_index,
  984. UINT8 *p_netDesc,
  985. INT16 net_descLen,
  986. UINT16 *p_tranID,
  987. INT16 tranID_len,
  988. UINT8 *p_transDesc,
  989. INT16 trans_descLen,
  990. UINT8 bAct);
  991. /************************************************************************************/
  992. /**
  993. * \fn MID_SiutilNitInfo_t* MID_SIUTIL_ParseNITEx(CHAN_INDEX chn_index,
  994. * LIVE_INPUT_UNIT InputUnit,
  995. * UINT8 *p_netDesc,
  996. * INT16 net_descLen,
  997. * UINT16 *p_tranID,
  998. * INT16 tranID_len,
  999. * UINT8 *p_transDesc,
  1000. * INT16 trans_descLen,
  1001. * UINT8 bAct)
  1002. *
  1003. * \param chn_index : index of channel handle which is mapped NIT
  1004. * \param InputUnit : primary or secondary demux
  1005. * \param p_netDesc : pointer to descriptor array
  1006. * \param net_descLen : length of descriptor array
  1007. * \param p_tranID : pointer to transport_stream_id array
  1008. * \param tranID_len : length of transport_stream_id array
  1009. * \param p_transDesc : pointer to descriptor array
  1010. * \param trans_descLen : length of descriptor array
  1011. * \param bAct : TRUE for actual, FALSE for others
  1012. *
  1013. * \return the structure which store information of NIT
  1014. *
  1015. ************************************************************************************/
  1016. MID_SiutilNitInfo_t* MID_SIUTIL_ParseNITEx(CHAN_INDEX chn_index,
  1017. LIVE_INPUT_UNIT InputUnit,
  1018. UINT8 *p_netDesc,
  1019. INT16 net_descLen,
  1020. UINT16 *p_tranID,
  1021. INT16 tranID_len,
  1022. UINT8 *p_transDesc,
  1023. INT16 trans_descLen,
  1024. UINT8 bAct);
  1025. /************************************************************************************/
  1026. /**
  1027. * \fn CHAN_INDEX MID_SIUTIL_OpenTDT(GL_Queue_t hChanEventQueueHdl)
  1028. *
  1029. * \param hChanEventQueueHdl : event queue handle
  1030. *
  1031. * \return index of channel handle which is mapped TDT
  1032. *
  1033. ************************************************************************************/
  1034. CHAN_INDEX MID_SIUTIL_OpenTDT(GL_Queue_t hChanEventQueueHdl);
  1035. /************************************************************************************/
  1036. /**
  1037. * \fn CHAN_INDEX MID_SIUTIL_OpenTDTEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl)
  1038. *
  1039. * \param InputUnit : demux unit
  1040. * \param hChanEventQueueHdl : event queue handle
  1041. *
  1042. * \return index of channel handle which is mapped TDT
  1043. *
  1044. ************************************************************************************/
  1045. CHAN_INDEX MID_SIUTIL_OpenTDTEx(LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl);
  1046. /************************************************************************************/
  1047. /**
  1048. * \fn void MID_SIUTIL_FreeTDT(MID_SiutilTdtTot_t **ppTDT)
  1049. *
  1050. * \param ppTDT : pointer to MID_SiutilTdtTot_t which store information of TDT
  1051. *
  1052. * \return none
  1053. *
  1054. ************************************************************************************/
  1055. void MID_SIUTIL_FreeTDT(MID_SiutilTdtTot_t **ppTDT);
  1056. /************************************************************************************/
  1057. /**
  1058. * \fn MID_SiutilTdtTot_t* MID_SIUTIL_ParseTDT(CHAN_INDEX chn_index, UINT8 *p_desc, INT16 descLen)
  1059. *
  1060. * \param chn_index : index of channel handle which is mapped TDT
  1061. * \param p_desc : pointer to descriptor array
  1062. * \param descLen : length of descriptor array
  1063. *
  1064. * \return the structure which store information of TDT
  1065. *
  1066. ************************************************************************************/
  1067. MID_SiutilTdtTot_t* MID_SIUTIL_ParseTDT(CHAN_INDEX chn_index, UINT8 *p_desc, INT16 descLen);
  1068. /************************************************************************************/
  1069. /**
  1070. * \fn MID_SiutilTdtTot_t* MID_SIUTIL_ParseTDTEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit, UINT8 *p_desc, INT16 descLen)
  1071. *
  1072. * \param chn_index : index of channel handle which is mapped TDT
  1073. * \param InputUnit : primary or secondary demux
  1074. * \param p_desc : pointer to descriptor array
  1075. * \param descLen : length of descriptor array
  1076. *
  1077. * \return the structure which store information of TDT
  1078. *
  1079. ************************************************************************************/
  1080. MID_SiutilTdtTot_t* MID_SIUTIL_ParseTDTEx(CHAN_INDEX chn_index,LIVE_INPUT_UNIT InputUnit, UINT8 *p_desc, INT16 descLen);
  1081. CHAN_INDEX MID_SIUTIL_OpenBAT(GL_Queue_t hChanEventQueueHdl, UINT16 u16BouquetId); //100705 cw.huang modified
  1082. MID_SiutilBatInfo_t *MID_SIUTIL_ParseBAT(CHAN_INDEX chn_index,
  1083. UINT8 *p_batDesc,
  1084. INT16 bat_descLen,
  1085. UINT16 *p_tranID,
  1086. INT16 tranID_len,
  1087. UINT8 *p_transDesc,
  1088. INT16 trans_descLen);
  1089. void MID_SIUTIL_FreeBAT(MID_SiutilBatInfo_t **ppBAT);
  1090. #ifdef CONFIG_SUPPORT_FAST_SCANNING
  1091. //=============================FNT related========================
  1092. #define FNT_LEN 10
  1093. typedef struct _mid_siutil_fnt_t
  1094. {
  1095. UINT8 table_id :8; /**<\brief 0xBC*/
  1096. UINT8 section_length_hi :4;
  1097. UINT8 :3;
  1098. UINT8 section_syntax_indicator :1;
  1099. UINT8 section_length_lo :8;
  1100. UINT8 operator_network_id_hi :8;
  1101. UINT8 operator_network_id_lo :8;
  1102. UINT8 current_next_indicator :1;
  1103. UINT8 version_number :5;
  1104. UINT8 :2;
  1105. UINT8 section_number :8;
  1106. UINT8 last_section_number :8;
  1107. UINT8 network_descriptor_length_hi :4; /**<\brief network_descriptor_length high bit*/
  1108. UINT8 reserved :4; /**<\brief reserved*/
  1109. UINT8 network_descriptor_length_lo :8; /**<\brief network_descriptor_length low bit*/
  1110. } MID_SiutilFnt_t, *LP_MID_SiutilFnt_t;
  1111. #define FNT_TS_LEN 6 /**<\brief FNT_TS_LEN*/
  1112. /**
  1113. * \brief FNT TS structure
  1114. */
  1115. typedef struct _mid_siutil_fnt_ts_t
  1116. {
  1117. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit*/
  1118. UINT8 transport_stream_id_lo :8; /**<\brief transport_stream_id low bit*/
  1119. UINT8 original_network_id_hi :8; /**<\brief original_network_id high bit*/
  1120. UINT8 original_network_id_lo :8; /**<\brief original_network_id low bit*/
  1121. UINT8 transport_descriptors_length_hi :4; /**<\brief transport_descriptors_length high bit*/
  1122. UINT8 reserved :4; /**<\brief reserved*/
  1123. UINT8 transport_descriptors_length_lo :8; /**<\brief transport_descriptors_length low bit*/
  1124. }MID_SiutilFntTs_t, *LP_MID_SiutilFntTs_t;/**<\brief LP_MID_SiutilFntTs_t*/
  1125. /**
  1126. * \brief FNT TS descriptor structure
  1127. */
  1128. typedef struct _mid_siutil_fnt_ts_desc_t
  1129. {
  1130. UINT16 trans_id; /**<\brief transport_stream_id */
  1131. UINT16 original_network_id; /**<\brief original_network_id */
  1132. UINT16 trans_descLen; /**<\brief descriptor length */
  1133. UINT8 *p_transDescr; /**<\brief pointer to descriptors */
  1134. }MID_SiutilFntTsDescr_t, *LP_MID_SiutilFntTsDescr_t;/**<\brief LP_MID_SiutilFntTsDescr_t*/
  1135. /**
  1136. * \brief FNT info structure
  1137. */
  1138. typedef struct _mid_siutil_fnt_info_t
  1139. {
  1140. UINT16 operator_network_id; /**<\brief operator_network_id */
  1141. UINT8 version_number; /**<\brief version_number */
  1142. UINT16 descLen; /**<\brief network descriptor length */
  1143. UINT8 *p_descr; /**<\brief pointer to descriptor */
  1144. /* transport streams */
  1145. UINT16 trans_count; /**<\brief trans_count */
  1146. MID_SiutilFntTsDescr_t *p_trans; /**<\brief p_trans */
  1147. }MID_SiutilFntInfo_t, *LP_MID_SiutilFntInfo_t; /**<\brief LP_MID_SiutilFntInfo_t */
  1148. //=============================FST related========================
  1149. #define FST_LEN 8
  1150. /**
  1151. * \brief FST structure
  1152. */
  1153. typedef struct _mid_siutil_fst_t
  1154. {
  1155. UINT8 table_id :8; /**<\brief 0xBD*/
  1156. UINT8 section_length_hi :4; /**<\brief section_length high bit */
  1157. UINT8 :2;
  1158. UINT8 dummy :1; /**<\brief has to be 0 */
  1159. UINT8 section_syntax_indicator :1; /**<\brief section_syntax_indicator*/
  1160. UINT8 section_length_lo :8; /**<\brief section_length low bit */
  1161. UINT8 operator_network_id_hi :8; /**<\brief operator_network_id low bit */
  1162. UINT8 operator_network_id_lo :8; /**<\brief operator_network_id high bit */
  1163. UINT8 current_next_indicator :1; /**<\brief current_next_indicator*/
  1164. UINT8 version_number :5; /**<\brief version_number*/
  1165. UINT8 :2;
  1166. UINT8 section_number :8; /**<\brief section_number*/
  1167. UINT8 last_section_number :8; /**<\brief last_section_number*/
  1168. }MID_SiutilFst_t, *LP_MID_SiutilFst_t;
  1169. #define FST_SRV_LEN 18 /**<\brief information length of each service in FST*/
  1170. /**
  1171. * \brief SIUTIL FST service structure
  1172. */
  1173. typedef struct _mid_siutil_fst_srv_t
  1174. {
  1175. UINT8 original_network_id_hi :8; /**<\brief original_network_id high bit*/
  1176. UINT8 original_network_id_lo :8; /**<\brief original_network_id low bit*/
  1177. UINT8 transport_stream_id_hi :8; /**<\brief transport_stream_id high bit*/
  1178. UINT8 transport_stream_id_lo :8; /**<\brief transport_stream_id low bit*/
  1179. UINT8 service_id_hi :8; /**<\brief service_id high bit*/
  1180. UINT8 service_id_lo :8; /**<\brief service_id low bit*/
  1181. UINT8 default_video_pid_hi :8; /**<\brief default_video_pid high bit*/
  1182. UINT8 default_video_pid_lo :8; /**<\brief default_video_pid low bit*/
  1183. UINT8 default_audio_pid_hi :8; /**<\brief default_audio_pid high bit*/
  1184. UINT8 default_audio_pid_lo :8; /**<\brief default_audio_pid low bit*/
  1185. UINT8 default_video_ecm_pid_hi :8; /**<\brief default_video_ecm_pid high bit*/
  1186. UINT8 default_video_ecm_pid_lo :8; /**<\brief default_video_ecm_pid low bit*/
  1187. UINT8 default_audio_ecm_pid_hi :8; /**<\brief default_audio_ecm_pid high bit*/
  1188. UINT8 default_audio_ecm_pid_lo :8; /**<\brief default_audio_ecm_pid low bit*/
  1189. UINT8 default_pcr_pid_hi :8; /**<\brief default_pcr_pid high bit*/
  1190. UINT8 default_pcr_pid_lo :8; /**<\brief default_pcr_pid low bit*/
  1191. UINT8 descriptors_loop_length_hi :4; /**<\brief descriptors_loop_length high bit */
  1192. UINT8 reserved :4; /**<\brief reserved */
  1193. UINT8 descriptors_loop_length_lo :8; /**<\brief descriptors_loop_length low bit */
  1194. }MID_SiutilFstSrv_t, *LP_MID_SiutilFstSrv_t;
  1195. /**
  1196. * \brief one program service_descr structure in FST
  1197. */
  1198. typedef struct _mid_siutil_fst_service_descr_t
  1199. {
  1200. MID_SiutilFstSrv_t fst_service;/**<\brief fst_service */
  1201. UINT16 descLen;/**<\brief descLen */
  1202. UINT8 *p_descr;/**<\brief p_descr */
  1203. }MID_SiutilFstServiceDescr_t, *LP_MID_SiutilFstServiceDescr_t; /**<\brief LP_MID_SiutilFstServiceDescr_t*/
  1204. /**
  1205. * \brief one program info_t structure in FST
  1206. */
  1207. typedef struct _mid_siutil_fst_info_t
  1208. {
  1209. UINT16 operator_network_id;
  1210. UINT8 version_number;/**<\brief version_number */
  1211. UINT16 services_count;/**<\brief services_count */
  1212. MID_SiutilFstServiceDescr_t *p_fst_descr_t; /**<\brief p_sdt_descr_t */
  1213. }MID_SiutilFstInfo_t, *LP_MID_SiutilFstInfo_t;/**<\brief LP_MID_SiutilFstInfo_t*/
  1214. CHAN_INDEX MID_SIUTIL_OpenFNT(GL_Queue_t hChanEventQueueHdl, UINT16 u16Pid);
  1215. CHAN_INDEX MID_SIUTIL_OpenFNTEx( LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 u16Pid);
  1216. void MID_SIUTIL_FreeFNT(MID_SiutilFntInfo_t ** ppFNT);
  1217. MID_SiutilFntInfo_t *MID_SIUTIL_ParseFNTEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit, UINT8 * p_netDesc, INT16 net_descLen, UINT16 * p_tranID,
  1218. INT16 tranID_len, UINT8 * p_transDesc, INT16 trans_descLen, UINT16 u16Pid);
  1219. MID_SiutilFntInfo_t *MID_SIUTIL_ParseFNT(CHAN_INDEX chn_index, UINT8 * p_netDesc, INT16 net_descLen, UINT16 * p_tranID,
  1220. INT16 tranID_len, UINT8 * p_transDesc, INT16 trans_descLen, UINT16 u16Pid);
  1221. CHAN_INDEX MID_SIUTIL_OpenFST(GL_Queue_t hChanEventQueueHdl, UINT16 u16Pid);
  1222. CHAN_INDEX MID_SIUTIL_OpenFSTEx( LIVE_INPUT_UNIT InputUnit, GL_Queue_t hChanEventQueueHdl, UINT16 u16Pid);
  1223. void MID_SIUTIL_FreeFST(MID_SiutilFstInfo_t ** ppFST);
  1224. MID_SiutilFstInfo_t *MID_SIUTIL_ParseFSTEx(CHAN_INDEX chn_index, LIVE_INPUT_UNIT InputUnit, UINT8 * p_desc, INT16 descLen, UINT16 u16Pid);
  1225. MID_SiutilFstInfo_t *MID_SIUTIL_ParseFST(CHAN_INDEX chn_index, UINT8 * p_desc, INT16 descLen, UINT16 u16Pid);
  1226. #endif
  1227. #endif /* #ifndef _MID_SIUTIL_DVB_H */