gst-dvb-section.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. /*
  2. * mpegtspacketizer.h -
  3. * Copyright (C) 2013 Edward Hervey
  4. *
  5. * Authors:
  6. * Edward Hervey <[email protected]>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  21. * Boston, MA 02110-1301, USA.
  22. */
  23. #ifndef GST_DVB_SECTION_H
  24. #define GST_DVB_SECTION_H
  25. #include <gst/gst.h>
  26. #include <gst/mpegts/gstmpegtssection.h>
  27. #include <gst/mpegts/gstmpegtsdescriptor.h>
  28. G_BEGIN_DECLS
  29. /**
  30. * GstMpegtsSectionDVBTableID:
  31. *
  32. * Values for a #GstMpegtsSection table_id.
  33. *
  34. * These are the registered DVB table_id variants.
  35. *
  36. * see also: #GstMpegtsSectionTableID
  37. */
  38. typedef enum {
  39. /* EN 300 468 (DVB) v 1.12.1 */
  40. GST_MTS_TABLE_ID_NETWORK_INFORMATION_ACTUAL_NETWORK = 0x40,
  41. GST_MTS_TABLE_ID_NETWORK_INFORMATION_OTHER_NETWORK = 0x41,
  42. GST_MTS_TABLE_ID_SERVICE_DESCRIPTION_ACTUAL_TS = 0x42,
  43. GST_MTS_TABLE_ID_SERVICE_DESCRIPTION_OTHER_TS = 0x46,
  44. GST_MTS_TABLE_ID_BOUQUET_ASSOCIATION = 0x4A,
  45. GST_MTS_TABLE_ID_EVENT_INFORMATION_ACTUAL_TS_PRESENT = 0x4E,
  46. GST_MTS_TABLE_ID_EVENT_INFORMATION_OTHER_TS_PRESENT = 0x4F,
  47. GST_MTS_TABLE_ID_EVENT_INFORMATION_ACTUAL_TS_SCHEDULE_1 = 0x50,
  48. GST_MTS_TABLE_ID_EVENT_INFORMATION_ACTUAL_TS_SCHEDULE_N = 0x5F,
  49. GST_MTS_TABLE_ID_EVENT_INFORMATION_OTHER_TS_SCHEDULE_1 = 0x60,
  50. GST_MTS_TABLE_ID_EVENT_INFORMATION_OTHER_TS_SCHEDULE_N = 0x6F,
  51. GST_MTS_TABLE_ID_TIME_DATE = 0x70,
  52. GST_MTS_TABLE_ID_RUNNING_STATUS = 0x71,
  53. GST_MTS_TABLE_ID_STUFFING = 0x72,
  54. GST_MTS_TABLE_ID_TIME_OFFSET = 0x73,
  55. /* TS 102 812 (MHP v1.1.3) */
  56. GST_MTS_TABLE_ID_APPLICATION_INFORMATION_TABLE = 0x74,
  57. /* TS 102 323 (DVB TV Anytime v1.5.1) */
  58. GST_MTS_TABLE_ID_CONTAINER = 0x75,
  59. GST_MTS_TABLE_ID_RELATED_CONTENT = 0x76,
  60. GST_MTS_TABLE_ID_CONTENT_IDENTIFIER = 0x77,
  61. /* EN 301 192 (DVB specification for data broadcasting) */
  62. GST_MTS_TABLE_ID_MPE_FEC = 0x78,
  63. /* TS 102 323 (DVB TV Anytime v1.5.1) */
  64. GST_MTS_TABLE_ID_RESOLUTION_NOTIFICATION = 0x79,
  65. /* TS 102 772 (DVB-SH Multi-Protocol Encapsulation) */
  66. GST_MTS_TABLE_ID_MPE_IFEC = 0x7A,
  67. /* EN 300 468 (DVB) v 1.12.1 */
  68. GST_MTS_TABLE_ID_DISCONTINUITY_INFORMATION = 0x7E,
  69. GST_MTS_TABLE_ID_SELECTION_INFORMATION = 0x7F,
  70. /* ETR 289 (DVB Support for use of scrambling and CA) */
  71. GST_MTS_TABLE_ID_CA_MESSAGE_ECM_0 = 0x80,
  72. GST_MTS_TABLE_ID_CA_MESSAGE_ECM_1 = 0x81,
  73. GST_MTS_TABLE_ID_CA_MESSAGE_SYSTEM_PRIVATE_1 = 0x82,
  74. GST_MTS_TABLE_ID_CA_MESSAGE_SYSTEM_PRIVATE_N = 0x8F,
  75. /* ... */
  76. /* EN 301 790 (DVB interaction channel for satellite distribution channels) */
  77. GST_MTS_TABLE_ID_SCT = 0xA0,
  78. GST_MTS_TABLE_ID_FCT = 0xA1,
  79. GST_MTS_TABLE_ID_TCT = 0xA2,
  80. GST_MTS_TABLE_ID_SPT = 0xA3,
  81. GST_MTS_TABLE_ID_CMT = 0xA4,
  82. GST_MTS_TABLE_ID_TBTP = 0xA5,
  83. GST_MTS_TABLE_ID_PCR_PACKET_PAYLOAD = 0xA6,
  84. GST_MTS_TABLE_ID_TRANSMISSION_MODE_SUPPORT_PAYLOAD = 0xAA,
  85. GST_MTS_TABLE_ID_TIM = 0xB0,
  86. GST_MTS_TABLE_ID_LL_FEC_PARITY_DATA_TABLE = 0xB1
  87. } GstMpegtsSectionDVBTableID;
  88. /**
  89. * GstMpegtsRunningStatus:
  90. *
  91. * Running status of a service.
  92. *
  93. * Corresponds to table 6 of ETSI EN 300 468 (v1.13.0)
  94. */
  95. typedef enum
  96. {
  97. GST_MPEGTS_RUNNING_STATUS_UNDEFINED = 0,
  98. GST_MPEGTS_RUNNING_STATUS_NOT_RUNNING,
  99. GST_MPEGTS_RUNNING_STATUS_STARTS_IN_FEW_SECONDS,
  100. GST_MPEGTS_RUNNING_STATUS_PAUSING,
  101. GST_MPEGTS_RUNNING_STATUS_RUNNING,
  102. GST_MPEGTS_RUNNING_STATUS_OFF_AIR
  103. } GstMpegtsRunningStatus;
  104. /* NIT */
  105. typedef struct _GstMpegtsNITStream GstMpegtsNITStream;
  106. typedef struct _GstMpegtsNIT GstMpegtsNIT;
  107. #define GST_TYPE_MPEGTS_NIT (gst_mpegts_nit_get_type())
  108. #define GST_TYPE_MPEGTS_NIT_STREAM (gst_mpegts_nit_stream_get_type())
  109. /**
  110. * GstMpegtsNITStream:
  111. * @transport_stream_id:
  112. * @original_network_id:
  113. * @descriptors: (element-type GstMpegtsDescriptor):
  114. *
  115. */
  116. struct _GstMpegtsNITStream
  117. {
  118. guint16 transport_stream_id;
  119. guint16 original_network_id;
  120. GPtrArray *descriptors;
  121. };
  122. /**
  123. * GstMpegtsNIT:
  124. * @actual_network: Whether this NIT corresponds to the actual stream
  125. * @network_id: ID of the network that this NIT describes
  126. * @descriptors: (element-type GstMpegtsDescriptor): the global descriptors
  127. * @streams: (element-type GstMpegtsNITStream): the streams
  128. *
  129. * Network Information Table (ISO/IEC 13818-1 / EN 300 468)
  130. *
  131. */
  132. struct _GstMpegtsNIT
  133. {
  134. gboolean actual_network;
  135. guint16 network_id;
  136. GPtrArray *descriptors;
  137. GPtrArray *streams;
  138. };
  139. GType gst_mpegts_nit_get_type (void);
  140. GType gst_mpegts_nit_stream_get_type (void);
  141. const GstMpegtsNIT *gst_mpegts_section_get_nit (GstMpegtsSection *section);
  142. GstMpegtsSection *gst_mpegts_section_from_nit (GstMpegtsNIT *nit);
  143. GstMpegtsNIT *gst_mpegts_nit_new (void);
  144. GstMpegtsNITStream *gst_mpegts_nit_stream_new (void);
  145. /* BAT */
  146. typedef struct _GstMpegtsBATStream GstMpegtsBATStream;
  147. typedef struct _GstMpegtsBAT GstMpegtsBAT;
  148. #define GST_TYPE_MPEGTS_BAT (gst_mpegts_bat_get_type())
  149. #define GST_TYPE_MPEGTS_BAT_STREAM (gst_mpegts_bat_get_type())
  150. struct _GstMpegtsBATStream
  151. {
  152. guint16 transport_stream_id;
  153. guint16 original_network_id;
  154. GPtrArray *descriptors;
  155. };
  156. /**
  157. * GstMpegtsBAT:
  158. * @descriptors: (element-type GstMpegtsDescriptor):
  159. * @streams: (element-type GstMpegtsBATStream):
  160. *
  161. * DVB Bouquet Association Table (EN 300 468)
  162. */
  163. struct _GstMpegtsBAT
  164. {
  165. GPtrArray *descriptors;
  166. GPtrArray *streams;
  167. };
  168. GType gst_mpegts_bat_get_type (void);
  169. GType gst_mpegts_bat_stream_get_type (void);
  170. const GstMpegtsBAT *gst_mpegts_section_get_bat (GstMpegtsSection *section);
  171. /* SDT */
  172. #define GST_TYPE_MPEGTS_SDT (gst_mpegts_sdt_get_type())
  173. #define GST_TYPE_MPEGTS_SDT_SERVICE (gst_mpegts_sdt_service_get_type())
  174. typedef struct _GstMpegtsSDTService GstMpegtsSDTService;
  175. typedef struct _GstMpegtsSDT GstMpegtsSDT;
  176. /**
  177. * GstMpegtsSDTService:
  178. * @service_id: The program number this table belongs to
  179. * @EIT_schedule_flag: EIT schedule information is present in this transport stream
  180. * @EIT_present_following_flag: EIT present/following information is present in this transport stream
  181. * @running_status: Status of this service
  182. * @free_CA_mode: True if one or more streams is controlled by a CA system
  183. * @descriptors: (element-type GstMpegtsDescriptor): List of descriptors
  184. *
  185. */
  186. struct _GstMpegtsSDTService
  187. {
  188. guint16 service_id;
  189. gboolean EIT_schedule_flag;
  190. gboolean EIT_present_following_flag;
  191. GstMpegtsRunningStatus running_status;
  192. gboolean free_CA_mode;
  193. GPtrArray *descriptors;
  194. };
  195. /**
  196. * GstMpegtsSDT:
  197. * @original_network_id: Network ID of the originating delivery system
  198. * @actual_ts: True if the table describes this transport stream
  199. * @transport_stream_id: ID of this transport stream
  200. * @services: (element-type GstMpegtsSDTService): List of services
  201. *
  202. * Service Description Table (EN 300 468)
  203. *
  204. */
  205. struct _GstMpegtsSDT
  206. {
  207. guint16 original_network_id;
  208. gboolean actual_ts;
  209. guint16 transport_stream_id;
  210. GPtrArray *services;
  211. };
  212. GType gst_mpegts_sdt_get_type (void);
  213. GType gst_mpegts_sdt_service_get_type (void);
  214. const GstMpegtsSDT *gst_mpegts_section_get_sdt (GstMpegtsSection *section);
  215. GstMpegtsSection *gst_mpegts_section_from_sdt (GstMpegtsSDT * sdt);
  216. GstMpegtsSDT *gst_mpegts_sdt_new (void);
  217. GstMpegtsSDTService *gst_mpegts_sdt_service_new (void);
  218. /* EIT */
  219. #define GST_TYPE_MPEGTS_EIT (gst_mpegts_eit_get_type())
  220. #define GST_TYPE_MPEGTS_EIT_EVENT (gst_mpegts_eit_event_get_type())
  221. typedef struct _GstMpegtsEITEvent GstMpegtsEITEvent;
  222. typedef struct _GstMpegtsEIT GstMpegtsEIT;
  223. /**
  224. * GstMpegtsEITEvent:
  225. * @descriptors: (element-type GstMpegtsDescriptor): List of descriptors
  226. *
  227. * Event from a @GstMpegtsEIT
  228. */
  229. struct _GstMpegtsEITEvent
  230. {
  231. guint16 event_id;
  232. GstDateTime *start_time;
  233. guint32 duration;
  234. GstMpegtsRunningStatus running_status;
  235. gboolean free_CA_mode;
  236. GPtrArray *descriptors;
  237. };
  238. /**
  239. * GstMpegtsEIT:
  240. * @events: (element-type GstMpegtsEITEvent): List of events
  241. *
  242. * Event Information Table (EN 300 468)
  243. *
  244. */
  245. struct _GstMpegtsEIT
  246. {
  247. guint16 transport_stream_id;
  248. guint16 original_network_id;
  249. guint8 segment_last_section_number;
  250. guint8 last_table_id;
  251. gboolean actual_stream;
  252. gboolean present_following;
  253. GPtrArray *events;
  254. };
  255. GType gst_mpegts_eit_get_type (void);
  256. GType gst_mpegts_eit_event_get_type (void);
  257. const GstMpegtsEIT *gst_mpegts_section_get_eit (GstMpegtsSection *section);
  258. /* TDT */
  259. GstDateTime *gst_mpegts_section_get_tdt (GstMpegtsSection *section);
  260. /* TOT */
  261. typedef struct _GstMpegtsTOT GstMpegtsTOT;
  262. #define GST_TYPE_MPEGTS_TOT (gst_mpegts_tot_get_type())
  263. /**
  264. * GstMpegtsTOT:
  265. * @descriptors: (element-type GstMpegtsDescriptor): List of descriptors
  266. *
  267. * Time Offset Table (EN 300 468)
  268. *
  269. */
  270. struct _GstMpegtsTOT
  271. {
  272. GstDateTime *utc_time;
  273. GPtrArray *descriptors;
  274. };
  275. GType gst_mpegts_tot_get_type (void);
  276. const GstMpegtsTOT *gst_mpegts_section_get_tot (GstMpegtsSection *section);
  277. G_END_DECLS
  278. #endif /* GST_MPEGTS_SECTION_H */