summaryrefslogtreecommitdiff
path: root/include/gst/mpegts/gst-dvb-descriptor.h
blob: d88de84854b8573867fccb77ca8f0ca5249e1cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
/*
 * gstmpegtsdescriptor.h -
 * Copyright (C) 2013 Edward Hervey
 *
 * Authors:
 *   Edward Hervey <edward@collabora.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * Some parts of this code come from the Fluendo MPEG Demuxer plugin.
 *
 * The Initial Developer of the Original Code is Fluendo, S.L.
 * Portions created by Fluendo, S.L. are Copyright (C) 2005
 * Fluendo, S.L. All Rights Reserved.
 *
 * Contributor(s): Wim Taymans <wim@fluendo.com>
 */

#ifndef GST_DVB_DESCRIPTOR_H
#define GST_DVB_DESCRIPTOR_H

#include <gst/gst.h>
#include <gst/mpegts/mpegts-prelude.h>

G_BEGIN_DECLS

/**
 * GstMpegtsDVBDescriptorType:
 *
 * The type of #GstMpegtsDescriptor
 *
 * These values correspond to the registered descriptor type from
 * the various DVB specifications.
 *
 * Consult the relevant specifications for more details.
 */
typedef enum {
  /* 64-127 DVB tags ETSI EN 300 468
   * (Specification for Service Information (SI) in DVB systems)
   */
  GST_MTS_DESC_DVB_NETWORK_NAME                 = 0x40,
  GST_MTS_DESC_DVB_SERVICE_LIST                 = 0x41,
  GST_MTS_DESC_DVB_STUFFING                     = 0x42,
  GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM    = 0x43,
  GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM        = 0x44,
  GST_MTS_DESC_DVB_VBI_DATA                     = 0x45,
  GST_MTS_DESC_DVB_VBI_TELETEXT                 = 0x46,
  GST_MTS_DESC_DVB_BOUQUET_NAME                 = 0x47,
  GST_MTS_DESC_DVB_SERVICE                      = 0x48,
  GST_MTS_DESC_DVB_COUNTRY_AVAILABILITY         = 0x49,
  GST_MTS_DESC_DVB_LINKAGE                      = 0x4A,
  GST_MTS_DESC_DVB_NVOD_REFERENCE               = 0x4B,
  GST_MTS_DESC_DVB_TIME_SHIFTED_SERVICE         = 0x4C,
  GST_MTS_DESC_DVB_SHORT_EVENT                  = 0x4D,
  GST_MTS_DESC_DVB_EXTENDED_EVENT               = 0x4E,
  GST_MTS_DESC_DVB_TIME_SHIFTED_EVENT           = 0x4F,
  GST_MTS_DESC_DVB_COMPONENT                    = 0x50,
  GST_MTS_DESC_DVB_MOSAIC                       = 0x51,
  GST_MTS_DESC_DVB_STREAM_IDENTIFIER            = 0x52,
  GST_MTS_DESC_DVB_CA_IDENTIFIER                = 0x53,
  GST_MTS_DESC_DVB_CONTENT                      = 0x54,
  GST_MTS_DESC_DVB_PARENTAL_RATING              = 0x55,
  GST_MTS_DESC_DVB_TELETEXT                     = 0x56,
  GST_MTS_DESC_DVB_TELEPHONE                    = 0x57,
  GST_MTS_DESC_DVB_LOCAL_TIME_OFFSET            = 0x58,
  GST_MTS_DESC_DVB_SUBTITLING                   = 0x59,
  GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM  = 0x5A,
  GST_MTS_DESC_DVB_MULTILINGUAL_NETWORK_NAME    = 0x5B,
  GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME    = 0x5C,
  GST_MTS_DESC_DVB_MULTILINGUAL_SERVICE_NAME    = 0x5D,
  GST_MTS_DESC_DVB_MULTILINGUAL_COMPONENT       = 0x5E,
  GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER       = 0x5F,
  GST_MTS_DESC_DVB_SERVICE_MOVE                 = 0x60,
  GST_MTS_DESC_DVB_SHORT_SMOOTHING_BUFFER       = 0x61,
  GST_MTS_DESC_DVB_FREQUENCY_LIST               = 0x62,
  /**
   * GST_MTS_DESC_DVB_PARTIAL_TRANSPORT_STREAM:
   *
   * Partial Transport Stream descriptor. Only present in SIT Sections.
   *
   * See also: %GST_MPEGTS_SECTION_SIT, %GstMpegtsSIT
   */
  GST_MTS_DESC_DVB_PARTIAL_TRANSPORT_STREAM     = 0x63,
  GST_MTS_DESC_DVB_DATA_BROADCAST               = 0x64,
  GST_MTS_DESC_DVB_SCRAMBLING                   = 0x65,
  GST_MTS_DESC_DVB_DATA_BROADCAST_ID            = 0x66,
  GST_MTS_DESC_DVB_TRANSPORT_STREAM             = 0x67,
  GST_MTS_DESC_DVB_DSNG                         = 0x68,
  GST_MTS_DESC_DVB_PDC                          = 0x69,
  GST_MTS_DESC_DVB_AC3                          = 0x6A,
  GST_MTS_DESC_DVB_ANCILLARY_DATA               = 0x6B,
  GST_MTS_DESC_DVB_CELL_LIST                    = 0x6C,
  GST_MTS_DESC_DVB_CELL_FREQUENCY_LINK          = 0x6D,
  GST_MTS_DESC_DVB_ANNOUNCEMENT_SUPPORT         = 0x6E,
  GST_MTS_DESC_DVB_APPLICATION_SIGNALLING       = 0x6F,
  GST_MTS_DESC_DVB_ADAPTATION_FIELD_DATA        = 0x70,
  GST_MTS_DESC_DVB_SERVICE_IDENTIFIER           = 0x71,
  GST_MTS_DESC_DVB_SERVICE_AVAILABILITY         = 0x72,
  GST_MTS_DESC_DVB_DEFAULT_AUTHORITY            = 0x73,
  GST_MTS_DESC_DVB_RELATED_CONTENT              = 0x74,
  GST_MTS_DESC_DVB_TVA_ID                       = 0x75,
  GST_MTS_DESC_DVB_CONTENT_IDENTIFIER           = 0x76,
  GST_MTS_DESC_DVB_TIMESLICE_FEC_IDENTIFIER     = 0x77,
  GST_MTS_DESC_DVB_ECM_REPETITION_RATE          = 0x78,
  GST_MTS_DESC_DVB_S2_SATELLITE_DELIVERY_SYSTEM = 0x79,
  GST_MTS_DESC_DVB_ENHANCED_AC3                 = 0x7A,
  GST_MTS_DESC_DVB_DTS                          = 0x7B,
  GST_MTS_DESC_DVB_AAC                          = 0x7C,
  GST_MTS_DESC_DVB_XAIT_LOCATION                = 0x7D,
  GST_MTS_DESC_DVB_FTA_CONTENT_MANAGEMENT       = 0x7E,
  GST_MTS_DESC_DVB_EXTENSION                    = 0x7F,
} GstMpegtsDVBDescriptorType;

/**
 * GstMpegtsDVBExtendedDescriptorType:
 *
 * The type of #GstMpegtsDescriptor
 *
 * These values correspond to the registered extended descriptor
 * type from the various DVB specifications.
 *
 * Consult the relevant specifications for more details.
 */
typedef enum {
  /* 00 - 0x7F DVB extended tags ETSI EN 300 468
   * (Specification for Service Information (SI) in DVB systems)
   */
  GST_MTS_DESC_EXT_DVB_IMAGE_ICON               = 0x00,
  /* TS/TR 102 825 */
  GST_MTS_DESC_EXT_DVB_CPCM_DELIVERY_SIGNALLING = 0x01,
  GST_MTS_DESC_EXT_DVB_CP                       = 0x02,
  GST_MTS_DESC_EXT_DVB_CP_IDENTIFIER            = 0x03,
  GST_MTS_DESC_EXT_DVB_T2_DELIVERY_SYSTEM       = 0x04,
  GST_MTS_DESC_EXT_DVB_SH_DELIVERY_SYSTEM       = 0x05,
  GST_MTS_DESC_EXT_DVB_SUPPLEMENTARY_AUDIO      = 0x06,
  GST_MTS_DESC_EXT_DVB_NETWORK_CHANGE_NOTIFY    = 0x07,
  GST_MTS_DESC_EXT_DVB_MESSAGE                  = 0x08,
  GST_MTS_DESC_EXT_DVB_TARGET_REGION            = 0x09,
  GST_MTS_DESC_EXT_DVB_TARGET_REGION_NAME       = 0x0A,
  GST_MTS_DESC_EXT_DVB_SERVICE_RELOCATED        = 0x0B,
  GST_MTS_DESC_EXT_DVB_XAIT_PID                 = 0x0C,
  GST_MTS_DESC_EXT_DVB_C2_DELIVERY_SYSTEM       = 0x0D,
  GST_MTS_DESC_EXT_DVB_DTS_HD_AUDIO_STREAM      = 0x0E,
  GST_MTS_DESC_EXT_DVB_DTS_NEUTRAL              = 0x0F,
  GST_MTS_DESC_EXT_DVB_VIDEO_DEPTH_RANGE        = 0x10,
  GST_MTS_DESC_EXT_DVB_T2MI                     = 0x11,
  GST_MTS_DESC_EXT_DVB_URI_LINKAGE              = 0x13,
  GST_MTS_DESC_EXT_DVB_AC4                      = 0x15,
  /**
   * GST_MTS_DESC_EXT_DVB_AUDIO_PRESELECTION:
   *
   * Provide all avaliable audio programme for user selection
   *
   * Since: 1.20
   */
  GST_MTS_DESC_EXT_DVB_AUDIO_PRESELECTION       = 0x19
} GstMpegtsDVBExtendedDescriptorType;

/* GST_MTS_DESC_DVB_CAROUSEL_IDENTIFIER (0x13) */
/* FIXME : Implement */

/* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegtsDescriptor *descriptor,
						       gchar **name);

GST_MPEGTS_API
GstMpegtsDescriptor *gst_mpegts_descriptor_from_dvb_network_name (const gchar * name);

/* GST_MTS_DESC_DVB_STUFFING (0x42) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_stuffing (const GstMpegtsDescriptor * descriptor,
                                                   guint8 ** stuffing_bytes);


/* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */
typedef struct _GstMpegtsSatelliteDeliverySystemDescriptor GstMpegtsSatelliteDeliverySystemDescriptor;

typedef enum {
  GST_MPEGTS_MODULATION_QPSK    = 0,
  GST_MPEGTS_MODULATION_QAM_16,
  GST_MPEGTS_MODULATION_QAM_32,
  GST_MPEGTS_MODULATION_QAM_64,
  GST_MPEGTS_MODULATION_QAM_128,
  GST_MPEGTS_MODULATION_QAM_256,
  GST_MPEGTS_MODULATION_QAM_AUTO,
  GST_MPEGTS_MODULATION_VSB_8,
  GST_MPEGTS_MODULATION_VSB_16,
  GST_MPEGTS_MODULATION_PSK_8,
  GST_MPEGTS_MODULATION_APSK_16,
  GST_MPEGTS_MODULATION_APSK_32,
  GST_MPEGTS_MODULATION_DQPSK,
  GST_MPEGTS_MODULATION_QAM_4_NR_,
  GST_MPEGTS_MODULATION_NONE
} GstMpegtsModulationType;

typedef enum {
  GST_MPEGTS_FEC_NONE = 0,
  GST_MPEGTS_FEC_1_2,
  GST_MPEGTS_FEC_2_3,
  GST_MPEGTS_FEC_3_4,
  GST_MPEGTS_FEC_4_5,
  GST_MPEGTS_FEC_5_6,
  GST_MPEGTS_FEC_6_7,
  GST_MPEGTS_FEC_7_8,
  GST_MPEGTS_FEC_8_9,
  GST_MPEGTS_FEC_AUTO,
  GST_MPEGTS_FEC_3_5,
  GST_MPEGTS_FEC_9_10,
  GST_MPEGTS_FEC_2_5
} GstMpegtsDVBCodeRate;

typedef enum {
  GST_MPEGTS_ROLLOFF_35 = 0,
  GST_MPEGTS_ROLLOFF_20,
  GST_MPEGTS_ROLLOFF_25,
  GST_MPEGTS_ROLLOFF_RESERVED,
  GST_MPEGTS_ROLLOFF_AUTO
} GstMpegtsSatelliteRolloff;

typedef enum {
  GST_MPEGTS_POLARIZATION_LINEAR_HORIZONTAL = 0,
  GST_MPEGTS_POLARIZATION_LINEAR_VERTICAL,
  GST_MPEGTS_POLARIZATION_CIRCULAR_LEFT,
  GST_MPEGTS_POLARIZATION_CIRCULAR_RIGHT
} GstMpegtsSatellitePolarizationType;

/**
 * GstMpegtsSatelliteDeliverySystemDescriptor:
 * @frequency: the frequency in kHz (kiloHertz)
 * @orbital_position: the orbital position in degrees
 * @west_east: If %TRUE, the satellite is in the eastern part of the orbit,
 * else in the western part.
 * @polarization: The polarization of the transmitted signal
 * @roll_off: Roll-off factor used in DVB-S2
 * @modulation_system: modulation system, %TRUE if DVB-S2, else DVB-S
 * @modulation_type: Modulation scheme used
 * @symbol_rate: Symbol rate (in symbols per second)
 * @fec_inner: inner FEC scheme used
 *
 * Satellite Delivery System Descriptor (EN 300 468 v.1.13.1)
 */
struct _GstMpegtsSatelliteDeliverySystemDescriptor
{
  guint32                            frequency;
  gfloat                             orbital_position;
  gboolean                           west_east;
  GstMpegtsSatellitePolarizationType polarization;

  GstMpegtsSatelliteRolloff          roll_off;
  gboolean                           modulation_system;
  GstMpegtsModulationType            modulation_type;

  guint32                            symbol_rate;
  GstMpegtsDVBCodeRate               fec_inner;
};

#define GST_TYPE_MPEGTS_SATELLITE_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_satellite_delivery_system_descriptor_get_type())

GST_MPEGTS_API
GType gst_mpegts_satellite_delivery_system_descriptor_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegtsDescriptor *descriptor,
								GstMpegtsSatelliteDeliverySystemDescriptor *res);


/* GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM (0x44) */
typedef enum {
  GST_MPEGTS_CABLE_OUTER_FEC_UNDEFINED = 0,
  GST_MPEGTS_CABLE_OUTER_FEC_NONE,
  GST_MPEGTS_CABLE_OUTER_FEC_RS_204_188,
} GstMpegtsCableOuterFECScheme;

typedef struct _GstMpegtsCableDeliverySystemDescriptor GstMpegtsCableDeliverySystemDescriptor;
/**
 * GstMpegtsCableDeliverySystemDescriptor:
 * @frequency: the frequency in Hz (Hertz)
 * @outer_fec: the outer FEC scheme used
 * @modulation: Modulation scheme used
 * @symbol_rate: Symbol rate (in symbols per second)
 * @fec_inner: inner FEC scheme used
 *
 * Cable Delivery System Descriptor (EN 300 468 v.1.13.1)
 */
struct _GstMpegtsCableDeliverySystemDescriptor
{
  guint32                            frequency;
  GstMpegtsCableOuterFECScheme       outer_fec;
  GstMpegtsModulationType            modulation;

  guint32                            symbol_rate;
  GstMpegtsDVBCodeRate               fec_inner;
};

#define GST_TYPE_MPEGTS_DVB_CABLE_DELIVERY_SYSTEM_DESCRIPTOR ( gst_mpegts_dvb_cable_system_delivery_descriptor_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_cable_delivery_system_descriptor_get_type (void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegtsDescriptor *descriptor,
							    GstMpegtsCableDeliverySystemDescriptor *res);

GST_MPEGTS_API
void gst_mpegts_dvb_cable_delivery_system_descriptor_free (GstMpegtsCableDeliverySystemDescriptor * source);

/* GST_MTS_DESC_DVB_BOUQUET_NAME (0x47) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_bouquet_name (const GstMpegtsDescriptor * descriptor,
                                                       gchar ** bouquet_name);

/* GST_MTS_DESC_DVB_SERVICE (0x48) */
/**
 * GstMpegtsDVBServiceType:
 *
 * The type of service of a channel.
 *
 * As specified in Table 87 of ETSI EN 300 468 v1.13.1
 */
typedef enum {
  GST_DVB_SERVICE_RESERVED_00               = 0x00,
  GST_DVB_SERVICE_DIGITAL_TELEVISION,
  GST_DVB_SERVICE_DIGITAL_RADIO_SOUND,
  GST_DVB_SERVICE_TELETEXT,
  GST_DVB_SERVICE_NVOD_REFERENCE,
  GST_DVB_SERVICE_NVOD_TIME_SHIFTED,
  GST_DVB_SERVICE_MOSAIC,
  GST_DVB_SERVICE_FM_RADIO,
  GST_DVB_SERVICE_DVB_SRM,
  GST_DVB_SERVICE_RESERVED_09,
  GST_DVB_SERVICE_ADVANCED_CODEC_DIGITAL_RADIO_SOUND,
  GST_DVB_SERVICE_ADVANCED_CODEC_MOSAIC,
  GST_DVB_SERVICE_DATA_BROADCAST,
  GST_DVB_SERVICE_RESERVED_0D_COMMON_INTERFACE,
  GST_DVB_SERVICE_RCS_MAP,
  GST_DVB_SERVICE_RCS_FLS,
  GST_DVB_SERVICE_DVB_MHP,
  GST_DVB_SERVICE_MPEG2_HD_DIGITAL_TELEVISION,
  /* 0x12 - 015 Reserved for future use */
  GST_DVB_SERVICE_ADVANCED_CODEC_SD_DIGITAL_TELEVISION = 0x16,
  GST_DVB_SERVICE_ADVANCED_CODEC_SD_NVOD_TIME_SHIFTED,
  GST_DVB_SERVICE_ADVANCED_CODEC_SD_NVOD_REFERENCE,
  GST_DVB_SERVICE_ADVANCED_CODEC_HD_DIGITAL_TELEVISION,
  GST_DVB_SERVICE_ADVANCED_CODEC_HD_NVOD_TIME_SHIFTED,
  GST_DVB_SERVICE_ADVANCED_CODEC_HD_NVOD_REFERENCE,
  GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_DIGITAL_TELEVISION,
  GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_NVOD_TIME_SHIFTED,
  GST_DVB_SERVICE_ADVANCED_CODEC_STEREO_HD_NVOD_REFERENCE,
  /* 0x1F - 0x7f Reserved for future use */
  /* 0x80 - 0xfe user defined */
  /* 0xff Reserved for future use */
  GST_DVB_SERVICE_RESERVED_FF
} GstMpegtsDVBServiceType;

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_service (const GstMpegtsDescriptor *descriptor,
						  GstMpegtsDVBServiceType *service_type,
						  gchar **service_name,
						  gchar **provider_name);

GST_MPEGTS_API
GstMpegtsDescriptor *gst_mpegts_descriptor_from_dvb_service (GstMpegtsDVBServiceType service_type,
							     const gchar * service_name,
							     const gchar * service_provider);

/* GST_MTS_DESC_DVB_SERVICE_LIST (0x41) */
typedef struct _GstMpegtsDVBServiceListItem GstMpegtsDVBServiceListItem;

/**
 * GstMpegtsDVBServiceListItem:
 * @service_id: the id of a service
 * @type: the type of a service
 */
struct _GstMpegtsDVBServiceListItem
{
  guint16                 service_id;
  GstMpegtsDVBServiceType type;
};

#define GST_TYPE_MPEGTS_DVB_SERVICE_LIST_ITEM (gst_mpegts_dvb_service_list_item_get_type ())

GST_MPEGTS_API
GType gst_mpegts_dvb_service_list_item_get_type (void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_service_list (const GstMpegtsDescriptor * descriptor,
    GPtrArray ** list);

/* GST_MTS_DESC_DVB_LINKAGE (0x4A) */
/**
 * GstMpegtsDVBLinkageType:
 *
 * Linkage Type (EN 300 468 v.1.13.1)
 */
typedef enum {
  /* 0x00, 0x0F-0x7F reserved for future use */
  GST_MPEGTS_DVB_LINKAGE_RESERVED_00               = 0x00,
  GST_MPEGTS_DVB_LINKAGE_INFORMATION               = 0x01,
  GST_MPEGTS_DVB_LINKAGE_EPG                       = 0x02,
  GST_MPEGTS_DVB_LINKAGE_CA_REPLACEMENT            = 0x03,
  GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_COMPLETE_SI = 0x04,
  GST_MPEGTS_DVB_LINKAGE_SERVICE_REPLACEMENT       = 0x05,
  GST_MPEGTS_DVB_LINKAGE_DATA_BROADCAST            = 0x06,
  GST_MPEGTS_DVB_LINKAGE_RCS_MAP                   = 0x07,
  GST_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER          = 0x08,
  GST_MPEGTS_DVB_LINKAGE_SYSTEM_SOFTWARE_UPDATE    = 0x09,
  GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_SSU         = 0x0A,
  GST_MPEGTS_DVB_LINKAGE_IP_MAC_NOTIFICATION       = 0x0B,
  GST_MPEGTS_DVB_LINKAGE_TS_CONTAINING_INT         = 0x0C,
  GST_MPEGTS_DVB_LINKAGE_EVENT                     = 0x0D,
  GST_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT            = 0x0E,
} GstMpegtsDVBLinkageType;

typedef enum {
  GST_MPEGTS_DVB_LINKAGE_HAND_OVER_RESERVED        = 0x00,
  GST_MPEGTS_DVB_LINKAGE_HAND_OVER_IDENTICAL       = 0x01,
  GST_MPEGTS_DVB_LINKAGE_HAND_OVER_LOCAL_VARIATION = 0x02,
  GST_MPEGTS_DVB_LINKAGE_HAND_OVER_ASSOCIATED      = 0x03,
} GstMpegtsDVBLinkageHandOverType;

typedef struct _GstMpegtsDVBLinkageMobileHandOver GstMpegtsDVBLinkageMobileHandOver;
typedef struct _GstMpegtsDVBLinkageEvent GstMpegtsDVBLinkageEvent;
typedef struct _GstMpegtsDVBLinkageExtendedEvent GstMpegtsDVBLinkageExtendedEvent;
typedef struct _GstMpegtsDVBLinkageDescriptor GstMpegtsDVBLinkageDescriptor;

struct _GstMpegtsDVBLinkageMobileHandOver
{
  GstMpegtsDVBLinkageHandOverType hand_over_type;
  /* 0 = NIT, 1 = SDT */
  gboolean                        origin_type;
  guint16                         network_id;
  guint16                         initial_service_id;
};

struct _GstMpegtsDVBLinkageEvent
{
  guint16  target_event_id;
  gboolean target_listed;
  gboolean event_simulcast;
};

struct _GstMpegtsDVBLinkageExtendedEvent
{
  guint16        target_event_id;
  gboolean       target_listed;
  gboolean       event_simulcast;
  /* FIXME: */
  guint8         link_type;
  /* FIXME: */
  guint8         target_id_type;
  gboolean       original_network_id_flag;
  gboolean       service_id_flag;
  /* if (target_id_type == 3) */
  guint16        user_defined_id;
  /* else */
  guint16        target_transport_stream_id;
  guint16        target_original_network_id;
  guint16        target_service_id;
};

/**
 * GstMpegtsDVBLinkageDescriptor:
 * @transport_stream_id: the transport id
 * @original_network_id: the original network id
 * @service_id: the service id
 * @linkage_type: the type which @linkage_data has
 * @private_data_length: the length for @private_data_bytes
 * @private_data_bytes: additional data bytes
 */
struct _GstMpegtsDVBLinkageDescriptor
{
  guint16                           transport_stream_id;
  guint16                           original_network_id;
  guint16                           service_id;
  GstMpegtsDVBLinkageType           linkage_type;
  /*< private >*/
  gpointer                          linkage_data;
  /*< public >*/
  guint8                            private_data_length;
  guint8                            *private_data_bytes;
};

#define GST_TYPE_MPEGTS_DVB_LINKAGE_DESCRIPTOR ( gst_mpegts_dvb_linkage_descriptor_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_linkage_descriptor_get_type (void);

GST_MPEGTS_API
void gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source);

#define GST_TYPE_MPEGTS_DVB_LINKAGE_MOBILE_HAND_OVER (gst_mpegts_dvb_linkage_mobile_hand_over_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_linkage_mobile_hand_over_get_type (void);

GST_MPEGTS_API
const GstMpegtsDVBLinkageMobileHandOver * gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over
    (const GstMpegtsDVBLinkageDescriptor * desc);

#define GST_TYPE_MPEGTS_DVB_LINKAGE_EVENT (gst_mpegts_dvb_linkage_event_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_linkage_event_get_type (void);

GST_MPEGTS_API
const GstMpegtsDVBLinkageEvent * gst_mpegts_dvb_linkage_descriptor_get_event
    (const GstMpegtsDVBLinkageDescriptor * desc);

#define GST_TYPE_MPEGTS_DVB_LINKAGE_EXTENDED_EVENT (gst_mpegts_dvb_linkage_extended_event_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_linkage_extended_event_get_type (void);

GST_MPEGTS_API
const GPtrArray * gst_mpegts_dvb_linkage_descriptor_get_extended_event
    (const GstMpegtsDVBLinkageDescriptor * desc);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_linkage (const GstMpegtsDescriptor * descriptor,
                                                  GstMpegtsDVBLinkageDescriptor ** res);

/* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegtsDescriptor *descriptor,
						       gchar **language_code,
						       gchar **event_name,
						       gchar **text);

/* GST_MTS_DESC_DVB_EXTENDED_EVENT (0x4E) */
typedef struct _GstMpegtsExtendedEventDescriptor GstMpegtsExtendedEventDescriptor;
typedef struct _GstMpegtsExtendedEventItem GstMpegtsExtendedEventItem;

/* FIXME : Maybe make a separate method for getting a specific item entry ? */
struct _GstMpegtsExtendedEventItem
{
  gchar *item_description;
  gchar *item;
};

#define GST_TYPE_MPEGTS_EXTENDED_EVENT_ITEM (gst_mpegts_extended_event_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_extended_event_item_get_type(void);

/**
 * GstMpegtsExtendedEventDescriptor:
 * @descriptor_number:
 * @last_descriptor_number:
 * @language_code: NULL terminated language code.
 * @items: (element-type GstMpegtsExtendedEventItem): the #GstMpegtsExtendedEventItem
 * @text:
 *
 * Extended Event Descriptor (EN 300 468 v.1.13.1)
 */
struct _GstMpegtsExtendedEventDescriptor
{
  guint8 descriptor_number;
  guint8 last_descriptor_number;
  gchar  *language_code;
  GPtrArray *items;
  gchar *text;
};

#define GST_TYPE_MPEGTS_EXTENDED_EVENT_DESCRIPTOR (gst_mpegts_extended_event_descriptor_get_type())

GST_MPEGTS_API
GType gst_mpegts_extended_event_descriptor_get_type (void);

GST_MPEGTS_API
void gst_mpegts_extended_event_descriptor_free (GstMpegtsExtendedEventDescriptor * source);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_extended_event (const GstMpegtsDescriptor *descriptor,
							  GstMpegtsExtendedEventDescriptor **res);

/* GST_MTS_DESC_DVB_COMPONENT (0x50) */
#define GST_TYPE_MPEGTS_COMPONENT_DESCRIPTOR (gst_mpegts_component_descriptor_get_type ())
typedef enum {
  GST_MPEGTS_STREAM_CONTENT_MPEG2_VIDEO          = 0x01,
  GST_MPEGTS_STREAM_CONTENT_MPEG1_LAYER2_AUDIO   = 0x02,
  GST_MPEGTS_STREAM_CONTENT_TELETEXT_OR_SUBTITLE = 0x03,
  GST_MPEGTS_STREAM_CONTENT_AC_3                 = 0x04,
  GST_MPEGTS_STREAM_CONTENT_AVC                  = 0x05,
  GST_MPEGTS_STREAM_CONTENT_AAC                  = 0x06,
  GST_MPEGTS_STREAM_CONTENT_DTS                  = 0x07,
  GST_MPEGTS_STREAM_CONTENT_SRM_CPCM             = 0x08
} GstMpegtsComponentStreamContent;

typedef struct _GstMpegtsComponentDescriptor GstMpegtsComponentDescriptor;
struct _GstMpegtsComponentDescriptor
{
  guint8 stream_content;
  guint8 component_type;
  guint8 component_tag;
  gchar  *language_code;
  gchar  *text;
};

GST_MPEGTS_API
GType gst_mpegts_component_descriptor_get_type (void);

GST_MPEGTS_API
void gst_mpegts_dvb_component_descriptor_free (GstMpegtsComponentDescriptor * source);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegtsDescriptor *descriptor,
						    GstMpegtsComponentDescriptor **res);

/* GST_MTS_DESC_DVB_STREAM_IDENTIFIER (0x52) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegtsDescriptor *descriptor,
							    guint8 *component_tag);

/* GST_MTS_DESC_DVB_CA_IDENTIFIER (0x53) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_ca_identifier (const GstMpegtsDescriptor * descriptor,
                                                        GArray ** list);

/* GST_MTS_DESC_DVB_CONTENT (0x54) */
typedef enum {
  GST_MPEGTS_CONTENT_MOVIE_DRAMA                = 0x01,
  GST_MPEGTS_CONTENT_NEWS_CURRENT_AFFAIRS       = 0x02,
  GST_MPEGTS_CONTENT_SHOW_GAME_SHOW             = 0x03,
  GST_MPEGTS_CONTENT_SPORTS                     = 0x04,
  GST_MPEGTS_CONTENT_CHILDREN_YOUTH_PROGRAM     = 0x05,
  GST_MPEGTS_CONTENT_MUSIC_BALLET_DANCE         = 0x06,
  GST_MPEGTS_CONTENT_ARTS_CULTURE               = 0x07,
  GST_MPEGTS_CONTENT_SOCIAL_POLITICAL_ECONOMICS = 0x08,
  GST_MPEGTS_CONTENT_EDUCATION_SCIENCE_FACTUAL  = 0x09,
  GST_MPEGTS_CONTENT_LEISURE_HOBBIES            = 0x0A,
  GST_MPEGTS_CONTENT_SPECIAL_CHARACTERISTICS    = 0x0B
} GstMpegtsContentNibbleHi;

typedef struct _GstMpegtsContent GstMpegtsContent;
struct _GstMpegtsContent
{
  GstMpegtsContentNibbleHi content_nibble_1;
  guint8 content_nibble_2;
  guint8 user_byte;
};

#define GST_TYPE_MPEGTS_CONTENT (gst_mpegts_content_get_type ())

GST_MPEGTS_API
GType gst_mpegts_content_get_type (void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_content (const GstMpegtsDescriptor *
	descriptor, GPtrArray ** content);

/* GST_MTS_DESC_DVB_PARENTAL_RATING (0x55) */
typedef struct _GstMpegtsDVBParentalRatingItem GstMpegtsDVBParentalRatingItem;

#define GST_TYPE_MPEGTS_DVB_PARENTAL_RATING_ITEM (gst_mpegts_dvb_parental_rating_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_parental_rating_item_get_type (void);

/**
 * GstMpegtsDVBParentalRating:
 * @country_code: This 24-bit field identifies a country using the 3-character
 * code as specified in ISO 3166
 * @rating: the rating age
 */
struct _GstMpegtsDVBParentalRatingItem
{
  gchar  *country_code;
  guint8 rating;
};

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_parental_rating (const GstMpegtsDescriptor
        * descriptor, GPtrArray ** rating);

/* GST_MTS_DESC_DVB_TELETEXT (0x56) */
/**
 * GstMpegtsDVBTeletextType:
 *
 * The type of teletext page.
 *
 * As specified in Table 100 of ETSI EN 300 468 v1.13.1
 */
typedef enum {
  INITIAL_PAGE = 0x01,
  SUBTITLE_PAGE,
  ADDITIONAL_INFO_PAGE,
  PROGRAMME_SCHEDULE_PAGE,
  HEARING_IMPAIRED_PAGE
} GstMpegtsDVBTeletextType;

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_teletext_idx (const GstMpegtsDescriptor *
    descriptor, guint idx, gchar ** language_code,
    GstMpegtsDVBTeletextType * teletext_type, guint8 * magazine_number,
    guint8 * page_number);

GST_MPEGTS_API
guint gst_mpegts_descriptor_parse_dvb_teletext_nb (const GstMpegtsDescriptor *
    descriptor);

/* GST_MTS_DESC_DVB_SUBTITLING (0x59) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_subtitling_idx (const GstMpegtsDescriptor *descriptor,
							 guint idx, gchar ** lang,
							 guint8 *type, guint16 *composition_page_id,
							 guint16 *ancillary_page_id);

GST_MPEGTS_API
guint gst_mpegts_descriptor_parse_dvb_subtitling_nb (const GstMpegtsDescriptor *descriptor);

GST_MPEGTS_API
GstMpegtsDescriptor * gst_mpegts_descriptor_from_dvb_subtitling (const gchar *lang,
    guint8 type, guint16 composition, guint16 ancillary);



/* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */
typedef struct _GstMpegtsTerrestrialDeliverySystemDescriptor GstMpegtsTerrestrialDeliverySystemDescriptor;

typedef enum {
  GST_MPEGTS_TRANSMISSION_MODE_2K = 0,
  GST_MPEGTS_TRANSMISSION_MODE_8K,
  GST_MPEGTS_TRANSMISSION_MODE_AUTO,
  GST_MPEGTS_TRANSMISSION_MODE_4K,
  GST_MPEGTS_TRANSMISSION_MODE_1K,
  GST_MPEGTS_TRANSMISSION_MODE_16K,
  GST_MPEGTS_TRANSMISSION_MODE_32K,
  GST_MPEGTS_TRANSMISSION_MODE_C1,
  GST_MPEGTS_TRANSMISSION_MODE_C3780
} GstMpegtsTerrestrialTransmissionMode;

typedef enum {
  GST_MPEGTS_GUARD_INTERVAL_1_32 = 0,
  GST_MPEGTS_GUARD_INTERVAL_1_16,
  GST_MPEGTS_GUARD_INTERVAL_1_8,
  GST_MPEGTS_GUARD_INTERVAL_1_4,
  GST_MPEGTS_GUARD_INTERVAL_AUTO,
  GST_MPEGTS_GUARD_INTERVAL_1_128,
  GST_MPEGTS_GUARD_INTERVAL_19_128,
  GST_MPEGTS_GUARD_INTERVAL_19_256,
  GST_MPEGTS_GUARD_INTERVAL_PN420,
  GST_MPEGTS_GUARD_INTERVAL_PN595,
  GST_MPEGTS_GUARD_INTERVAL_PN945
} GstMpegtsTerrestrialGuardInterval;

typedef enum {
  GST_MPEGTS_HIERARCHY_NONE = 0,
  GST_MPEGTS_HIERARCHY_1,
  GST_MPEGTS_HIERARCHY_2,
  GST_MPEGTS_HIERARCHY_4,
  GST_MPEGTS_HIERARCHY_AUTO
} GstMpegtsTerrestrialHierarchy;

/**
 * GstMpegtsTerrestrialDeliverySystemDescriptor:
 * @frequency: the frequency in Hz (Hertz)
 * @bandwidth: the bandwidth in Hz (Hertz)
 * @priority: %TRUE High Priority %FALSE Low Priority
 * @time_slicing: %TRUE no time slicing %FALSE time slicing
 * @mpe_fec: %TRUE no mpe-fec is used %FALSE mpe-fec is use
 * @constellation: the constellation
 * @hierarchy: the hierarchy
 * @code_rate_hp:
 * @code_rate_lp:
 * @guard_interval:
 * @transmission_mode:
 * @other_frequency: %TRUE more frequency are use, else not
 *
 * Terrestrial Delivery System Descriptor (EN 300 468 v.1.13.1)
 */

struct _GstMpegtsTerrestrialDeliverySystemDescriptor
{
  guint32				frequency;
  guint32				bandwidth;
  gboolean				priority;
  gboolean				time_slicing;
  gboolean				mpe_fec;
  GstMpegtsModulationType		constellation;
  GstMpegtsTerrestrialHierarchy		hierarchy;
  GstMpegtsDVBCodeRate			code_rate_hp;
  GstMpegtsDVBCodeRate			code_rate_lp;
  GstMpegtsTerrestrialGuardInterval	guard_interval;
  GstMpegtsTerrestrialTransmissionMode	transmission_mode;
  gboolean				other_frequency;
};

#define GST_TYPE_MPEGTS_TERRESTRIAL_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_terrestrial_delivery_system_descriptor_get_type())

GST_MPEGTS_API
GType gst_mpegts_terrestrial_delivery_system_descriptor_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_terrestrial_delivery_system (const GstMpegtsDescriptor
              *descriptor, GstMpegtsTerrestrialDeliverySystemDescriptor * res);

/* GST_MTS_DESC_DVB_MULTILINGUAL_NETWORK_NAME (0x5B) */
typedef struct _GstMpegtsDvbMultilingualNetworkNameItem GstMpegtsDvbMultilingualNetworkNameItem;

/**
 * GstMpegtsDvbMultilingualNetworkNameItem:
 * @language_code: the ISO 639 language code
 * @network_name: the network name
 *
 * a multilingual network name entry
 */
struct _GstMpegtsDvbMultilingualNetworkNameItem
{
  gchar *language_code;
  gchar *network_name;
};

#define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_NETWORK_NAME_ITEM (gst_mpegts_dvb_multilingual_network_name_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_multilingual_network_name_item_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_network_name (const GstMpegtsDescriptor
              *descriptor, GPtrArray ** network_name_items);

/* GST_MTS_DESC_DVB_MULTILINGUAL_BOUQUET_NAME (0x5C) */
typedef struct _GstMpegtsDvbMultilingualBouquetNameItem GstMpegtsDvbMultilingualBouquetNameItem;

/**
 * GstMpegtsDvbMultilingualBouquetNameItem:
 * @language_code: the ISO 639 language code
 * @bouquet_name: the bouquet name
 *
 * a multilingual bouquet name entry
 */
struct _GstMpegtsDvbMultilingualBouquetNameItem
{
  gchar *language_code;
  gchar *bouquet_name;
};

#define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_BOUQUET_NAME_ITEM (gst_mpegts_dvb_multilingual_bouquet_name_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_multilingual_bouquet_name_item_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name (const GstMpegtsDescriptor
              *descriptor, GPtrArray ** bouquet_name_items);

/* GST_MTS_DESC_DVB_MULTILINGUAL_SERVICE_NAME (0x5D) */
typedef struct _GstMpegtsDvbMultilingualServiceNameItem GstMpegtsDvbMultilingualServiceNameItem;

/**
 * GstMpegtsDvbMultilingualServiceNameItem:
 * @language_code: the ISO 639 language code
 * @provider_name: the provider name
 * @service_name: the service name
 *
 * a multilingual service name entry
 */
struct _GstMpegtsDvbMultilingualServiceNameItem
{
  gchar *language_code;
  gchar *provider_name;
  gchar *service_name;
};

#define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_SERVICE_NAME_ITEM (gst_mpegts_dvb_multilingual_service_name_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_multilingual_service_name_item_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_service_name (const GstMpegtsDescriptor
              *descriptor, GPtrArray ** service_name_items);

/* GST_MTS_DESC_DVB_MULTILINGUAL_COMPONENT (0x5E) */
typedef struct _GstMpegtsDvbMultilingualComponentItem GstMpegtsDvbMultilingualComponentItem;

/**
 * GstMpegtsDvbMultilingualComponentItem:
 * @language_code: the ISO 639 language code
 * @description: the component description
 */
struct _GstMpegtsDvbMultilingualComponentItem
{
  gchar *language_code;
  gchar *description;
};

#define GST_TYPE_MPEGTS_DVB_MULTILINGUAL_COMPONENT_ITEM (gst_mpegts_dvb_multilingual_component_item_get_type())

GST_MPEGTS_API
GType gst_mpegts_dvb_multilingual_component_item_get_type(void);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_multilingual_component (const GstMpegtsDescriptor
              *descriptor, guint8 * component_tag, GPtrArray ** component_description_items);

/* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_private_data_specifier (const GstMpegtsDescriptor
              * descriptor, guint32 * private_data_specifier, guint8 ** private_data,
              guint8 * length);

/* GST_MTS_DESC_DVB_FREQUENCY_LIST (0x62) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_frequency_list (const GstMpegtsDescriptor
    * descriptor, gboolean * offset, GArray ** list);

/* GST_MTS_DESC_DVB_DATA_BROADCAST (0x64) */
typedef struct _GstMpegtsDataBroadcastDescriptor GstMpegtsDataBroadcastDescriptor;

/**
 * GstMpegtsDataBroadcastDescriptor:
 * @data_broadcast_id: the data broadcast id
 * @component_tag: the component tag
 * @selector_bytes: the selector byte field
 * @language_code: language of @text
 * @text: description of data broadcast
 */
struct _GstMpegtsDataBroadcastDescriptor
{
  guint16     data_broadcast_id;
  guint8      component_tag;
  guint8      length;
  guint8      *selector_bytes;
  gchar       *language_code;
  gchar       *text;
};


#define GST_TYPE_MPEGTS_DVB_DATA_BROADCAST_DESCRIPTOR (gst_mpegts_dvb_data_broadcast_descriptor_get_type ())
GST_MPEGTS_API
GType gst_mpegts_dvb_data_broadcast_descriptor_get_type (void);

GST_MPEGTS_API
void gst_mpegts_dvb_data_broadcast_descriptor_free (GstMpegtsDataBroadcastDescriptor * source);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast (const GstMpegtsDescriptor
              *descriptor, GstMpegtsDataBroadcastDescriptor ** res);

/* GST_MTS_DESC_DVB_SCRAMBLING (0x65) */
typedef enum
{
  GST_MPEGTS_DVB_SCRAMBLING_MODE_RESERVED              = 0x00,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA1                  = 0x01,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA2                  = 0x02,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_STANDARD         = 0x03,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_MINIMAL_ENHANCED = 0x04,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CSA3_FULL_ENHANCED    = 0x05,
  /* 0x06 - 0x0f reserved for future use */
  GST_MPEGTS_DVB_SCRAMBLING_MODE_CISSA                 = 0x10,
  /* 0x11 - 0x1f reserved for future DVB-CISSA versions */
  GST_MPEGTS_DVB_SCRAMBLING_MODE_ATIS_0                = 0x70,
  GST_MPEGTS_DVB_SCRAMBLING_MODE_ATIS_F                = 0x7f,
} GstMpegtsDVBScramblingModeType;

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_scrambling (const GstMpegtsDescriptor * descriptor,
       GstMpegtsDVBScramblingModeType * scrambling_mode);

/* GST_MTS_DESC_DVB_DATA_BROADCAST_ID (0x66) */

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast_id (const GstMpegtsDescriptor
       * descriptor, guint16 * data_broadcast_id, guint8 ** id_selector_bytes, guint8 * len);

/* GST_MTS_DESC_DVB_AC3 (0x6a) */
/* FIXME : Implement */

/* GST_MTS_DESC_EXT_DVB_T2_DELIVERY_SYSTEM (0x7F && 0x04) */
typedef struct _GstMpegtsT2DeliverySystemCellExtension GstMpegtsT2DeliverySystemCellExtension;

/**
 * GstMpegtsT2DeliverySystemCellExtension:
 * @cell_id_extension: id of the sub cell
 * @transposer_frequency: centre frequency of the sub cell in Hz
 */
struct _GstMpegtsT2DeliverySystemCellExtension
{
  guint8  cell_id_extension;
  guint32 transposer_frequency;
};

#define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_CELL_EXTENSION (gst_mpegts_t2_delivery_system_cell_extension_get_type())

GST_MPEGTS_API
GType gst_mpegts_t2_delivery_system_cell_extension_get_type(void);

typedef struct _GstMpegtsT2DeliverySystemCell GstMpegtsT2DeliverySystemCell;

/**
 * GstMpegtsT2DeliverySystemCell:
 * @cell_id: id of the cell
 * @centre_frequencies: (element-type guint32): centre frequencies in Hz
 * @sub_cells: (element-type GstMpegtsT2DeliverySystemCellExtension):
 */
struct _GstMpegtsT2DeliverySystemCell
{
  guint16      cell_id;
  GArray       *centre_frequencies;
  GPtrArray    *sub_cells;
};

#define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_CELL (gst_mpegts_t2_delivery_system_cell_get_type())

GST_MPEGTS_API
GType gst_mpegts_t2_delivery_system_cell_get_type(void);

typedef struct _GstMpegtsT2DeliverySystemDescriptor GstMpegtsT2DeliverySystemDescriptor;

/**
 * GstMpegtsT2DeliverySystemDescriptor:
 * @plp_id:
 * @t2_system_id:
 * @siso_miso:
 * @bandwidth:
 * @guard_interval:
 * @transmission_mode:
 * @other_frequency:
 * @tfs:
 * @cells: (element-type GstMpegtsT2DeliverySystemCell):
 *
 * describe DVB-T2 transmissions according to EN 302 755
 */
struct _GstMpegtsT2DeliverySystemDescriptor
{
  guint8                                plp_id;
  guint16                               t2_system_id;
  /* FIXME: */
  guint8                                siso_miso;
  guint32                               bandwidth;
  GstMpegtsTerrestrialGuardInterval     guard_interval;
  GstMpegtsTerrestrialTransmissionMode  transmission_mode;
  gboolean                              other_frequency;
  gboolean                              tfs;
  GPtrArray                             *cells;
};

#define GST_TYPE_MPEGTS_T2_DELIVERY_SYSTEM_DESCRIPTOR (gst_mpegts_t2_delivery_system_descriptor_get_type ())
GST_MPEGTS_API
GType gst_mpegts_t2_delivery_system_descriptor_get_type (void);

GST_MPEGTS_API
void gst_mpegts_t2_delivery_system_descriptor_free (GstMpegtsT2DeliverySystemDescriptor * source);

GST_MPEGTS_API
gboolean gst_mpegts_descriptor_parse_dvb_t2_delivery_system (const GstMpegtsDescriptor
              *descriptor, GstMpegtsT2DeliverySystemDescriptor ** res);

/**
 * GstMpegtsAudioPreselectionDescriptor:
 * @preselection_id: 5-bit
 * @audio_rendering_indication: 3-bit field
 * @audio_description: visually impaired
 * @spoken_subtitles:
 * @dialogue_enhancement:
 * @interactivity_enabled:
 * @language_code_present:
 * @text_label_present:
 * @multi_stream_info_present: indicates if this PID conveys a complete audio programme
 * @future_extension:
 * @language_code: NULL terminated ISO 639 language code.
 * @message_id:
 * @items: (element-type GstMpegtsExtendedEventItem): the #GstMpegtsExtendedEventItem
 * @text:
 *
 * Table 110: Audio Preselection Descriptor (ETSI EN 300 468 v1.16.1)
 *
 * Since: 1.20
 */
typedef struct _GstMpegtsAudioPreselectionDescriptor GstMpegtsAudioPreselectionDescriptor;
struct _GstMpegtsAudioPreselectionDescriptor
{
  guint8                                preselection_id;
  guint8                                audio_rendering_indication;
  gboolean                              audio_description;
  gboolean                              spoken_subtitles;
  gboolean                              dialogue_enhancement;
  gboolean                              interactivity_enabled;
  gboolean                              language_code_present;
  gboolean                              text_label_present;
  gboolean                              multi_stream_info_present;
  gboolean                              future_extension;
  gchar                                 *language_code;
  guint8                                message_id;
};

GST_MPEGTS_API
gboolean
gst_mpegts_descriptor_parse_audio_preselection_list (const GstMpegtsDescriptor
    * descriptor, GPtrArray ** list);

/**
 * gst_mpegts_descriptor_parse_audio_preselection_free:
 *
 * Since: 1.20
 */
GST_MPEGTS_API
void
gst_mpegts_descriptor_parse_audio_preselection_free (GstMpegtsAudioPreselectionDescriptor
    * source);

/**
 * gst_mpegts_descriptor_parse_audio_preselection_dump:
 *
 * Since: 1.20
 */
GST_MPEGTS_API
void
gst_mpegts_descriptor_parse_audio_preselection_dump (GstMpegtsAudioPreselectionDescriptor
    * source);


G_END_DECLS

#endif				/* GST_MPEGTS_DESCRIPTOR_H */