• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * mpegtspacketizer.h -
3  * Copyright (C) 2013 Edward Hervey
4  *
5  * Authors:
6  *   Edward Hervey <edward@collabora.com>
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 
24 #ifndef GST_MPEGTS_SECTION_H
25 #define GST_MPEGTS_SECTION_H
26 
27 #include <gst/gst.h>
28 #include <gst/mpegts/gstmpegtsdescriptor.h>
29 
30 G_BEGIN_DECLS
31 
32 typedef struct _GstMpegtsSection GstMpegtsSection;
33 
34 #define GST_TYPE_MPEGTS_SECTION (gst_mpegts_section_get_type())
35 #define GST_MPEGTS_SECTION(section) ((GstMpegtsSection*) section)
36 
37 #define GST_MPEGTS_SECTION_TYPE(section) (GST_MPEGTS_SECTION (section)->section_type)
38 
39 GST_MPEGTS_API
40 GType gst_mpegts_section_get_type (void);
41 
42 /**
43  * GstMpegtsSectionType:
44  * @GST_MPEGTS_SECTION_UNKNOWN: Unknown section type
45  * @GST_MPEGTS_SECTION_PAT: Program Association Table (ISO/IEC 13818-1)
46  * @GST_MPEGTS_SECTION_PMT: Program Map Table (ISO/IEC 13818-1)
47  * @GST_MPEGTS_SECTION_CAT: Conditional Access Table (ISO/IEC 13818-1)
48  * @GST_MPEGTS_SECTION_TSDT: Transport Stream Description Table (ISO/IEC 13818-1)
49  * @GST_MPEGTS_SECTION_EIT: Event Information Table (EN 300 468)
50  * @GST_MPEGTS_SECTION_NIT: Network Information Table (ISO/IEC 13818-1 / EN 300 468)
51  * @GST_MPEGTS_SECTION_BAT: Bouquet Association Table ((EN 300 468)
52  * @GST_MPEGTS_SECTION_SDT: Service Description Table (EN 300 468)
53  * @GST_MPEGTS_SECTION_TDT: Time and Date Table (EN 300 468)
54  * @GST_MPEGTS_SECTION_TOT: Time Offset Table (EN 300 468)
55  * @GST_MPEGTS_SECTION_ATSC_TVCT: ATSC Terrestrial Virtual Channel Table (A65)
56  * @GST_MPEGTS_SECTION_ATSC_CVCT: ATSC Cable Virtual Channel Table (A65)
57  * @GST_MPEGTS_SECTION_ATSC_MGT: ATSC Master Guide Table (A65)
58  * @GST_MPEGTS_SECTION_ATSC_ETT: ATSC Extended Text Table (A65)
59  * @GST_MPEGTS_SECTION_ATSC_EIT: ATSC Event Information Table (A65)
60  * @GST_MPEGTS_SECTION_ATSC_STT: ATSC System Time Table (A65)
61  * @GST_MPEGTS_SECTION_ATSC_RRT: ATSC Rating Region Table (A65)
62  * @GST_MPEGTS_SECTION_SCTE_SIT: SCTE Splice Information Table (SCTE-35)
63  *
64  * Types of #GstMpegtsSection that the library handles. This covers all the
65  * MPEG-TS and derivate specification that the library can properly identify and
66  * use.
67  */
68 typedef enum {
69   GST_MPEGTS_SECTION_UNKNOWN           = 0,
70   GST_MPEGTS_SECTION_PAT,
71   GST_MPEGTS_SECTION_PMT,
72   GST_MPEGTS_SECTION_CAT,
73   GST_MPEGTS_SECTION_TSDT,
74   GST_MPEGTS_SECTION_EIT,
75   GST_MPEGTS_SECTION_NIT,
76   GST_MPEGTS_SECTION_BAT,
77   GST_MPEGTS_SECTION_SDT,
78   GST_MPEGTS_SECTION_TDT,
79   GST_MPEGTS_SECTION_TOT,
80   /**
81    * GST_MPEGTS_SECTION_SIT:
82    *
83    * Selection Information Table (EN 300 468)
84    *
85    * Since: 1.20
86    */
87   GST_MPEGTS_SECTION_SIT,
88   GST_MPEGTS_SECTION_ATSC_TVCT,
89   GST_MPEGTS_SECTION_ATSC_CVCT,
90   GST_MPEGTS_SECTION_ATSC_MGT,
91   GST_MPEGTS_SECTION_ATSC_ETT,
92   GST_MPEGTS_SECTION_ATSC_EIT,
93   GST_MPEGTS_SECTION_ATSC_STT,
94   GST_MPEGTS_SECTION_ATSC_RRT,
95   GST_MPEGTS_SECTION_SCTE_SIT
96 } GstMpegtsSectionType;
97 
98 /**
99  * GstMpegtsSectionTableID:
100  * @GST_MTS_TABLE_ID_PROGRAM_ASSOCIATION: Program Association Table (PAT)
101  * @GST_MTS_TABLE_ID_CONDITIONAL_ACCESS: Conditional Access Table (CAT)
102  * @GST_MTS_TABLE_ID_TS_PROGRAM_MAP: Program Map Table (PMT)
103  * @GST_MTS_TABLE_ID_TS_DESCRIPTION: Transport Stream Description Table
104  * @GST_MTS_TABLE_ID_14496_SCENE_DESCRIPTION: ISO/IEC 14496 Scene Description Table
105  * @GST_MTS_TABLE_ID_14496_OBJET_DESCRIPTOR: ISO/IEC 14496 Object Descriptor Table
106  * @GST_MTS_TABLE_ID_METADATA: Metadata Section
107  * @GST_MTS_TABLE_ID_IPMP_CONTROL_INFORMATION: IPMP Control Information
108  * @GST_MTS_TABLE_ID_DSM_CC_MULTIPROTO_ENCAPSULATED_DATA: DSM-CC Multi-Protocol Encapsulated (MPE) Data
109  * @GST_MTS_TABLE_ID_DSM_CC_U_N_MESSAGES: DSM-CC U-N Messages
110  * @GST_MTS_TABLE_ID_DSM_CC_DOWNLOAD_DATA_MESSAGES: DSM-CC Download Data Messages
111  * @GST_MTS_TABLE_ID_DSM_CC_STREAM_DESCRIPTORS: DSM-CC Stream Descriptors
112  * @GST_MTS_TABLE_ID_DSM_CC_PRIVATE_DATA: DSM-CC Private Data
113  * @GST_MTS_TABLE_ID_DSM_CC_ADDRESSABLE_SECTIONS: DSM-CC Addressable Section
114  * @GST_MTS_TABLE_ID_UNSET: Unset section table_id (value is forbidden to use in actual sections)
115  *
116  * Values for a #GstMpegtsSection table_id
117  *
118  * These are the registered ITU H.222.0 | ISO/IEC 13818-1 table_id variants.
119  *
120  * see also #GstMpegtsSectionATSCTableID, #GstMpegtsSectionDVBTableID, and
121  * #GstMpegtsSectionSCTETableID
122  */
123 typedef enum {
124   /* ITU H.222.0 / IEC 13818-1 */
125   GST_MTS_TABLE_ID_PROGRAM_ASSOCIATION		= 0x00,
126   GST_MTS_TABLE_ID_CONDITIONAL_ACCESS		= 0x01,
127   GST_MTS_TABLE_ID_TS_PROGRAM_MAP		= 0x02,
128   GST_MTS_TABLE_ID_TS_DESCRIPTION		= 0x03,
129   GST_MTS_TABLE_ID_14496_SCENE_DESCRIPTION	= 0x04,
130   GST_MTS_TABLE_ID_14496_OBJET_DESCRIPTOR	= 0x05,
131   GST_MTS_TABLE_ID_METADATA			= 0x06,
132   GST_MTS_TABLE_ID_IPMP_CONTROL_INFORMATION	= 0x07,
133   /**
134    * GST_MTS_TABLE_ID_14496_SECTION:
135    *
136    * ISO/IEC 14496 Section.
137    *
138    * Since: 1.20
139    */
140   GST_MTS_TABLE_ID_14496_SECTION                = 0x08,
141 
142   /**
143    * GST_MTS_TABLE_ID_23001_11_SECTION:
144    *
145    * ISO/IEC 23001-11 (Green Access Unit) Section.
146    *
147    * Since: 1.20
148    */
149   GST_MTS_TABLE_ID_23001_11_SECTION		= 0x09,
150 
151   /**
152    * GST_MTS_TABLE_ID_23001_10_SECTION:
153    *
154    * ISO/ISO 23001-10 (Quality Access Unit) Section.
155    *
156    * Since: 1.20
157    */
158   GST_MTS_TABLE_ID_23001_10_SECTION		= 0x0A,
159 
160   /* 0x08 - 0x39 : ITU H.222.0 | ISO/IEC 13818-1 reserved */
161 
162   /* IEC 13818-6 (DSM-CC) */
163   GST_MTS_TABLE_ID_DSM_CC_MULTIPROTO_ENCAPSULATED_DATA	= 0x3A,
164   GST_MTS_TABLE_ID_DSM_CC_U_N_MESSAGES			= 0x3B,
165   GST_MTS_TABLE_ID_DSM_CC_DOWNLOAD_DATA_MESSAGES	= 0x3C,
166   GST_MTS_TABLE_ID_DSM_CC_STREAM_DESCRIPTORS		= 0x3D,
167   GST_MTS_TABLE_ID_DSM_CC_PRIVATE_DATA			= 0x3E,
168   GST_MTS_TABLE_ID_DSM_CC_ADDRESSABLE_SECTIONS		= 0x3F,
169 
170   /* Unset */
171   GST_MTS_TABLE_ID_UNSET = 0xFF
172 
173 } GstMpegtsSectionTableID;
174 
175 /**
176  * GstMpegtsPacketizeFunc: (attributes doc.skip=true)
177  */
178 typedef gboolean (*GstMpegtsPacketizeFunc) (GstMpegtsSection *section);
179 
180 /**
181  * GstMpegtsSection:
182  * @section_type: The type of section.
183  * @pid: The PID on which this section was found or belongs to.
184  * @table_id: The table id of this section. See %GstMpegtsSectionTableID and
185  *      derivates for more information.
186  * @subtable_extension: This meaning differs per section. See the documentation
187  *      of the parsed section type for the meaning of this field
188  * @version_number: Version of the section.
189  * @current_next_indicator: Applies to current/next stream or not
190  * @section_number: Number of the section (if multiple)
191  * @last_section_number: Number of the last expected section (if multiple)
192  * @crc: Checksum (if applicable)
193  *
194  * Mpeg-TS Section Information (SI) (ISO/IEC 13818-1) object.
195  */
196 struct _GstMpegtsSection
197 {
198   /*< private >*/
199   GstMiniObject parent;
200 
201   /*< public >*/
202   GstMpegtsSectionType   section_type;
203 
204   guint16       pid;
205   guint8        table_id;
206 
207   guint16       subtable_extension;
208   guint8        version_number;
209 
210   gboolean      current_next_indicator;
211 
212   guint8        section_number;
213   guint8        last_section_number;
214 
215   guint32       crc;
216 
217   /*< private >*/
218   /* data: Points to beginning of section data
219    * i.e. the first byte is the table_id field */
220   guint8       *data;
221   /* section_length: length of data (including final CRC if present) */
222   guint		section_length;
223   /* cached_parsed: cached copy of parsed section */
224   gpointer     *cached_parsed;
225   /* destroy_parsed: function to clear cached_parsed */
226   GDestroyNotify destroy_parsed;
227   /* offset: offset of the section within the container stream */
228   guint64       offset;
229   /* short_section: TRUE if section_syntax_indicator == 0
230    * FIXME : Maybe make public later on when allowing creation of
231    * sections to that people can create private short sections ? */
232   gboolean      short_section;
233 
234   GstMpegtsPacketizeFunc packetizer;
235 
236   /* Padding for future extension */
237   gpointer _gst_reserved[GST_PADDING];
238 };
239 
240 GST_MPEGTS_API
241 GBytes *gst_mpegts_section_get_data (GstMpegtsSection *section);
242 
243 /* PAT */
244 #define GST_TYPE_MPEGTS_PAT_PROGRAM (gst_mpegts_pat_program_get_type())
245 
246 typedef struct _GstMpegtsPatProgram GstMpegtsPatProgram;
247 /**
248  * GstMpegtsPatProgram:
249  * @program_number: the program number
250  * @network_or_program_map_PID: the network of program map PID
251  *
252  * A program entry from a Program Association Table (ITU H.222.0, ISO/IEC 13818-1).
253  */
254 struct _GstMpegtsPatProgram
255 {
256   guint16 program_number;
257   guint16 network_or_program_map_PID;
258 };
259 
260 GST_MPEGTS_API
261 GPtrArray *gst_mpegts_section_get_pat (GstMpegtsSection *section);
262 
263 GST_MPEGTS_API
264 GType gst_mpegts_pat_program_get_type (void);
265 
266 GST_MPEGTS_API
267 GPtrArray *gst_mpegts_pat_new (void);
268 
269 GST_MPEGTS_API
270 GstMpegtsPatProgram *gst_mpegts_pat_program_new (void);
271 
272 GST_MPEGTS_API
273 GstMpegtsSection *gst_mpegts_section_from_pat (GPtrArray * programs,
274     guint16 ts_id);
275 
276 /* CAT */
277 
278 GST_MPEGTS_API
279 GPtrArray *gst_mpegts_section_get_cat (GstMpegtsSection *section);
280 
281 /* PMT */
282 typedef struct _GstMpegtsPMTStream GstMpegtsPMTStream;
283 typedef struct _GstMpegtsPMT GstMpegtsPMT;
284 #define GST_TYPE_MPEGTS_PMT (gst_mpegts_pmt_get_type())
285 #define GST_TYPE_MPEGTS_PMT_STREAM (gst_mpegts_pmt_stream_get_type())
286 
287 /**
288  * GstMpegtsStreamType:
289  * @GST_MPEGTS_STREAM_TYPE_RESERVED_00: ITU-T | ISO/IEC Reserved
290  * @GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG1: ISO/IEC 11172-2 Video (i.e. MPEG-1 Video)
291  * @GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG2: Rec. ITU-T H.262 | ISO/IEC 13818-2
292  *       Video or ISO/IEC 11172-2 constrained parameter video stream (i.e.
293  *       MPEG-2 Video)
294  * @GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG1: ISO/IEC 11172-3 Audio
295  * @GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG2: ISO/IEC 13818-3 Audio
296  * @GST_MPEGTS_STREAM_TYPE_PRIVATE_SECTIONS: private sections
297  * @GST_MPEGTS_STREAM_TYPE_PRIVATE_PES_PACKETS: PES packets containing private data
298  * @GST_MPEGTS_STREAM_TYPE_MHEG: ISO/IEC 13522 MHEG
299  * @GST_MPEGTS_STREAM_TYPE_DSM_CC: Annex A DSM-CC
300  * @GST_MPEGTS_STREAM_TYPE_H_222_1: Rec. ITU-T H.222.1
301  * @GST_MPEGTS_STREAM_TYPE_DSMCC_A: ISO/IEC 13818-6 type A
302  * @GST_MPEGTS_STREAM_TYPE_DSMCC_B: ISO/IEC 13818-6 type B
303  * @GST_MPEGTS_STREAM_TYPE_DSMCC_C: ISO/IEC 13818-6 type C
304  * @GST_MPEGTS_STREAM_TYPE_DSMCC_D: ISO/IEC 13818-6 type D
305  * @GST_MPEGTS_STREAM_TYPE_AUXILIARY: auxiliary streams
306  * @GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_ADTS: ISO/IEC 13818-7 Audio (AAC) with ADTS
307  *       transport syntax
308  * @GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG4: ISO/IEC 14496-2 Visual (MPEG-4 Video)
309  * @GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_LATM: ISO/IEC 14496-3 Audio (AAC) with the LATM
310  *       transport syntax as defined in ISO/IEC 14496-3
311  * @GST_MPEGTS_STREAM_TYPE_SL_FLEXMUX_PES_PACKETS: ISO/IEC 14496-1
312  *       SL-packetized stream or FlexMux stream carried in PES packets
313  * @GST_MPEGTS_STREAM_TYPE_SL_FLEXMUX_SECTIONS: ISO/IEC 14496-1 SL-packetized
314  *       stream or FlexMux stream carried in ISO/IEC 14496_sections
315  * @GST_MPEGTS_STREAM_TYPE_SYNCHRONIZED_DOWNLOAD: ISO/IEC 13818-6 Synchronized
316  *       Download Protocol
317  * @GST_MPEGTS_STREAM_TYPE_METADATA_PES_PACKETS: Metadata carried in PES packets
318  * @GST_MPEGTS_STREAM_TYPE_METADATA_SECTIONS: Metadata carried in metadata_sections
319  * @GST_MPEGTS_STREAM_TYPE_METADATA_DATA_CAROUSEL: Metadata carried in ISO/IEC
320  *       13818-6 Data Carousel
321  * @GST_MPEGTS_STREAM_TYPE_METADATA_OBJECT_CAROUSEL: Metadata carried in
322  *       ISO/IEC 13818-6 Object Carousel
323  * @GST_MPEGTS_STREAM_TYPE_METADATA_SYNCHRONIZED_DOWNLOAD: Metadata carried in
324  *       ISO/IEC 13818-6 Synchronized Download Protocol
325  * @GST_MPEGTS_STREAM_TYPE_MPEG2_IPMP: IPMP stream (defined in ISO/IEC 13818-11,
326  *       MPEG-2 IPMP)
327  * @GST_MPEGTS_STREAM_TYPE_VIDEO_H264: AVC video stream conforming to one or
328  * more profiles defined in Annex A of Rec. ITU-T H.264 | ISO/IEC 14496-10 or
329  * AVC video sub-bitstream of SVC as defined in 2.1.78 or MVC base view
330  * sub-bitstream, as defined in 2.1.85, or AVC video sub-bitstream of MVC, as
331  * defined in 2.1.88
332  * @GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_CLEAN: ISO/IEC 14496-3 (AAC) Audio, without
333  *       using any additional transport syntax, such as DST, ALS and SLS
334  * @GST_MPEGTS_STREAM_TYPE_MPEG4_TIMED_TEXT: ISO/IEC 14496-17 Text
335  * @GST_MPEGTS_STREAM_TYPE_VIDEO_RVC: Auxiliary video stream as defined in
336  * ISO/IEC 23002-3
337  * @GST_MPEGTS_STREAM_TYPE_VIDEO_H264_SVC_SUB_BITSTREAM: SVC video sub-bitstream
338  * of an AVC video stream conforming to one or more profiles defined in Annex G
339  * of Rec. ITU-T H.264 | ISO/IEC 14496-10
340  * @GST_MPEGTS_STREAM_TYPE_VIDEO_H264_MVC_SUB_BITSTREAM: MVC video sub-bitstream
341  * of an AVC video stream conforming to one or more profiles defined in Annex H
342  * of Rec. ITU-T H.264 | ISO/IEC 14496-10
343  * @GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K: Video stream conforming to one or more
344  *       profiles as defined in Rec. ITU-T T.800 | ISO/IEC 15444-1 (i.e. JPEG 2000)
345  * @GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG2_STEREO_ADDITIONAL_VIEW: Additional view
346  * Rec. ITU-T H.262 | ISO/IEC 13818-2 video stream for service-compatible
347  * stereoscopic 3D services
348  * @GST_MPEGTS_STREAM_TYPE_VIDEO_H264_STEREO_ADDITIONAL_VIEW: Additional view
349  * Rec. ITU-T H.264 | ISO/IEC 14496-10 video stream conforming to one or more
350  * profiles defined in Annex A for service-compatible stereoscopic 3D services
351  * @GST_MPEGTS_STREAM_TYPE_VIDEO_HEVC: Rec. ITU-T H.265 | ISO/IEC 23008-2 video
352  *      stream or an HEVC temporal video sub-bitstream
353  * @GST_MPEGTS_STREAM_TYPE_IPMP_STREAM: IPMP stream
354  *
355  * Type of MPEG-TS stream type.
356  *
357  * These values correspond to the base standard registered types. Depending
358  * on the variant of mpeg-ts being used (Bluray, ATSC, DVB, ...), other
359  * types might also be used, but will not conflict with these.
360  *
361  * Corresponds to table 2-34 of ITU H.222.0 | ISO/IEC 13818-1
362  */
363 typedef enum {
364   GST_MPEGTS_STREAM_TYPE_RESERVED_00                  = 0x00,
365   GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG1                  = 0x01,
366   GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG2                  = 0x02,
367   GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG1                  = 0x03,
368   GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG2                  = 0x04,
369   GST_MPEGTS_STREAM_TYPE_PRIVATE_SECTIONS             = 0x05,
370   GST_MPEGTS_STREAM_TYPE_PRIVATE_PES_PACKETS          = 0x06,
371   GST_MPEGTS_STREAM_TYPE_MHEG                         = 0x07,
372   GST_MPEGTS_STREAM_TYPE_DSM_CC                       = 0x08,
373   GST_MPEGTS_STREAM_TYPE_H_222_1                      = 0x09,
374   GST_MPEGTS_STREAM_TYPE_DSMCC_A                      = 0x0a,
375   GST_MPEGTS_STREAM_TYPE_DSMCC_B                      = 0x0b,
376   GST_MPEGTS_STREAM_TYPE_DSMCC_C                      = 0x0c,
377   GST_MPEGTS_STREAM_TYPE_DSMCC_D                      = 0x0d,
378   GST_MPEGTS_STREAM_TYPE_AUXILIARY                    = 0x0e,
379   GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_ADTS               = 0x0f,
380   GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG4                  = 0x10,
381   GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_LATM               = 0x11,
382   GST_MPEGTS_STREAM_TYPE_SL_FLEXMUX_PES_PACKETS       = 0x12,
383   GST_MPEGTS_STREAM_TYPE_SL_FLEXMUX_SECTIONS          = 0x13,
384   GST_MPEGTS_STREAM_TYPE_SYNCHRONIZED_DOWNLOAD        = 0x14,
385   GST_MPEGTS_STREAM_TYPE_METADATA_PES_PACKETS         = 0x15,
386   GST_MPEGTS_STREAM_TYPE_METADATA_SECTIONS            = 0x16,
387   GST_MPEGTS_STREAM_TYPE_METADATA_DATA_CAROUSEL       = 0x17,
388   GST_MPEGTS_STREAM_TYPE_METADATA_OBJECT_CAROUSEL     = 0x18,
389   GST_MPEGTS_STREAM_TYPE_METADATA_SYNCHRONIZED_DOWNLOAD  = 0x19,
390   GST_MPEGTS_STREAM_TYPE_MPEG2_IPMP                   = 0x1a,
391   GST_MPEGTS_STREAM_TYPE_VIDEO_H264                   = 0x1b,
392   GST_MPEGTS_STREAM_TYPE_AUDIO_AAC_CLEAN              = 0x1c,
393   GST_MPEGTS_STREAM_TYPE_MPEG4_TIMED_TEXT             = 0x1d,
394   GST_MPEGTS_STREAM_TYPE_VIDEO_RVC                    = 0x1e,
395   GST_MPEGTS_STREAM_TYPE_VIDEO_H264_SVC_SUB_BITSTREAM = 0x1f,
396   GST_MPEGTS_STREAM_TYPE_VIDEO_H264_MVC_SUB_BITSTREAM = 0x20,
397   GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K                   = 0x21,
398   GST_MPEGTS_STREAM_TYPE_VIDEO_MPEG2_STEREO_ADDITIONAL_VIEW = 0x22,
399   GST_MPEGTS_STREAM_TYPE_VIDEO_H264_STEREO_ADDITIONAL_VIEW  = 0x23,
400   GST_MPEGTS_STREAM_TYPE_VIDEO_HEVC                   = 0x24,
401   /* 0x24 - 0x7e : Rec. ITU-T H.222.0 | ISO/IEC 13818-1 Reserved */
402   GST_MPEGTS_STREAM_TYPE_IPMP_STREAM                  = 0x7f,
403   /* 0x80 - 0xff : User Private (or defined in other specs) */
404 
405   /**
406    * GST_MPEGTS_STREAM_TYPE_USER_PRIVATE_EA:
407    *
408    * User Private stream id (used for VC-1) as defined by SMPTE RP227.
409    *
410    * Since: 1.20
411    */
412   GST_MPEGTS_STREAM_TYPE_USER_PRIVATE_EA              = 0xea,
413 } GstMpegtsStreamType;
414 
415 /**
416  * GstMpegtsPMTStream:
417  * @stream_type: the type of stream. See #GstMpegtsStreamType
418  * @pid: the PID of the stream
419  * @descriptors: (element-type GstMpegtsDescriptor): the descriptors of the
420  * stream
421  *
422  * An individual stream definition of a #GstMpegtsPMT.
423  */
424 struct _GstMpegtsPMTStream
425 {
426   guint8      stream_type;
427   guint16     pid;
428 
429   GPtrArray  *descriptors;
430 };
431 
432 /**
433  * GstMpegtsPMT:
434  * @pcr_pid: PID of the stream containing the PCR for this program.
435  * @program_number: The program to which this PMT is applicable.
436  * @descriptors: (element-type GstMpegtsDescriptor): Array of #GstMpegtsDescriptor
437  * @streams: (element-type GstMpegtsPMTStream): Array of #GstMpegtsPMTStream
438  *
439  * Program Map Table (ISO/IEC 13818-1). Provides the mappings between program
440  * numbers and the program elements that comprise them.
441  *
442  * The program_number is contained in the subtable_extension field of the
443  * container #GstMpegtsSection.
444  */
445 struct _GstMpegtsPMT
446 {
447   guint16    pcr_pid;
448   guint16    program_number;
449 
450   GPtrArray *descriptors;
451   GPtrArray *streams;
452 };
453 
454 GST_MPEGTS_API
455 GType gst_mpegts_pmt_get_type (void);
456 
457 GST_MPEGTS_API
458 GType gst_mpegts_pmt_stream_get_type (void);
459 
460 GST_MPEGTS_API
461 GstMpegtsPMT *gst_mpegts_pmt_new (void);
462 
463 GST_MPEGTS_API
464 GstMpegtsPMTStream *gst_mpegts_pmt_stream_new (void);
465 
466 GST_MPEGTS_API
467 const GstMpegtsPMT *gst_mpegts_section_get_pmt (GstMpegtsSection *section);
468 
469 GST_MPEGTS_API
470 GstMpegtsSection *gst_mpegts_section_from_pmt (GstMpegtsPMT *pmt, guint16 pid);
471 
472 /* TSDT */
473 
474 GST_MPEGTS_API
475 GPtrArray *gst_mpegts_section_get_tsdt (GstMpegtsSection *section);
476 
477 
478 /* generic */
479 
480 #define gst_mpegts_section_ref(section)   ((GstMpegtsSection*) gst_mini_object_ref (GST_MINI_OBJECT_CAST (section)))
481 #define gst_mpegts_section_unref(section) (gst_mini_object_unref (GST_MINI_OBJECT_CAST (section)))
482 
483 GST_MPEGTS_API
484 GstMessage *gst_message_new_mpegts_section (GstObject *parent, GstMpegtsSection *section);
485 
486 GST_MPEGTS_API
487 GstEvent *gst_event_new_mpegts_section (GstMpegtsSection * section);
488 
489 GST_MPEGTS_API
490 gboolean gst_mpegts_section_send_event (GstMpegtsSection * section, GstElement * element);
491 
492 GST_MPEGTS_API
493 GstMpegtsSection *gst_event_parse_mpegts_section (GstEvent * event);
494 
495 GST_MPEGTS_API
496 GstMpegtsSection *gst_message_parse_mpegts_section (GstMessage *message);
497 
498 GST_MPEGTS_API
499 GstMpegtsSection *gst_mpegts_section_new (guint16 pid,
500 					   guint8 * data,
501 					   gsize data_size);
502 
503 GST_MPEGTS_API
504 guint8 *gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size);
505 
506 G_END_DECLS
507 
508 #endif				/* GST_MPEGTS_SECTION_H */
509