ait_dr.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. /***********************************************************************/
  2. /**
  3. *
  4. * \file ait_dr.h
  5. *
  6. * \brief header for descriptor tag for AIT related descriptors.
  7. *
  8. * \note Copyright (C) 2016 RDA Co, chengdu\n
  9. *
  10. * \author wuliang@rda.com.cn
  11. *
  12. ***********************************************************************/
  13. #ifndef __AIT_DR_H__
  14. #define __AIT_DR_H__
  15. #include <types.h>
  16. /*
  17. * Descriptor Tag Value
  18. * defined by TS102809
  19. */
  20. #define DESCR_APPLICATION 0x00 /**<\brief tag of application descriptor */
  21. #define DESCR_APPLICATION_NAME 0x01 /**<\brief tag of application name descriptor */
  22. #define DESCR_TRANSPORT_PROTOCOL 0x02 /**<\brief tag of transport_protocol_descriptor */
  23. #define DESCR_APPLICATION_RECORDING 0x06 /**<\brief tag of application recording */
  24. #define DESCR_APPLICATION_SIGNALLING 0x6F /**<\brief tag of application_signalling_descriptor */
  25. #define DESCR_DATA_BROADCAST_ID 0x66 /**<\brief tag of data_broadcast_id_descriptor */
  26. #define DESCR_APPLICATION_ICONS 0x0B /**<\brief tag of application_icons_descriptor */
  27. #define DESCR_EXTERNAL_APP_AUTH 0x05 /**<\brief tag of external_application_authorisation_descriptor */
  28. #define DESCR_CAROUSEL_IDENTIFIER 0x13 /**<\brief tag of carousel_identifier_descriptor */
  29. #define DESCR_GRAPHICS_CONSTRAINTS 0x14 /**<\brief tag of graphics_constraints_descriptor */
  30. #define DESCR_SIMPLE_APP_LOCATION 0x15 /**<\brief tag of simple_application_location_descriptor */
  31. #define DESCR_APPLICATION_USAGE 0x16 /**<\brief tag of application_usage_descriptor */
  32. #define DESCR_SIMPLE_APP_BOUNDARY 0x17 /**<\brief tag of simple_application_boundary_descriptor */
  33. #define DESCR_APPLICATION_STORAGE 0x10 /**<\brief tag of application_storage_descriptor */
  34. #define DESCR_SERVICE_IDENTIFIER 0x71 /**<\brief tag of service_identifier_descriptor */
  35. #define DESCR_CACHING_PRIORITY 0x71 /**<\brief tag of caching_priority_descriptor */
  36. #define DESCR_CONTENT_TYPE 0x72 /**<\brief tag of content_type_descriptor */
  37. /* application descriptor */
  38. typedef struct
  39. {
  40. UINT16 application_profile;
  41. UINT8 version_major;
  42. UINT8 version_minor;
  43. UINT8 version_micro;
  44. } AppProfile_t;
  45. typedef struct
  46. {
  47. UINT8 remote_connection;
  48. UINT16 original_network_id;
  49. UINT16 transport_stream_id;
  50. UINT16 service_id;
  51. UINT8 component_tag;
  52. } OC_transport_t;
  53. typedef struct
  54. {
  55. UINT8 URL_extension_length;
  56. UINT8 URL_extension_byte[256];
  57. } URL_externsion_t;
  58. typedef struct
  59. {
  60. UINT8 URL_base_length;
  61. UINT8 URL_base_byte[256];
  62. UINT8 URL_extension_count;
  63. URL_externsion_t *pstURL_externsion_t;
  64. } InterActive_transport_t;
  65. /* application descriptor */
  66. typedef struct
  67. {
  68. UINT8 profile_number;
  69. AppProfile_t *pstApp_profile;
  70. UINT8 service_bound_flag;
  71. UINT8 visibility;
  72. UINT8 application_priority;
  73. UINT8 transport_protocol_len;
  74. UINT8 *p_transport_protocol_label;
  75. } dvbpsi_application_dr_t;
  76. typedef struct dvbpsi_transport_protocol_dr_s
  77. {
  78. UINT16 protocol_id;
  79. UINT8 transport_protocol_label;
  80. OC_transport_t *pstOC_trans;
  81. InterActive_transport_t *pstInterAct_trans;
  82. struct dvbpsi_transport_protocol_dr_s *next;
  83. }dvbpsi_transport_protocol_dr_t;
  84. typedef struct
  85. {
  86. UINT8 label_len;
  87. UINT8 label[256];
  88. UINT8 storage_properties;
  89. } label_t;
  90. /* Application recording descriptor 5.3.5.4*/
  91. typedef struct
  92. {
  93. UINT8 scheduled_recording_flag;
  94. UINT8 trick_mode_aware_flag;
  95. UINT8 time_shift_flag;
  96. UINT8 dynamic_flag;
  97. UINT8 av_synced_flag;
  98. UINT8 initiating_replay_flag;
  99. UINT8 label_count;
  100. label_t *pstlabel;
  101. UINT8 component_tag_list_length;
  102. UINT8 component_tag[256];
  103. UINT8 private_length;
  104. UINT8 private_byte[256];
  105. } dvbpsi_application_recording_dr_t;
  106. /* application name descriptor */
  107. typedef struct dvbpsi_application_name_dr_s
  108. {
  109. UINT8 ISO_639_language_code[4];
  110. UINT8 application_name_length;
  111. UINT8 application_name_char[256];
  112. struct dvbpsi_application_name_dr_s *next;
  113. } dvbpsi_application_name_dr_t;
  114. /* Simple application location descriptor */
  115. typedef struct
  116. {
  117. UINT8 initial_path_len;
  118. UINT8 initial_path_bytes[256];
  119. } dvbpsi_simple_application_location_dr_t;
  120. /* Simple application boundary descriptor */
  121. typedef struct
  122. {
  123. UINT8 boundary_extension_count;
  124. URL_externsion_t *pstBoundary_t;
  125. } dvbpsi_simple_boundary_dr_t;
  126. /* data_broadcast_id_descriptor */
  127. typedef struct
  128. {
  129. UINT16 data_broadcast_id;
  130. //UINT8 specific_data[256];
  131. UINT16 application_type[128];
  132. } dvbpsi_data_broadcast_id_dr_t;
  133. typedef struct application_info_s
  134. {
  135. UINT32 organization_id;
  136. UINT16 application_id;
  137. UINT16 application_type;
  138. UINT8 app_profile_number;
  139. AppProfile_t *pst_profile;
  140. dvbpsi_application_name_dr_t *pst_Appname;
  141. struct application_info_s *next;
  142. } application_info_t;
  143. /* data broadcast descriptor */
  144. typedef struct
  145. {
  146. UINT16 data_broadcast_id;
  147. UINT8 component_tag;
  148. /*
  149. UINT8 selector_len;
  150. UINT8 selector[256];
  151. */
  152. /*
  153. when data_broadcast_id == 0x00F2, TS102809 5.3.9.1, following fields are defined
  154. */
  155. application_info_t *pst_AppInfo;
  156. UINT8 ISO_langugae_Code[4];
  157. UINT8 text_len;
  158. UINT8 text[256];
  159. } dvbpsi_broadcast_dr_t;
  160. /* Application storage descriptor */
  161. typedef struct
  162. {
  163. UINT8 storage_property;
  164. UINT8 not_launchable_from_broadcast;
  165. UINT8 launchable_completely_from_cache;
  166. UINT8 is_launchable_with_older_version;
  167. UINT32 version;
  168. UINT8 priority;
  169. } dvbpsi_Application_storage_dr_t;
  170. /* application_icons_descriptor */
  171. typedef struct
  172. {
  173. UINT8 icon_location_len;
  174. UINT8 icon_location[256];
  175. UINT16 icon_flags;
  176. } dvbpsi_application_icons_dr_t;
  177. /* external_application_authorization_descriptors */
  178. typedef struct dvbpsi_external_application_authorization_dr_s
  179. {
  180. UINT32 organisation_id;
  181. UINT16 application_id;
  182. UINT8 application_priority;
  183. struct dvbpsi_external_application_authorization_dr_s *next;
  184. } dvbpsi_external_application_authorization_dr_t;
  185. /* Graphics constraints descriptor, ETSI TS 102 809 V1.2.1 5.3.5.8 */
  186. typedef struct
  187. {
  188. UINT8 can_run_without_visible_ui;
  189. UINT8 handles_configuration_changed;
  190. UINT8 handles_externally_controlled_video;
  191. UINT8 graphics_configuration_byte[256];
  192. } dvbpsi_graphics_constraints_dr_t;
  193. /* Application usage descriptor, ETSI TS 102 809 V1.2.1 5.3.5.8 */
  194. typedef struct
  195. {
  196. UINT8 usage_type;
  197. } dvbpsi_application_usage_dr_t;
  198. /* caching_priority_descriptor */
  199. typedef struct
  200. {
  201. UINT8 priority_value;
  202. UINT8 transparency_level;
  203. } dvbpsi_caching_priority_dr_t;
  204. /* content_type_descriptor */
  205. typedef struct
  206. {
  207. UINT8 content_type_data_byte[256];
  208. } dvbpsi_content_type_dr_t;
  209. typedef struct
  210. {
  211. UINT32 carousel_id;
  212. UINT8 formatID;
  213. UINT8 ModuleVersion;
  214. UINT16 ModuleId;
  215. UINT16 BlockSize;
  216. UINT32 ModuleSize;
  217. UINT8 CompressionMethod;
  218. UINT32 OriginalSize;
  219. UINT8 TimeOut;
  220. UINT8 ObjectKeyLength;
  221. UINT8 ObjectKeyData[256];
  222. UINT8 private_data_len;
  223. UINT8 private_data[256];
  224. } dvbpsi_carousel_identifier_dr_t;
  225. typedef struct dvbpsi_application_signalling_dr_s
  226. {
  227. UINT16 application_type;
  228. UINT8 AIT_version_number;
  229. struct dvbpsi_application_signalling_dr_s *next;
  230. } dvbpsi_application_signalling_dr_t;
  231. dvbpsi_application_dr_t *decode_application_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  232. void dvbpsi_FreeApplication_dr(dvbpsi_application_dr_t * pDecoded);
  233. dvbpsi_application_recording_dr_t *decode_application_recording_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  234. void dvbpsi_FreeApplication_recording_dr(dvbpsi_application_recording_dr_t *pDecoded);
  235. dvbpsi_application_name_dr_t *decode_application_name_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  236. void dvbpsi_FreeApplication_name_dr(dvbpsi_application_name_dr_t *pDecoded);
  237. dvbpsi_simple_application_location_dr_t *decode_simple_application_location_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  238. void dvbpsi_FreeSimple_application_loc_dr(dvbpsi_simple_application_location_dr_t *pDecoded);
  239. dvbpsi_simple_boundary_dr_t *decode_simple_application_boundary_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  240. void dvbpsi_FreeSimple_boundary_dr(dvbpsi_simple_boundary_dr_t *pDecoded);
  241. dvbpsi_data_broadcast_id_dr_t *decode_data_broadcastid_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  242. void dvbpsi_FreeData_broadcastid_dr(dvbpsi_data_broadcast_id_dr_t *pDecoded);
  243. dvbpsi_broadcast_dr_t *decode_broadcast_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  244. void dvbpsi_FreeBroadcast_dr(dvbpsi_broadcast_dr_t *p_decoded);
  245. dvbpsi_Application_storage_dr_t *decode_application_storage_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  246. void dvbpsi_FreeApplication_storage_dr(dvbpsi_Application_storage_dr_t *pDecoded);
  247. dvbpsi_application_icons_dr_t *decode_application_icon_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  248. void dvbpsi_FreeApplication_icons_dr(dvbpsi_application_icons_dr_t *pDecoded);
  249. dvbpsi_external_application_authorization_dr_t *decode_external_application_auth_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  250. void dvbpsi_FreeExternal_application_auth_dr(dvbpsi_external_application_authorization_dr_t *pDecoded);
  251. dvbpsi_graphics_constraints_dr_t *decode_graphic_constraints_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  252. void dvbpsi_FreeGraphic_constraints_dr(dvbpsi_graphics_constraints_dr_t *pDecoded);
  253. dvbpsi_application_usage_dr_t *decode_application_usage_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  254. void dvbpsi_FreeAapplication_usage_dr(dvbpsi_application_usage_dr_t *pDecoded);
  255. dvbpsi_caching_priority_dr_t *decode_caching_priority_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  256. void dvbpsi_FreeCaching_priority_dr(dvbpsi_caching_priority_dr_t *pDecoded);
  257. dvbpsi_content_type_dr_t *decode_content_type_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  258. void dvbpsi_FreeContent_tpye_dr(dvbpsi_content_type_dr_t *pDecoded);
  259. dvbpsi_carousel_identifier_dr_t *decode_carousel_identifier_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  260. void dvbpsi_FreeCarousel_identifier_dr(dvbpsi_carousel_identifier_dr_t *pDecoded);
  261. dvbpsi_application_signalling_dr_t *decode_application_signalling_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  262. void dvbpsi_FreeApplication_sigalling_dr(dvbpsi_application_signalling_dr_t *pDecoded);
  263. dvbpsi_transport_protocol_dr_t *decode_transport_protocol_dr(UINT8 * pu8Descriptor, INT16 n16Len);
  264. void dvbpsi_FreeTransport_protocol_dr(dvbpsi_transport_protocol_dr_t *pDecoded);
  265. #endif