1 /*
2  * gstmpegtsdescriptor.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  * Some parts of this code come from the Fluendo MPEG Demuxer plugin.
24  *
25  * The Initial Developer of the Original Code is Fluendo, S.L.
26  * Portions created by Fluendo, S.L. are Copyright (C) 2005
27  * Fluendo, S.L. All Rights Reserved.
28  *
29  * Contributor(s): Wim Taymans <wim@fluendo.com>
30  */
31 
32 #ifndef GST_DVB_DESCRIPTOR_H
33 #define GST_DVB_DESCRIPTOR_H
34 
35 #include <gst/gst.h>
36 #include <gst/mpegts/mpegts-prelude.h>
37 
38 G_BEGIN_DECLS
39 
40 /**
41  * GstMpegtsDVBDescriptorType:
42  *
43  * The type of #GstMpegtsDescriptor
44  *
45  * These values correspond to the registered descriptor type from
46  * the various DVB specifications.
47  *
48  * Consult the relevant specifications for more details.
49  */
50 typedef enum {
51   /* 64-127 DVB tags ETSI EN 300 468
52    * (Specification for Service Information (SI) in DVB systems)
53    */
54   GST_MTS_DESC_DVB_NETWORK_NAME                 = 0x40,
55   GST_MTS_DESC_DVB_SERVICE_LIST                 = 0x41,
56   GST_MTS_DESC_DVB_STUFFING                     = 0x42,
57   GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM    = 0x43,
58   GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM        = 0x44,
59   GST_MTS_DESC_DVB_VBI_DATA                     = 0x45,
60   GST_MTS_DESC_DVB_VBI_TELETEXT                 = 0x46,
61   GST_MTS_DESC_DVB_BOUQUET_NAME                 = 0x47,
62   GST_MTS_DESC_DVB_SERVICE                      = 0x48,
63   GST_MTS_DESC_DVB_COUNTRY_AVAILABILITY         = 0x49,
64   GST_MTS_DESC_DVB_LINKAGE                      = 0x4A,
65   GST_MTS_DESC_DVB_NVOD_REFERENCE               = 0x4B,
66   GST_MTS_DESC_DVB_TIME_SHIFTED_SERVICE         = 0x4C,
67   GST_MTS_DESC_DVB_SHORT_EVENT                  = 0x4D,
68   GST_MTS_DESC_DVB_EXTENDED_EVENT               = 0x4E,
69   GST_MTS_DESC_DVB_TIME_SHIFTED_EVENT           = 0x4F,
70   GST_MTS_DESC_DVB_COMPONENT                    = 0x50,
71   GST_MTS_DESC_DVB_MOSAIC                       = 0x51,
72   GST_MTS_DESC_DVB_STREAM_IDENTIFIER            = 0x52,
73   GST_MTS_DESC_DVB_CA_IDENTIFIER                = 0x53,
74   GST_MTS_DESC_DVB_CONTENT                      = 0x54,
75   GST_MTS_DESC_DVB_PARENTAL_RATING              = 0x55,
76   GST_MTS_DESC_DVB_TELETEXT                     = 0x56,
77   GST_MTS_DESC_DVB_TELEPHONE                    = 0x57,
78   GST_MTS_DESC_DVB_LOCAL_TIME_OFFSET            = 0x58,
79   GST_MTS_DESC_DVB_SUBTITLING                   = 0x59,
80   GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM  = 0x5A,
81   GST_MTS_DESC_DVB_MULTILINGUAL_NETWORK_NAME    = 0x5B,
82   GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME    = 0x5C,
83   GST_MTS_DESC_DVB_MULTILINGUAL_SERVICE_NAME    = 0x5D,
84   GST_MTS_DESC_DVB_MULTILINGUAL_COMPONENT       = 0x5E,
85   GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER       = 0x5F,
86   GST_MTS_DESC_DVB_SERVICE_MOVE                 = 0x60,
87   GST_MTS_DESC_DVB_SHORT_SMOOTHING_BUFFER       = 0x61,
88   GST_MTS_DESC_DVB_FREQUENCY_LIST               = 0x62,
89   GST_MTS_DESC_DVB_PARTIAL_TRANSPORT_STREAM     = 0x63,
90   GST_MTS_DESC_DVB_DATA_BROADCAST               = 0x64,
91   GST_MTS_DESC_DVB_SCRAMBLING                   = 0x65,
92   GST_MTS_DESC_DVB_DATA_BROADCAST_ID            = 0x66,
93   GST_MTS_DESC_DVB_TRANSPORT_STREAM             = 0x67,
94   GST_MTS_DESC_DVB_DSNG                         = 0x68,
95   GST_MTS_DESC_DVB_PDC                          = 0x69,
96   GST_MTS_DESC_DVB_AC3                          = 0x6A,
97   GST_MTS_DESC_DVB_ANCILLARY_DATA               = 0x6B,
98   GST_MTS_DESC_DVB_CELL_LIST                    = 0x6C,
99   GST_MTS_DESC_DVB_CELL_FREQUENCY_LINK          = 0x6D,
100   GST_MTS_DESC_DVB_ANNOUNCEMENT_SUPPORT         = 0x6E,
101   GST_MTS_DESC_DVB_APPLICATION_SIGNALLING       = 0x6F,
102   GST_MTS_DESC_DVB_ADAPTATION_FIELD_DATA        = 0x70,
103   GST_MTS_DESC_DVB_SERVICE_IDENTIFIER           = 0x71,
104   GST_MTS_DESC_DVB_SERVICE_AVAILABILITY         = 0x72,
105   GST_MTS_DESC_DVB_DEFAULT_AUTHORITY            = 0x73,
106   GST_MTS_DESC_DVB_RELATED_CONTENT              = 0x74,
107   GST_MTS_DESC_DVB_TVA_ID                       = 0x75,
108   GST_MTS_DESC_DVB_CONTENT_IDENTIFIER           = 0x76,
109   GST_MTS_DESC_DVB_TIMESLICE_FEC_IDENTIFIER     = 0x77,
110   GST_MTS_DESC_DVB_ECM_REPETITION_RATE          = 0x78,
111   GST_MTS_DESC_DVB_S2_SATELLITE_DELIVERY_SYSTEM = 0x79,
112   GST_MTS_DESC_DVB_ENHANCED_AC3                 = 0x7A,
113   GST_MTS_DESC_DVB_DTS                          = 0x7B,
114   GST_MTS_DESC_DVB_AAC                          = 0x7C,
115   GST_MTS_DESC_DVB_XAIT_LOCATION                = 0x7D,
116   GST_MTS_DESC_DVB_FTA_CONTENT_MANAGEMENT       = 0x7E,
117   GST_MTS_DESC_DVB_EXTENSION                    = 0x7F,
118 } GstMpegtsDVBDescriptorType;
119 
120 /**
121  * GstMpegtsDVBExtendedDescriptorType:
122  *
123  * The type of #GstMpegtsDescriptor
124  *
125  * These values correspond to the registered extended descriptor
126  * type from the various DVB specifications.
127  *
128  * Consult the relevant specifications for more details.
129  */
130 typedef enum {
131   /* 00 - 0x7F DVB extended tags ETSI EN 300 468
132    * (Specification for Service Information (SI) in DVB systems)
133    */
134   GST_MTS_DESC_EXT_DVB_IMAGE_ICON               = 0x00,
135   /* TS/TR 102 825 */
136   GST_MTS_DESC_EXT_DVB_CPCM_DELIVERY_SIGNALLING = 0x01,
137   GST_MTS_DESC_EXT_DVB_CP                       = 0x02,
138   GST_MTS_DESC_EXT_DVB_CP_IDENTIFIER            = 0x03,
139   GST_MTS_DESC_EXT_DVB_T2_DELIVERY_SYSTEM       = 0x04,
140   GST_MTS_DESC_EXT_DVB_SH_DELIVERY_SYSTEM       = 0x05,
141   GST_MTS_DESC_EXT_DVB_SUPPLEMENTARY_AUDIO      = 0x06,
142   GST_MTS_DESC_EXT_DVB_NETWORK_CHANGE_NOTIFY    = 0x07,
143   GST_MTS_DESC_EXT_DVB_MESSAGE                  = 0x08,
144   GST_MTS_DESC_EXT_DVB_TARGET_REGION            = 0x09,
145   GST_MTS_DESC_EXT_DVB_TARGET_REGION_NAME       = 0x0A,
146   GST_MTS_DESC_EXT_DVB_SERVICE_RELOCATED        = 0x0B,
147   GST_MTS_DESC_EXT_DVB_XAIT_PID                 = 0x0C,
148   GST_MTS_DESC_EXT_DVB_C2_DELIVERY_SYSTEM       = 0x0D,
149   GST_MTS_DESC_EXT_DVB_DTS_HD_AUDIO_STREAM      = 0x0E,
150   GST_MTS_DESC_EXT_DVB_DTS_NEUTRAL              = 0x0F,
151   GST_MTS_DESC_EXT_DVB_VIDEO_DEPTH_RANGE        = 0x10,
152   GST_MTS_DESC_EXT_DVB_T2MI                     = 0x11,
153   GST_MTS_DESC_EXT_DVB_URI_LINKAGE              = 0x13,
154 } GstMpegtsDVBExtendedDescriptorType;
155 
156 /* GST_MTS_DESC_DVB_CAROUSEL_IDENTIFIER (0x13) */
157 /* FIXME : Implement */
158 
159 /* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */
160 
161 GST_MPEGTS_API
162 gboolean gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegtsDescriptor *descriptor,
163 						       gchar **name);
164 
165 GST_MPEGTS_API
166 GstMpegtsDescriptor *gst_mpegts_descriptor_from_dvb_network_name (const gchar * name);
167 
168 /* GST_MTS_DESC_DVB_STUFFING (0x42) */
169 
170 GST_MPEGTS_API
171 gboolean gst_mpegts_descriptor_parse_dvb_stuffing (const GstMpegtsDescriptor * descriptor,
172                                                    guint8 ** stuffing_bytes);
173 
174 
175 /* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */
176 typedef struct _GstMpegtsSatelliteDeliverySystemDescriptor GstMpegtsSatelliteDeliverySystemDescriptor;
177 
178 typedef enum {
179   GST_MPEGTS_MODULATION_QPSK    = 0,
180   GST_MPEGTS_MODULATION_QAM_16,
181   GST_MPEGTS_MODULATION_QAM_32,
182   GST_MPEGTS_MODULATION_QAM_64,
183   GST_MPEGTS_MODULATION_QAM_128,
184   GST_MPEGTS_MODULATION_QAM_256,
185   GST_MPEGTS_MODULATION_QAM_AUTO,
186   GST_MPEGTS_MODULATION_VSB_8,
187   GST_MPEGTS_MODULATION_VSB_16,
188   GST_MPEGTS_MODULATION_PSK_8,
189   GST_MPEGTS_MODULATION_APSK_16,
190   GST_MPEGTS_MODULATION_APSK_32,
191   GST_MPEGTS_MODULATION_DQPSK,
192   GST_MPEGTS_MODULATION_QAM_4_NR_,
193   GST_MPEGTS_MODULATION_NONE
194 } GstMpegtsModulationType;
195 
196 typedef enum {
197   GST_MPEGTS_FEC_NONE = 0,
198   GST_MPEGTS_FEC_1_2,
199   GST_MPEGTS_FEC_2_3,
200   GST_MPEGTS_FEC_3_4,
201   GST_MPEGTS_FEC_4_5,
202   GST_MPEGTS_FEC_5_6,
203   GST_MPEGTS_FEC_6_7,
204   GST_MPEGTS_FEC_7_8,
205   GST_MPEGTS_FEC_8_9,
206   GST_MPEGTS_FEC_AUTO,
207   GST_MPEGTS_FEC_3_5,
208   GST_MPEGTS_FEC_9_10,
209   GST_MPEGTS_FEC_2_5
210 } GstMpegtsDVBCodeRate;
211 
212 typedef enum {
213   GST_MPEGTS_ROLLOFF_35 = 0,
214   GST_MPEGTS_ROLLOFF_20,
215   GST_MPEGTS_ROLLOFF_25,
216   GST_MPEGTS_ROLLOFF_RESERVED,
217   GST_MPEGTS_ROLLOFF_AUTO
218 } GstMpegtsSatelliteRolloff;
219 
220 typedef enum {
221   GST_MPEGTS_POLARIZATION_LINEAR_HORIZONTAL = 0,
222   GST_MPEGTS_POLARIZATION_LINEAR_VERTICAL,
223   GST_MPEGTS_POLARIZATION_CIRCULAR_LEFT,
224   GST_MPEGTS_POLARIZATION_CIRCULAR_RIGHT
225 } GstMpegtsSatellitePolarizationType;
226 
227 /**
228  * GstMpegtsSatelliteDeliverySystemDescriptor:
229  * @frequency: the frequency in kHz (kiloHertz)
230  * @orbital_position: the orbital position in degrees
231  * @west_east: If %TRUE, the satellite is in the eastern part of the orbit,
232  * else in the western part.
233  * @polarization: The polarization of the transmitted signal
234  * @roll_off: Roll-off factor used in DVB-S2
235  * @modulation_system: modulation system, %TRUE if DVB-S2, else DVB-S
236  * @modulation_type: Modulation scheme used
237  * @symbol_rate: Symbol rate (in symbols per second)
238  * @fec_inner: inner FEC scheme used
239  *
240  * Satellite Delivery System Descriptor (EN 300 468 v.1.13.1)
241  */
242 struct _GstMpegtsSatelliteDeliverySystemDescriptor
243 {
244   guint32                            frequency;
245   gfloat                             orbital_position;
246   gboolean                           west_east;
247   GstMpegtsSatellitePolarizationType polarization;
248 
249   GstMpegtsSatelliteRolloff          roll_off;
250   gboolean                           modulation_system;
251   GstMpegtsModulationType            modulation_type;
252 
253   guint32                            symbol_rate;
254   GstMpegtsDVBCodeRate               fec_inner;
255 };
256 
257 #define GST_TYPE_MPEGTS_SATELLITE_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_satellite_delivery_system_descriptor_get_type())
258 
259 GST_MPEGTS_API
260 GType gst_mpegts_satellite_delivery_system_descriptor_get_type(void);
261 
262 GST_MPEGTS_API
263 gboolean gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegtsDescriptor *descriptor,
264 								GstMpegtsSatelliteDeliverySystemDescriptor *res);
265 
266 
267 /* GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM (0x44) */
268 typedef enum {
269   GST_MPEGTS_CABLE_OUTER_FEC_UNDEFINED = 0,
270   GST_MPEGTS_CABLE_OUTER_FEC_NONE,
271   GST_MPEGTS_CABLE_OUTER_FEC_RS_204_188,
272 } GstMpegtsCableOuterFECScheme;
273 
274 typedef struct _GstMpegtsCableDeliverySystemDescriptor GstMpegtsCableDeliverySystemDescriptor;
275 /**
276  * GstMpegtsCableDeliverySystemDescriptor:
277  * @frequency: the frequency in Hz (Hertz)
278  * @outer_fec: the outer FEC scheme used
279  * @modulation: Modulation scheme used
280  * @symbol_rate: Symbol rate (in symbols per second)
281  * @fec_inner: inner FEC scheme used
282  *
283  * Cable Delivery System Descriptor (EN 300 468 v.1.13.1)
284  */
285 struct _GstMpegtsCableDeliverySystemDescriptor
286 {
287   guint32                            frequency;
288   GstMpegtsCableOuterFECScheme       outer_fec;
289   GstMpegtsModulationType            modulation;
290 
291   guint32                            symbol_rate;
292   GstMpegtsDVBCodeRate               fec_inner;
293 };
294 
295 #define GST_TYPE_MPEGTS_DVB_CABLE_DELIVERY_SYSTEM_DESCRIPTOR ( gst_mpegts_dvb_cable_system_delivery_descriptor_get_type())
296 
297 GST_MPEGTS_API
298 GType gst_mpegts_dvb_cable_delivery_system_descriptor_get_type (void);
299 
300 GST_MPEGTS_API
301 gboolean gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegtsDescriptor *descriptor,
302 							    GstMpegtsCableDeliverySystemDescriptor *res);
303 
304 GST_MPEGTS_API
305 void gst_mpegts_dvb_cable_delivery_system_descriptor_free (GstMpegtsCableDeliverySystemDescriptor * source);
306 
307 /* GST_MTS_DESC_DVB_BOUQUET_NAME (0x47) */
308 
309 GST_MPEGTS_API
310 gboolean gst_mpegts_descriptor_parse_dvb_bouquet_name (const GstMpegtsDescriptor * descriptor,
311                                                        gchar ** bouquet_name);
312 
313 /* GST_MTS_DESC_DVB_SERVICE (0x48) */
314 /**
315  * GstMpegtsDVBServiceType:
316  *
317  * The type of service of a channel.
318  *
319  * As specified in Table 87 of ETSI EN 300 468 v1.13.1
320  */
321 typedef enum {
322   GST_DVB_SERVICE_RESERVED_00               = 0x00,
323   GST_DVB_SERVICE_DIGITAL_TELEVISION,
324   GST_DVB_SERVICE_DIGITAL_RADIO_SOUND,
325   GST_DVB_SERVICE_TELETEXT,
326   GST_DVB_SERVICE_NVOD_REFERENCE,
327   GST_DVB_SERVICE_NVOD_TIME_SHIFTED,
328   GST_DVB_SERVICE_MOSAIC,
329   GST_DVB_SERVICE_FM_RADIO,
330   GST_DVB_SERVICE_DVB_SRM,
331   GST_DVB_SERVICE_RESERVED_09,
332   GST_DVB_SERVICE_ADVANCED_CODEC_DIGITAL_RADIO_SOUND,
333   GST_DVB_SERVICE_ADVANCED_CODEC_MOSAIC,
334   GST_DVB_SERVICE_DATA_BROADCAST,
335   GST_DVB_SERVICE_RESERVED_0D_COMMON_INTERFACE,
336   GST_DVB_SERVICE_RCS_MAP,
337   GST_DVB_SERVICE_RCS_FLS,
338   GST_DVB_SERVICE_DVB_MHP,
339   GST_DVB_SERVICE_MPEG2_HD_DIGITAL_TELEVISION,
340   /* 0x12 - 015 Reserved for future use */
341   GST_DVB_SERVICE_ADVANCED_CODEC_SD_DIGITAL_TELEVISION = 0x16,
342   GST_DVB_SERVICE_ADVANCED_CODEC_SD_NVOD_TIME_SHIFTED,
343   GST_DVB_SERVICE_ADVANCED_CODEC_SD_NVOD_REFERENCE,
344   GST_DVB_SERVICE_ADVANCED_CODEC_HD_DIGITAL_TELEVISION,
345   GST_DVB_SERVICE_ADVANCED_CODEC_HD_NVOD_TIME_SHIFTED,
346   GST_DVB_SERVICE_ADVANCED_CODEC_HD_NVOD_REFERENCE,
347   GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_DIGITAL_TELEVISION,
348   GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_NVOD_TIME_SHIFTED,
349   GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_NVOD_REFERENCE,
350   /* 0x1F - 0x7f Reserved for future use */
351   /* 0x80 - 0xfe user defined */
352   /* 0xff Reserved for future use */
353   GST_DVB_SERVICE_RESERVED_FF
354 } GstMpegtsDVBServiceType;
355 
356 GST_MPEGTS_API
357 gboolean gst_mpegts_descriptor_parse_dvb_service (const GstMpegtsDescriptor *descriptor,
358 						  GstMpegtsDVBServiceType *service_type,
359 						  gchar **service_name,
360 						  gchar **provider_name);
361 
362 GST_MPEGTS_API
363 GstMpegtsDescriptor *gst_mpegts_descriptor_from_dvb_service (GstMpegtsDVBServiceType service_type,
364 							     const gchar * service_name,
365 							     const gchar * service_provider);
366 
367 /* GST_MTS_DESC_DVB_SERVICE_LIST (0x41) */
368 typedef struct _GstMpegtsDVBServiceListItem GstMpegtsDVBServiceListItem;
369 
370 /**
371  * GstMpegtsDVBServiceListItem:
372  * @service_id: the id of a service
373  * @type: the type of a service
374  */
375 struct _GstMpegtsDVBServiceListItem
376 {
377   guint16                 service_id;
378   GstMpegtsDVBServiceType type;
379 };
380 
381 #define GST_TYPE_MPEGTS_DVB_SERVICE_LIST_ITEM (gst_mpegts_dvb_service_list_item_get_type ())
382 
383 GST_MPEGTS_API
384 GType gst_mpegts_dvb_service_list_item_get_type (void);
385 
386 GST_MPEGTS_API
387 gboolean gst_mpegts_descriptor_parse_dvb_service_list (const GstMpegtsDescriptor * descriptor,
388     GPtrArray ** list);
389 
390 /* GST_MTS_DESC_DVB_LINKAGE (0x4A) */
391 /**
392  * GstMpegtsDVBLinkageType:
393  *
394  * Linkage Type (EN 300 468 v.1.13.1)
395  */
396 typedef enum {
397   /* 0x00, 0x0F-0x7F reserved for future use */
398   GST_MPEGTS_DVB_LINKAGE_RESERVED_00               = 0x00,
399   GST_MPEGTS_DVB_LINKAGE_INFORMATION               = 0x01,
400   GST_MPEGTS_DVB_LINKAGE_EPG                       = 0x02,
401   GST_MPEGTS_DVB_LINKAGE_CA_REPLACEMENT            = 0x03,
402   GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_COMPLETE_SI = 0x04,
403   GST_MPEGTS_DVB_LINKAGE_SERVICE_REPLACEMENT       = 0x05,
404   GST_MPEGTS_DVB_LINKAGE_DATA_BROADCAST            = 0x06,
405   GST_MPEGTS_DVB_LINKAGE_RCS_MAP                   = 0x07,
406   GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER          = 0x08,
407   GST_MPEGTS_DVB_LINKAGE_SYSTEM_SOFTWARE_UPDATE    = 0x09,
408   GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_SSU         = 0x0A,
409   GST_MPEGTS_DVB_LINKAGE_IP_MAC_NOTIFICATION       = 0x0B,
410   GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_INT         = 0x0C,
411   GST_MPEGTS_DVB_LINKAGE_EVENT                     = 0x0D,
412   GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT            = 0x0E,
413 } GstMpegtsDVBLinkageType;
414 
415 typedef enum {
416   GST_MPEGTS_DVB_LINKAGE_HAND_OVER_RESERVED        = 0x00,
417   GST_MPEGTS_DVB_LINKAGE_HAND_OVER_IDENTICAL       = 0x01,
418   GST_MPEGTS_DVB_LINKAGE_HAND_OVER_LOCAL_VARIATION = 0x02,
419   GST_MPEGTS_DVB_LINKAGE_HAND_OVER_ASSOCIATED      = 0x03,
420 } GstMpegtsDVBLinkageHandOverType;
421 
422 typedef struct _GstMpegtsDVBLinkageMobileHandOver GstMpegtsDVBLinkageMobileHandOver;
423 typedef struct _GstMpegtsDVBLinkageEvent GstMpegtsDVBLinkageEvent;
424 typedef struct _GstMpegtsDVBLinkageExtendedEvent GstMpegtsDVBLinkageExtendedEvent;
425 typedef struct _GstMpegtsDVBLinkageDescriptor GstMpegtsDVBLinkageDescriptor;
426 
427 struct _GstMpegtsDVBLinkageMobileHandOver
428 {
429   GstMpegtsDVBLinkageHandOverType hand_over_type;
430   /* 0 = NIT, 1 = SDT */
431   gboolean                        origin_type;
432   guint16                         network_id;
433   guint16                         initial_service_id;
434 };
435 
436 struct _GstMpegtsDVBLinkageEvent
437 {
438   guint16  target_event_id;
439   gboolean target_listed;
440   gboolean event_simulcast;
441 };
442 
443 struct _GstMpegtsDVBLinkageExtendedEvent
444 {
445   guint16        target_event_id;
446   gboolean       target_listed;
447   gboolean       event_simulcast;
448   /* FIXME: */
449   guint8         link_type;
450   /* FIXME: */
451   guint8         target_id_type;
452   gboolean       original_network_id_flag;
453   gboolean       service_id_flag;
454   /* if (target_id_type == 3) */
455   guint16        user_defined_id;
456   /* else */
457   guint16        target_transport_stream_id;
458   guint16        target_original_network_id;
459   guint16        target_service_id;
460 };
461 
462 /**
463  * GstMpegtsDVBLinkageDescriptor:
464  * @transport_stream_id: the transport id
465  * @original_network_id: the original network id
466  * @service_id: the service id
467  * @linkage_type: the type which %linkage_data has
468  * @private_data_length: the length for %private_data_bytes
469  * @private_data_bytes: additional data bytes
470  */
471 struct _GstMpegtsDVBLinkageDescriptor
472 {
473   guint16                           transport_stream_id;
474   guint16                           original_network_id;
475   guint16                           service_id;
476   GstMpegtsDVBLinkageType           linkage_type;
477   /*< private >*/
478   gpointer                          linkage_data;
479   /*< public >*/
480   guint8                            private_data_length;
481   guint8                            *private_data_bytes;
482 };
483 
484 #define GST_TYPE_MPEGTS_DVB_LINKAGE_DESCRIPTOR ( gst_mpegts_dvb_linkage_descriptor_get_type())
485 
486 GST_MPEGTS_API
487 GType gst_mpegts_dvb_linkage_descriptor_get_type (void);
488 
489 GST_MPEGTS_API
490 void gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source);
491 
492 #define GST_TYPE_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER (gst_mpegts_dvb_linkage_mobile_hand_over_get_type())
493 
494 GST_MPEGTS_API
495 GType gst_mpegts_dvb_linkage_mobile_hand_over_get_type (void);
496 
497 GST_MPEGTS_API
498 const GstMpegtsDVBLinkageMobileHandOver * gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over
499     (const GstMpegtsDVBLinkageDescriptor * desc);
500 
501 #define GST_TYPE_MPEGTS_DVB_LINKAGE_EVENT (gst_mpegts_dvb_linkage_event_get_type())
502 
503 GST_MPEGTS_API
504 GType gst_mpegts_dvb_linkage_event_get_type (void);
505 
506 GST_MPEGTS_API
507 const GstMpegtsDVBLinkageEvent * gst_mpegts_dvb_linkage_descriptor_get_event
508     (const GstMpegtsDVBLinkageDescriptor * desc);
509 
510 #define GST_TYPE_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT (gst_mpegts_dvb_linkage_extended_event_get_type())
511 
512 GST_MPEGTS_API
513 GType gst_mpegts_dvb_linkage_extended_event_get_type (void);
514 
515 GST_MPEGTS_API
516 const GPtrArray * gst_mpegts_dvb_linkage_descriptor_get_extended_event
517     (const GstMpegtsDVBLinkageDescriptor * desc);
518 
519 GST_MPEGTS_API
520 gboolean gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
521                                                   GstMpegtsDVBLinkageDescriptor ** res);
522 
523 /* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */
524 
525 GST_MPEGTS_API
526 gboolean gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegtsDescriptor *descriptor,
527 						       gchar **language_code,
528 						       gchar **event_name,
529 						       gchar **text);
530 
531 /* GST_MTS_DESC_DVB_EXTENDED_EVENT (0x4E) */
532 typedef struct _GstMpegtsExtendedEventDescriptor GstMpegtsExtendedEventDescriptor;
533 typedef struct _GstMpegtsExtendedEventItem GstMpegtsExtendedEventItem;
534 
535 /* FIXME : Maybe make a separate method for getting a specific item entry ? */
536 struct _GstMpegtsExtendedEventItem
537 {
538   gchar *item_description;
539   gchar *item;
540 };
541 
542 #define GST_TYPE_MPEGTS_EXTENDED_EVENT_ITEM (gst_mpegts_extended_event_item_get_type())
543 
544 GST_MPEGTS_API
545 GType gst_mpegts_extended_event_item_get_type(void);
546 
547 /**
548  * GstMpegtsExtendedEventDescriptor:
549  * @descriptor_number:
550  * @last_descriptor_number:
551  * @language_code: NULL terminated language code.
552  * @items: (element-type GstMpegtsExtendedEventItem): the #GstMpegtsExtendedEventItem
553  * @text:
554  *
555  * Extended Event Descriptor (EN 300 468 v.1.13.1)
556  */
557 struct _GstMpegtsExtendedEventDescriptor
558 {
559   guint8 descriptor_number;
560   guint8 last_descriptor_number;
561   gchar  *language_code;
562   GPtrArray *items;
563   gchar *text;
564 };
565 
566 #define GST_TYPE_MPEGTS_EXTENDED_EVENT_DESCRIPTOR (gst_mpegts_extended_event_descriptor_get_type())
567 
568 GST_MPEGTS_API
569 GType gst_mpegts_extended_event_descriptor_get_type (void);
570 
571 GST_MPEGTS_API
572 void gst_mpegts_extended_event_descriptor_free (GstMpegtsExtendedEventDescriptor * source);
573 
574 GST_MPEGTS_API
575 gboolean gst_mpegts_descriptor_parse_dvb_extended_event (const GstMpegtsDescriptor *descriptor,
576 							  GstMpegtsExtendedEventDescriptor **res);
577 
578 /* GST_MTS_DESC_DVB_COMPONENT (0x50) */
579 #define GST_TYPE_MPEGTS_COMPONENT_DESCRIPTOR (gst_mpegts_component_descriptor_get_type ())
580 typedef enum {
581   GST_MPEGTS_STREAM_CONTENT_MPEG2_VIDEO          = 0x01,
582   GST_MPEGTS_STREAM_CONTENT_MPEG1_LAYER2_AUDIO   = 0x02,
583   GST_MPEGTS_STREAM_CONTENT_TELETEXT_OR_SUBTITLE = 0x03,
584   GST_MPEGTS_STREAM_CONTENT_AC_3                 = 0x04,
585   GST_MPEGTS_STREAM_CONTENT_AVC                  = 0x05,
586   GST_MPEGTS_STREAM_CONTENT_AAC                  = 0x06,
587   GST_MPEGTS_STREAM_CONTENT_DTS                  = 0x07,
588   GST_MPEGTS_STREAM_CONTENT_SRM_CPCM             = 0x08
589 } GstMpegtsComponentStreamContent;
590 
591 typedef struct _GstMpegtsComponentDescriptor GstMpegtsComponentDescriptor;
592 struct _GstMpegtsComponentDescriptor
593 {
594   guint8 stream_content;
595   guint8 component_type;
596   guint8 component_tag;
597   gchar  *language_code;
598   gchar  *text;
599 };
600 
601 GST_MPEGTS_API
602 GType gst_mpegts_component_descriptor_get_type (void);
603 
604 GST_MPEGTS_API
605 void gst_mpegts_dvb_component_descriptor_free (GstMpegtsComponentDescriptor * source);
606 
607 GST_MPEGTS_API
608 gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegtsDescriptor *descriptor,
609 						    GstMpegtsComponentDescriptor **res);
610 
611 /* GST_MTS_DESC_DVB_STREAM_IDENTIFIER (0x52) */
612 
613 GST_MPEGTS_API
614 gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegtsDescriptor *descriptor,
615 							    guint8 *component_tag);
616 
617 /* GST_MTS_DESC_DVB_CA_IDENTIFIER (0x53) */
618 
619 GST_MPEGTS_API
620 gboolean gst_mpegts_descriptor_parse_dvb_ca_identifier (const GstMpegtsDescriptor * descriptor,
621                                                         GArray ** list);
622 
623 /* GST_MTS_DESC_DVB_CONTENT (0x54) */
624 typedef enum {
625   GST_MPEGTS_CONTENT_MOVIE_DRAMA                = 0x01,
626   GST_MPEGTS_CONTENT_NEWS_CURRENT_AFFAIRS       = 0x02,
627   GST_MPEGTS_CONTENT_SHOW_GAME_SHOW             = 0x03,
628   GST_MPEGTS_CONTENT_SPORTS                     = 0x04,
629   GST_MPEGTS_CONTENT_CHILDREN_YOUTH_PROGRAM     = 0x05,
630   GST_MPEGTS_CONTENT_MUSIC_BALLET_DANCE         = 0x06,
631   GST_MPEGTS_CONTENT_ARTS_CULTURE               = 0x07,
632   GST_MPEGTS_CONTENT_SOCIAL_POLITICAL_ECONOMICS = 0x08,
633   GST_MPEGTS_CONTENT_EDUCATION_SCIENCE_FACTUAL  = 0x09,
634   GST_MPEGTS_CONTENT_LEISURE_HOBBIES            = 0x0A,
635   GST_MPEGTS_CONTENT_SPECIAL_CHARACTERISTICS    = 0x0B
636 } GstMpegtsContentNibbleHi;
637 
638 typedef struct _GstMpegtsContent GstMpegtsContent;
639 struct _GstMpegtsContent
640 {
641   GstMpegtsContentNibbleHi content_nibble_1;
642   guint8 content_nibble_2;
643   guint8 user_byte;
644 };
645 
646 #define GST_TYPE_MPEGTS_CONTENT (gst_mpegts_content_get_type ())
647 
648 GST_MPEGTS_API
649 GType gst_mpegts_content_get_type (void);
650 
651 GST_MPEGTS_API
652 gboolean gst_mpegts_descriptor_parse_dvb_content (const GstMpegtsDescriptor *
653 	descriptor, GPtrArray ** content);
654 
655 /* GST_MTS_DESC_DVB_PARENTAL_RATING (0x55) */
656 typedef struct _GstMpegtsDVBParentalRatingItem GstMpegtsDVBParentalRatingItem;
657 
658 #define GST_TYPE_MPEGTS_DVB_PARENTAL_RATING_ITEM (gst_mpegts_dvb_parental_rating_item_get_type())
659 
660 GST_MPEGTS_API
661 GType gst_mpegts_dvb_parental_rating_item_get_type (void);
662 
663 /**
664  * GstMpegtsDVBParentalRating:
665  * @country_code: This 24-bit field identifies a country using the 3-character
666  * code as specified in ISO 3166
667  * @rating: the rating age
668  */
669 struct _GstMpegtsDVBParentalRatingItem
670 {
671   gchar  *country_code;
672   guint8 rating;
673 };
674 
675 GST_MPEGTS_API
676 gboolean gst_mpegts_descriptor_parse_dvb_parental_rating (const GstMpegtsDescriptor
677         * descriptor, GPtrArray ** rating);
678 
679 /* GST_MTS_DESC_DVB_TELETEXT (0x56) */
680 /**
681  * GstMpegtsDVBTeletextType:
682  *
683  * The type of teletext page.
684  *
685  * As specified in Table 100 of ETSI EN 300 468 v1.13.1
686  */
687 typedef enum {
688   INITIAL_PAGE = 0x01,
689   SUBTITLE_PAGE,
690   ADDITIONAL_INFO_PAGE,
691   PROGRAMME_SCHEDULE_PAGE,
692   HEARING_IMPAIRED_PAGE
693 } GstMpegtsDVBTeletextType;
694 
695 GST_MPEGTS_API
696 gboolean gst_mpegts_descriptor_parse_dvb_teletext_idx (const GstMpegtsDescriptor *
697     descriptor, guint idx, gchar ** language_code,
698     GstMpegtsDVBTeletextType * teletext_type, guint8 * magazine_number,
699     guint8 * page_number);
700 
701 GST_MPEGTS_API
702 guint gst_mpegts_descriptor_parse_dvb_teletext_nb (const GstMpegtsDescriptor *
703     descriptor);
704 
705 /* GST_MTS_DESC_DVB_SUBTITLING (0x59) */
706 
707 GST_MPEGTS_API
708 gboolean gst_mpegts_descriptor_parse_dvb_subtitling_idx (const GstMpegtsDescriptor *descriptor,
709 							 guint idx, gchar ** lang,
710 							 guint8 *type, guint16 *composition_page_id,
711 							 guint16 *ancillary_page_id);
712 
713 GST_MPEGTS_API
714 guint gst_mpegts_descriptor_parse_dvb_subtitling_nb (const GstMpegtsDescriptor *descriptor);
715 
716 GST_MPEGTS_API
717 GstMpegtsDescriptor * gst_mpegts_descriptor_from_dvb_subtitling (const gchar *lang,
718     guint8 type, guint16 composition, guint16 ancillary);
719 
720 
721 
722 /* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */
723 typedef struct _GstMpegtsTerrestrialDeliverySystemDescriptor GstMpegtsTerrestrialDeliverySystemDescriptor;
724 
725 typedef enum {
726   GST_MPEGTS_TRANSMISSION_MODE_2K = 0,
727   GST_MPEGTS_TRANSMISSION_MODE_8K,
728   GST_MPEGTS_TRANSMISSION_MODE_AUTO,
729   GST_MPEGTS_TRANSMISSION_MODE_4K,
730   GST_MPEGTS_TRANSMISSION_MODE_1K,
731   GST_MPEGTS_TRANSMISSION_MODE_16K,
732   GST_MPEGTS_TRANSMISSION_MODE_32K,
733   GST_MPEGTS_TRANSMISSION_MODE_C1,
734   GST_MPEGTS_TRANSMISSION_MODE_C3780
735 } GstMpegtsTerrestrialTransmissionMode;
736 
737 typedef enum {
738   GST_MPEGTS_GUARD_INTERVAL_1_32 = 0,
739   GST_MPEGTS_GUARD_INTERVAL_1_16,
740   GST_MPEGTS_GUARD_INTERVAL_1_8,
741   GST_MPEGTS_GUARD_INTERVAL_1_4,
742   GST_MPEGTS_GUARD_INTERVAL_AUTO,
743   GST_MPEGTS_GUARD_INTERVAL_1_128,
744   GST_MPEGTS_GUARD_INTERVAL_19_128,
745   GST_MPEGTS_GUARD_INTERVAL_19_256,
746   GST_MPEGTS_GUARD_INTERVAL_PN420,
747   GST_MPEGTS_GUARD_INTERVAL_PN595,
748   GST_MPEGTS_GUARD_INTERVAL_PN945
749 } GstMpegtsTerrestrialGuardInterval;
750 
751 typedef enum {
752   GST_MPEGTS_HIERARCHY_NONE = 0,
753   GST_MPEGTS_HIERARCHY_1,
754   GST_MPEGTS_HIERARCHY_2,
755   GST_MPEGTS_HIERARCHY_4,
756   GST_MPEGTS_HIERARCHY_AUTO
757 } GstMpegtsTerrestrialHierarchy;
758 
759 /**
760  * GstMpegtsTerrestrialDeliverySystemDescriptor:
761  * @frequency: the frequency in Hz (Hertz)
762  * @bandwidth: the bandwidth in Hz (Hertz)
763  * @priority: %TRUE High Priority %FALSE Low Priority
764  * @time_slicing: %TRUE no time slicing %FALSE time slicing
765  * @mpe_fec: %TRUE no mpe-fec is used %FALSE mpe-fec is use
766  * @constellation: the constallation
767  * @hierarchy: the hierarchy
768  * @code_rate_hp:
769  * @code_rate_lp:
770  * @guard_interval:
771  * @transmission_mode:
772  * @other_frequency: %TRUE more frequency are use, else not
773  *
774  * Terrestrial Delivery System Descriptor (EN 300 468 v.1.13.1)
775  */
776 
777 struct _GstMpegtsTerrestrialDeliverySystemDescriptor
778 {
779   guint32				frequency;
780   guint32				bandwidth;
781   gboolean				priority;
782   gboolean				time_slicing;
783   gboolean				mpe_fec;
784   GstMpegtsModulationType		constellation;
785   GstMpegtsTerrestrialHierarchy		hierarchy;
786   GstMpegtsDVBCodeRate			code_rate_hp;
787   GstMpegtsDVBCodeRate			code_rate_lp;
788   GstMpegtsTerrestrialGuardInterval	guard_interval;
789   GstMpegtsTerrestrialTransmissionMode	transmission_mode;
790   gboolean				other_frequency;
791 };
792 
793 #define GST_TYPE_MPEGTS_TERRESTRIAL_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_terrestrial_delivery_system_descriptor_get_type())
794 
795 GST_MPEGTS_API
796 GType gst_mpegts_terrestrial_delivery_system_descriptor_get_type(void);
797 
798 GST_MPEGTS_API
799 gboolean gst_mpegts_descriptor_parse_terrestrial_delivery_system (const GstMpegtsDescriptor
800               *descriptor, GstMpegtsTerrestrialDeliverySystemDescriptor * res);
801 
802 /* GST_MTS_DESC_DVB_MULTILINGUAL_NETWORK_NAME (0x5B) */
803 typedef struct _GstMpegtsDvbMultilingualNetworkNameItem GstMpegtsDvbMultilingualNetworkNameItem;
804 
805 /**
806  * GstMpegtsDvbMultilingualNetworkNameItem:
807  * @language_code: the ISO 639 language code
808  * @network_name: the network name
809  *
810  * a multilingual network name entry
811  */
812 struct _GstMpegtsDvbMultilingualNetworkNameItem
813 {
814   gchar *language_code;
815   gchar *network_name;
816 };
817 
818 #define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_NETWORK_NAME_ITEM (gst_mpegts_dvb_multilingual_network_name_item_get_type())
819 
820 GST_MPEGTS_API
821 GType gst_mpegts_dvb_multilingual_network_name_item_get_type(void);
822 
823 GST_MPEGTS_API
824 gboolean gst_mpegts_descriptor_parse_dvb_multilingual_network_name (const GstMpegtsDescriptor
825               *descriptor, GPtrArray ** network_name_items);
826 
827 /* GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME (0x5C) */
828 typedef struct _GstMpegtsDvbMultilingualBouquetNameItem GstMpegtsDvbMultilingualBouquetNameItem;
829 
830 /**
831  * GstMpegtsDvbMultilingualBouquetNameItem:
832  * @language_code: the ISO 639 language code
833  * @bouquet_name: the bouquet name
834  *
835  * a multilingual bouquet name entry
836  */
837 struct _GstMpegtsDvbMultilingualBouquetNameItem
838 {
839   gchar *language_code;
840   gchar *bouquet_name;
841 };
842 
843 #define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_BOUQUET_NAME_ITEM (gst_mpegts_dvb_multilingual_bouquet_name_item_get_type())
844 
845 GST_MPEGTS_API
846 GType gst_mpegts_dvb_multilingual_bouquet_name_item_get_type(void);
847 
848 GST_MPEGTS_API
849 gboolean gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name (const GstMpegtsDescriptor
850               *descriptor, GPtrArray ** bouquet_name_items);
851 
852 /* GST_MTS_DESC_DVB_MULTILINGUAL_SERVICE_NAME (0x5D) */
853 typedef struct _GstMpegtsDvbMultilingualServiceNameItem GstMpegtsDvbMultilingualServiceNameItem;
854 
855 /**
856  * GstMpegtsDvbMultilingualServiceNameItem:
857  * @language_code: the ISO 639 language code
858  * @provider_name: the provider name
859  * @service_name: the service name
860  *
861  * a multilingual service name entry
862  */
863 struct _GstMpegtsDvbMultilingualServiceNameItem
864 {
865   gchar *language_code;
866   gchar *provider_name;
867   gchar *service_name;
868 };
869 
870 #define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_SERVICE_NAME_ITEM (gst_mpegts_dvb_multilingual_service_name_item_get_type())
871 
872 GST_MPEGTS_API
873 GType gst_mpegts_dvb_multilingual_service_name_item_get_type(void);
874 
875 GST_MPEGTS_API
876 gboolean gst_mpegts_descriptor_parse_dvb_multilingual_service_name (const GstMpegtsDescriptor
877               *descriptor, GPtrArray ** service_name_items);
878 
879 /* GST_MTS_DESC_DVB_MULTILINGUAL_COMPONENT (0x5E) */
880 typedef struct _GstMpegtsDvbMultilingualComponentItem GstMpegtsDvbMultilingualComponentItem;
881 
882 /**
883  * GstMpegtsDvbMultilingualComponentItem:
884  * @language_code: the ISO 639 language code
885  * @description: the component description
886  */
887 struct _GstMpegtsDvbMultilingualComponentItem
888 {
889   gchar *language_code;
890   gchar *description;
891 };
892 
893 #define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_COMPONENT_ITEM (gst_mpegts_dvb_multilingual_component_item_get_type())
894 
895 GST_MPEGTS_API
896 GType gst_mpegts_dvb_multilingual_component_item_get_type(void);
897 
898 GST_MPEGTS_API
899 gboolean gst_mpegts_descriptor_parse_dvb_multilingual_component (const GstMpegtsDescriptor
900               *descriptor, guint8 * component_tag, GPtrArray ** component_description_items);
901 
902 /* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */
903 
904 GST_MPEGTS_API
905 gboolean gst_mpegts_descriptor_parse_dvb_private_data_specifier (const GstMpegtsDescriptor
906               * descriptor, guint32 * private_data_specifier, guint8 ** private_data,
907               guint8 * length);
908 
909 /* GST_MTS_DESC_DVB_FREQUENCY_LIST (0x62) */
910 
911 GST_MPEGTS_API
912 gboolean gst_mpegts_descriptor_parse_dvb_frequency_list (const GstMpegtsDescriptor
913     * descriptor, gboolean * offset, GArray ** list);
914 
915 /* GST_MTS_DESC_DVB_DATA_BROADCAST (0x64) */
916 typedef struct _GstMpegtsDataBroadcastDescriptor GstMpegtsDataBroadcastDescriptor;
917 
918 /**
919  * GstMpegtsDataBroadcastDescriptor:
920  * @data_broadcast_id: the data broadcast id
921  * @component_tag: the component tag
922  * @selector_bytes: the selector byte field
923  * @language_code: language of @text
924  * @text: description of data broadcast
925  */
926 struct _GstMpegtsDataBroadcastDescriptor
927 {
928   guint16     data_broadcast_id;
929   guint8      component_tag;
930   guint8      length;
931   guint8      *selector_bytes;
932   gchar       *language_code;
933   gchar       *text;
934 };
935 
936 
937 #define GST_TYPE_MPEGTS_DVB_DATA_BROADCAST_DESCRIPTOR (gst_mpegts_dvb_data_broadcast_descriptor_get_type ())
938 GST_MPEGTS_API
939 GType gst_mpegts_dvb_data_broadcast_descriptor_get_type (void);
940 
941 GST_MPEGTS_API
942 void gst_mpegts_dvb_data_broadcast_descriptor_free (GstMpegtsDataBroadcastDescriptor * source);
943 
944 GST_MPEGTS_API
945 gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast (const GstMpegtsDescriptor
946               *descriptor, GstMpegtsDataBroadcastDescriptor ** res);
947 
948 /* GST_MTS_DESC_DVB_SCRAMBLING (0x65) */
949 typedef enum
950 {
951   GST_MPEGTS_DVB_SCRAMBLING_MODE_RESERVED              = 0x00,
952   GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA1                  = 0x01,
953   GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA2                  = 0x02,
954   GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_STANDARD         = 0x03,
955   GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_MINIMAL_ENHANCED = 0x04,
956   GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_FULL_ENHANCED    = 0x05,
957   /* 0x06 - 0x0f reserved for future use */
958   GST_MPEGTS_DVB_SCRAMBLING_MODE_CISSA                 = 0x10,
959   /* 0x11 - 0x1f reserved for future DVB-CISSA versions */
960   GST_MPEGTS_DVB_SCRAMBLING_MODE_ATIS_0                = 0x70,
961   GST_MPEGTS_DVB_SCRAMBLING_MODE_ATIS_F                = 0x7f,
962 } GstMpegtsDVBScramblingModeType;
963 
964 GST_MPEGTS_API
965 gboolean gst_mpegts_descriptor_parse_dvb_scrambling (const GstMpegtsDescriptor * descriptor,
966        GstMpegtsDVBScramblingModeType * scrambling_mode);
967 
968 /* GST_MTS_DESC_DVB_DATA_BROADCAST_ID (0x66) */
969 
970 GST_MPEGTS_API
971 gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast_id (const GstMpegtsDescriptor
972        * descriptor, guint16 * data_broadcast_id, guint8 ** id_selector_bytes, guint8 * len);
973 
974 /* GST_MTS_DESC_DVB_AC3 (0x6a) */
975 /* FIXME : Implement */
976 
977 /* GST_MTS_DESC_EXT_DVB_T2_DELIVERY_SYSTEM (0x7F && 0x04) */
978 typedef struct _GstMpegtsT2DeliverySystemCellExtension GstMpegtsT2DeliverySystemCellExtension;
979 
980 /**
981  * GstMpegtsT2DeliverySystemCellExtension:
982  * @cell_id_extension: id of the sub cell
983  * @transposer_frequency: centre frequency of the sub cell in Hz
984  */
985 struct _GstMpegtsT2DeliverySystemCellExtension
986 {
987   guint8  cell_id_extension;
988   guint32 transposer_frequency;
989 };
990 
991 #define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_CELL_EXTENSION (gst_mpegts_t2_delivery_system_cell_extension_get_type())
992 
993 GST_MPEGTS_API
994 GType gst_mpegts_t2_delivery_system_cell_extension_get_type(void);
995 
996 typedef struct _GstMpegtsT2DeliverySystemCell GstMpegtsT2DeliverySystemCell;
997 
998 /**
999  * GstMpegtsT2DeliverySystemCell:
1000  * @cell_id: id of the cell
1001  * @centre_frequencies: (element-type guint32): centre frequencies in Hz
1002  * @sub_cells: (element-type GstMpegtsT2DeliverySystemCellExtension):
1003  */
1004 struct _GstMpegtsT2DeliverySystemCell
1005 {
1006   guint16      cell_id;
1007   GArray       *centre_frequencies;
1008   GPtrArray    *sub_cells;
1009 };
1010 
1011 #define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_CELL (gst_mpegts_t2_delivery_system_cell_get_type())
1012 
1013 GST_MPEGTS_API
1014 GType gst_mpegts_t2_delivery_system_cell_get_type(void);
1015 
1016 typedef struct _GstMpegtsT2DeliverySystemDescriptor GstMpegtsT2DeliverySystemDescriptor;
1017 
1018 /**
1019  * GstMpegtsT2DeliverySystemDescriptor:
1020  * @plp_id:
1021  * @t2_system_id:
1022  * @siso_miso:
1023  * @bandwidth:
1024  * @guard_interval:
1025  * @transmission_mode:
1026  * @other_frequency:
1027  * @tfs:
1028  * @cells: (element-type GstMpegtsT2DeliverySystemCell):
1029  *
1030  * describe DVB-T2 transmissions according to EN 302 755
1031  */
1032 struct _GstMpegtsT2DeliverySystemDescriptor
1033 {
1034   guint8                                plp_id;
1035   guint16                               t2_system_id;
1036   /* FIXME: */
1037   guint8                                siso_miso;
1038   guint32                               bandwidth;
1039   GstMpegtsTerrestrialGuardInterval     guard_interval;
1040   GstMpegtsTerrestrialTransmissionMode  transmission_mode;
1041   gboolean                              other_frequency;
1042   gboolean                              tfs;
1043   GPtrArray                             *cells;
1044 };
1045 
1046 #define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_t2_delivery_system_descriptor_get_type ())
1047 GST_MPEGTS_API
1048 GType gst_mpegts_t2_delivery_system_descriptor_get_type (void);
1049 
1050 GST_MPEGTS_API
1051 void gst_mpegts_t2_delivery_system_descriptor_free (GstMpegtsT2DeliverySystemDescriptor * source);
1052 
1053 GST_MPEGTS_API
1054 gboolean gst_mpegts_descriptor_parse_dvb_t2_delivery_system (const GstMpegtsDescriptor
1055               *descriptor, GstMpegtsT2DeliverySystemDescriptor ** res);
1056 
1057 G_END_DECLS
1058 
1059 #endif				/* GST_MPEGTS_DESCRIPTOR_H */
1060