MythTV  master
dvbdescriptors.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2004, Daniel Thor Kristjansson
3 #ifndef _DVB_DESCRIPTORS_H_
4 #define _DVB_DESCRIPTORS_H_
5 
6 #include <QMutex>
7 #include <QString>
8 
9 #include "mythtvexp.h" // MTV_PUBLIC - Symbol Visibility
10 #include "mpegdescriptors.h"
11 #include "programinfo.h" // for subtitle types and audio and video properties
12 
13 /*
14 // needed for scanning
15  conditional_access = 0x09, // maybe
16  satellite_delivery_system = 0x43,*
17  cable_delivery_system = 0x44,*
18  service = 0x48,*
19  terrestrial_delivery_system = 0x5A,*
20  frequency_list = 0x62,*
21 
22 // needed for captions
23  teletext = 0x56,
24  subtitling = 0x59,
25 
26 // needed for sound
27  registration = 0x05,
28  AC3 = 0x6A,
29 
30 // needed for eit
31  short_event = 0x4D,
32  extended_event = 0x4E,
33  content = 0x54,
34 */
35 
36 static QString coderate_inner(uint coderate);
37 
38 extern QString dvb_decode_text(const unsigned char *src, uint length,
39  const unsigned char *encoding_override,
40  uint encoding_override_length);
41 
42 inline QString dvb_decode_text(const unsigned char *src, uint length)
43 {
44  return dvb_decode_text(src, length, nullptr, 0);
45 }
46 
47 QString dvb_decode_short_name(const unsigned char *src, uint raw_length);
48 
49 #define byteBCDH2int(i) (i >> 4)
50 #define byteBCDL2int(i) (i & 0x0f)
51 #define byteBCD2int(i) (byteBCDH2int(i) * 10 + byteBCDL2int(i))
52 #define byte2BCD2int(i, j) \
53  (byteBCDH2int(i) * 1000 + byteBCDL2int(i) * 100 + \
54  byteBCDH2int(j) * 10 + byteBCDL2int(j))
55 #define byte3BCD2int(i, j, k) \
56  (byteBCDH2int(i) * 100000 + byteBCDL2int(i) * 10000 + \
57  byteBCDH2int(j) * 1000 + byteBCDL2int(j) * 100 + \
58  byteBCDH2int(k) * 10 + byteBCDL2int(k))
59 #define byte4BCD2int(i, j, k, l) \
60  (byteBCDH2int(i) * 10000000LL + byteBCDL2int(i) * 1000000 + \
61  byteBCDH2int(j) * 100000 + byteBCDL2int(j) * 10000 + \
62  byteBCDH2int(k) * 1000 + byteBCDL2int(k) * 100 + \
63  byteBCDH2int(l) * 10 + byteBCDL2int(l))
64 
65 // DVB Bluebook A038 (Sept 2011) p 77
67 {
68  public:
69  NetworkNameDescriptor(const unsigned char *data, int len = 300) :
70  MPEGDescriptor(data, len, DescriptorID::network_name) { }
71  // Name bits loc expected value
72  // descriptor_tag 8 0.0 0x40
73  // descriptor_length 8 1.0
74  // for (i=0;i<N;i++){ char 8 uimsbf }
75  QString Name(void) const
76  { return dvb_decode_text(_data+2, DescriptorLength()); }
77  QString ShortName(void) const
79  QString toString(void) const override // MPEGDescriptor
80  { return QString("NetworkNameDescriptor: ")+Name(); }
81 };
82 
83 // DVB Bluebook A038 (Sept 2011) p 63
85 {
86  public:
87  LinkageDescriptor(const unsigned char *data, int len = 300) :
88  MPEGDescriptor(data, len, DescriptorID::linkage)
89  {
90  if (!_data)
91  return;
92  if (DescriptorLength() < 7)
93  {
94  _data = nullptr;
95  }
96  else if (kMobileHandOver == LinkageType())
97  {
98  uint end = 8;
99  if (DescriptorLength() < end)
100  {
101  _data = nullptr;
102  return;
103  }
104  end += (HasMobileNetworkID()) ? 2 : 0;
105  end += (HasMobileInitialServiceID()) ? 2 : 0;
106  if (DescriptorLength() < end)
107  _data = nullptr;
108  m_offset = end + 2;
109  }
110  else if (kEventLinkage == LinkageType())
111  {
112  if (DescriptorLength() < 10)
113  _data = nullptr;
114  m_offset = 12;
115  }
116  }
117  // Name bits loc expected value
118  // descriptor_tag 8 0.0 0x4A
119  // descriptor_length 8 1.0
120  // transport_stream_id 16 2.0
121  uint TSID(void) const { return (_data[2]<<8) | _data[3]; }
122  // original_network_id 16 4.0
123  uint OriginalNetworkID() const { return (_data[4]<<8) | _data[5]; }
124  // service_id 16 6.0
125  uint ServiceID(void) const { return (_data[6]<<8) | _data[7]; }
126  // linkage_type 8 8.0
127  enum
128  {
130  kEPGService = 0x02,
135  kRCSMap = 0x07,
142  };
143  uint LinkageType(void) const { return _data[8]; }
144  QString LinkageTypeString(void) const;
145 
146  // if (linkage_type == 0x08)
147  // {
148  // hand-over_type 4 9.0
149  enum
150  {
154  };
155  uint MobileHandOverType(void) const { return _data[9]>>4; }
156  QString MobileHandOverTypeString(void) const;
157  // reserved_future_use 3 9.4
158  // origin_type 1 9.7
159  enum
160  {
161  kOriginNIT = 0x0,
162  kOriginSDT = 0x1,
163  };
164  uint MobileOriginType(void) const { return _data[9]&0x1; }
165  QString MobileOriginTypeString(void) const;
166  // if (hand-over_type == 0x01 || hand-over_type == 0x02 ||
167  // hand-over_type == 0x03)
168  // { network_id 16 10.0 }
169  bool HasMobileNetworkID(void) const
170  { return bool(MobileHandOverType() & 0x3); }
171  uint MobileNetworkID(void) const { return (_data[10]<<8) | _data[11]; }
172  // if (origin_type ==0x00)
173  // { initial_service_id 16 HasNetworkID()?10.0:12.0 }
174  bool HasMobileInitialServiceID(void) const
175  { return kOriginNIT == MobileOriginType(); }
177  {
178  return HasMobileNetworkID() ?
179  ((_data[12]<<8) | _data[13]) : ((_data[10]<<8) | _data[11]);
180  }
181  // }
182  // if (linkage_type == 0x0D)
183  // {
184  // target_event_id 16 9.0
185  uint TargetEventID(void) const { return (_data[9]<<8) | _data[10]; }
186  // target_listed 1 11.0
187  bool IsTargetListed(void) const { return ( _data[11]&0x80 ) != 0; }
188  // event_simulcast 1 11.1
189  bool IsEventSimulcast(void) const { return ( _data[11]&0x40 ) != 0; }
190  // reserved 6 11.2
191  // }
192  // for (i=0;i<N;i++)
193  // { private_data_byte 8 bslbf }
194  const unsigned char *PrivateData(void) const
195  { return &_data[m_offset]; }
197  { return DescriptorLength() + 2 - m_offset; }
198 
199  private:
201 };
202 
203 // DVB Bluebook A038 (Sept 2011) p 38
205 {
206  public:
207  AdaptationFieldDataDescriptor(const unsigned char *data, int len = 300) :
208  MPEGDescriptor(data, len, DescriptorID::adaptation_field_data, 1) { }
209  // Name bits loc expected value
210  // descriptor_tag 8 0.0 0x70
211  // descriptor_length 8 1.0
212  // adapt_field_data_id 8 2.0
213  uint AdaptationFieldDataID(void) const { return _data[2]; }
214  QString toString(void) const override // MPEGDescriptor
215  {
216  return QString("AdaptationFieldDataDescriptor "
217  "adaptation_field_data_identifier(%1)")
218  .arg(AdaptationFieldDataID());
219  }
220 };
221 
222 // DVB Bluebook A038 (Sept 2011) p 38
224 {
225  public:
226  AncillaryDataDescriptor(const unsigned char *data, int len = 300) :
227  MPEGDescriptor(data, len, DescriptorID::ancillary_data, 1) { }
228  // Name bits loc expected value
229  // descriptor_tag 8 0.0 0x6b
230  // descriptor_length 8 1.0
231  // ancillary_data_id 8 2.0
232  uint AncillaryDataID(void) const { return _data[2]; }
233  QString toString(void) const override // MPEGDescriptor
234  {
235  return QString("AncillaryDataDescriptor "
236  "ancillary_data_identifier(%1)")
237  .arg(AncillaryDataID());
238  }
239 };
240 
241 // DVB Bluebook A038 (Sept 2011) p 39
243 {
244  public:
245  AnnouncementSupportDescriptor(const unsigned char *data, int len = 300) :
246  MPEGDescriptor(data, len, DescriptorID::announcement_support) { }
247  // Name bits loc expected value
248  // descriptor_tag 8 0.0 0x6e
249  // descriptor_length 8 1.0
250  // announcmnt_supprt_indic 16 2.0
251  // for (i=0; i<N; i++)
252  // {
253  // announcement_type 4 0.0+p
254  // reserved_future_use 1 0.4+p
255  // reference_type 3 0.5+p
256  // if (reference_type & 0x3)
257  // {
258  // original_network_id 16 0.0+p
259  // transport_stream_id 16 2.0+p
260  // service_id 16 4.0+p
261  // component_tag 8 6.0+p
262  // } 7.0
263  // }
264 };
265 
266 // DVB Bluebook A038 (Sept 2011) p 41
268 {
269  public:
270  BouquetNameDescriptor(const unsigned char *data, int len = 300) :
271  MPEGDescriptor(data, len, DescriptorID::bouquet_name) { }
272  // Name bits loc expected value
273  // descriptor_tag 8 0.0 0x47
274  // descriptor_length 8 1.0
275  // for(i=0;i<N;i++) { char 8 }
276  QString BouquetName(void) const
277  { return dvb_decode_text(_data+2, _data[1]); }
278  QString BouquetShortName(void) const
279  { return dvb_decode_short_name(_data+2, _data[1]); }
280 
281  QString toString(void) const override // MPEGDescriptor
282  {
283  return QString("BouquetNameDescriptor: Bouquet Name(%1)")
284  .arg(BouquetName());
285  }
286 };
287 
288 // DVB Bluebook A038 (Sept 2011) p 41
290 {
291  public:
292  CAIdentifierDescriptor(const unsigned char *data, int len = 300) :
293  MPEGDescriptor(data, len, DescriptorID::ca_identifier) { }
294  // Name bits loc expected value
295  // descriptor_tag 8 0.0 0x53
296  // descriptor_length 8 1.0
297  //
298  uint CASystemCount(void) const { return DescriptorLength() >> 1; }
299  // for (i=0; i<N; i++)
300  // { CA_system_id 16 }
301  int CASystemId(uint i) const
302  { return (_data[2 + i*2] << 8) | _data[3 + i*2]; }
303  QString toString(void) const override; // MPEGDescriptor
304 };
305 
306 // DVB Bluebook A038 (Sept 2011) p 42
308 {
309  public:
310  CellFrequencyLinkDescriptor(const unsigned char *data, int len = 300) :
311  MPEGDescriptor(data, len, DescriptorID::cell_frequency_link) { }
312  // Name bits loc expected value
313  // descriptor_tag 8 0.0 0x6d
314  // descriptor_length 8 1.0
315  // for (i=0; i<N; i++)
316  // {
317  // cell_id 16 0.0+p
318  // frequency 32 2.0+p
319  // subcell_info_loop_len 8 6.0+p
320  // for (j=0;j<N;j++)
321  // {
322  // cell_id_extension 8 0.0+p2
323  // transposer_freq 32 1.0+p2
324  // } 5.0
325  // }
326 };
327 
328 // DVB Bluebook A038 (Sept 2011) p 42
330 {
331  public:
332  CellListDescriptor(const unsigned char *data, int len = 300) :
333  MPEGDescriptor(data, len, DescriptorID::cell_list) { }
334  // Name bits loc expected value
335  // descriptor_tag 8 0.0 0x6c
336  // descriptor_length 8 1.0
337  // for (i=0; i<N; i++)
338  // {
339  // cell_id 16 0.0+p
340  // cell_latitude 16 2.0+p
341  // cell_longitude 16 4.0+p
342  // cell_extent_of_lat 12 6.0+p
343  // cell_extent_of_longit 12 7.4+p
344  // subcell_info_loop_len 8 9.0+p
345  // for (j=0;j<N;j++)
346  // {
347  // cell_id_extension 8 0.0+p2
348  // subcell_latitude 16 1.0+p2
349  // subcell_longitude 16 3.0+p2
350  // subcell_ext_of_lat 12 4.0+p2
351  // subcell_ext_of_long 12 5.4+p2
352  // } 7.0
353  // }
354 };
355 
356 // DVB Bluebook A038 (Sept 2011) p 44
358 {
359  public:
360  ComponentDescriptor(const unsigned char *data, int len = 300) :
361  MPEGDescriptor(data, len, DescriptorID::component) { }
362  // Name bits loc expected value
363  // descriptor_tag 8 0.0 0x50
364  // descriptor_length 8 1.0
365  // reserved_future_use 4 2.0
366  // stream_content 4 2.4
367  uint StreamContent(void) const { return _data[2] & 0xf; }
368  // component_type 8 3.0
369  uint ComponentType(void) const { return _data[3]; }
370  // component_tag 8 4.0
371  uint ComponentTag(void) const { return _data[4]; }
372  // ISO_639_language_code 24 5.0
373  int LanguageKey(void) const
374  { return iso639_str3_to_key(&_data[5]); }
375  QString LanguageString(void) const
376  { return iso639_key_to_str3(LanguageKey()); }
377  int CanonicalLanguageKey(void) const
379  QString CanonicalLanguageString(void) const
381  //
382  // for (i=0; i<N; i++) { text_char 8 }
383 
384  bool IsVideo(void) const
385  {
386  return 0x1 == StreamContent() || // MPEG-2
387  0x5 == StreamContent() || // H.264
388  0x9 == StreamContent(); // HEVC
389  }
390  bool IsAudio(void) const
391  {
392  switch(StreamContent())
393  {
394  case 0x02:
395  case 0x04:
396  case 0x06:
397  case 0x07:
398  return true;
399  default:
400  return false;
401  }
402  }
403  bool IsSubtitle(void) const { return 0x3 == StreamContent(); }
404 
405  unsigned char VideoProperties(void) const
406  {
407  if (0x1 == StreamContent())
408  return MPEG2Properties();
409  if (0x5 == StreamContent())
410  return VID_AVC | AVCProperties();
411  if (0x9 == StreamContent())
412  return /* VID_HEVC | */ HEVCProperties();
413 
414  return VID_UNKNOWN;
415  }
416 
417  unsigned char MPEG2Properties(void) const
418  {
419  switch(ComponentType())
420  {
421  case 0x2: case 0x3: case 0x4:
422  case 0x6: case 0x7: case 0x8:
423  return VID_WIDESCREEN;
424  case 0x09:
425  case 0x0D:
426  return VID_HDTV;
427  case 0x0A: case 0x0B: case 0x0C:
428  case 0x0E: case 0x0F: case 0x10:
429  return VID_WIDESCREEN | VID_HDTV;
430  default:
431  return VID_UNKNOWN;
432  }
433  }
434 
435  unsigned char AVCProperties(void) const
436  {
437  switch(ComponentType())
438  {
439  case 0x3: case 0x4:
440  case 0x7: case 0x8:
441  return VID_WIDESCREEN;
442  case 0x0B: case 0x0C:
443  case 0x0F: case 0x10:
444  return VID_WIDESCREEN | VID_HDTV;
445  case 0x80: case 0x81:
446  case 0x82: case 0x83:
447  return VID_WIDESCREEN | VID_HDTV | VID_3DTV;
448  default:
449  return VID_UNKNOWN;
450  }
451  }
452 
453  unsigned char HEVCProperties(void) const
454  {
455  switch(ComponentType())
456  {
457  case 0x0: case 0x1:
458  case 0x2: case 0x3:
459  return VID_HDTV;
460  case 0x5:
461  return VID_HDTV; // | VID_UHDTV;
462  default:
463  return VID_UNKNOWN;
464  }
465  }
466 
467  unsigned char AudioProperties(void) const
468  {
469  switch (StreamContent())
470  {
471  case 0x2:
472  return MP2Properties();
473  case 0x04:
474  return AC3Properties();
475  case 0x06:
476  return HEAACProperties();
477  default:
478  return AUD_UNKNOWN;
479  }
480  }
481 
482  unsigned char MP2Properties(void) const
483  {
484  switch (ComponentType())
485  {
486  case 0x1:
487  return AUD_MONO;
488  case 0x3:
489  return AUD_STEREO;
490  case 0x5:
491  return AUD_SURROUND;
492  case 0x40:
493  return AUD_VISUALIMPAIR;
494  case 0x41:
495  return AUD_HARDHEAR;
496  default:
497  return AUD_UNKNOWN;
498  }
499  }
500 
501  unsigned char AC3Properties(void) const
502  {
503  unsigned char properties = AUD_UNKNOWN;
504 
505  switch (ComponentType() & 0x7)
506  {
507  case 0x0:
508  properties |= AUD_MONO;
509  break;
510  case 0x2:
511  properties |= AUD_STEREO;
512  break;
513  case 0x3:
514  properties |= AUD_DOLBY;
515  break;
516  case 0x4: case 0x5:
517  properties |= AUD_SURROUND;
518  break;
519  }
520 
521  if (((ComponentType() >> 3) & 0x7) == 0x2)
522  properties |= AUD_VISUALIMPAIR;
523 
524  if (((ComponentType() >> 3) & 0x7) == 0x3)
525  properties |= AUD_HARDHEAR;
526 
527  return properties;
528  }
529 
530  unsigned char HEAACProperties(void) const
531  {
532  switch (ComponentType())
533  {
534  case 0x1:
535  return AUD_MONO;
536  case 0x3:
537  case 0x43:
538  return AUD_STEREO;
539  case 0x5:
540  return AUD_SURROUND;
541  case 0x40:
542  case 0x44:
543  return AUD_VISUALIMPAIR;
544  case 0x41:
545  case 0x45:
546  return AUD_HARDHEAR;
547  default:
548  return AUD_UNKNOWN;
549  }
550  }
551 
552  unsigned char SubtitleType(void) const
553  {
554  if (!IsSubtitle())
555  return SUB_UNKNOWN;
556 
557  switch (ComponentType())
558  {
559  case 0x1:
560  case 0x3:
561  case 0x10: case 0x11: case 0x12: case 0x13:
562  return SUB_NORMAL;
563  case 0x20: case 0x21: case 0x22: case 0x23:
564  return SUB_HARDHEAR;
565  default:
566  return SUB_UNKNOWN;
567  }
568  }
569 
570  QString toString(void) const override // MPEGDescriptor
571  {
572  return QString("ComponentDescriptor(stream_content: 0x%1, "
573  "component_type: 0x%2)").arg(StreamContent(), 0, 16)
574  .arg(ComponentType(), 0, 16);
575  }
576 };
577 
578 // DVB Bluebook A038 (Sept 2011) p 46
580 {
581  public:
582  ContentDescriptor(const unsigned char *data, int len = 300) :
583  MPEGDescriptor(data, len, DescriptorID::content) { }
584  // Name bits loc expected value
585  // descriptor_tag 8 0.0 0x54
586  // descriptor_length 8 1.0
587 
588  uint Count(void) const { return DescriptorLength() >> 1; }
589  // for (i=0;i<N;i++)
590  // {
591  // content_nibble_level_1 4 0.0+p
592  uint Nibble1(uint i) const { return _data[2 + (i<<1)] >> 4; }
593  // content_nibble_level_2 4 0.4+p
594  uint Nibble2(uint i) const { return _data[2 + (i<<1)] & 0xf; }
595 
596  uint Nibble(uint i) const { return _data[2 + (i<<1)]; }
597 
598  // user_nibble 4 1.0+p
599  uint UserNibble1(uint i) const { return _data[3 + (i<<1)] >> 4; }
600  // user_nibble 4 1.4+p
601  uint UserNibble2(uint i) const { return _data[3 + (i<<1)] & 0xf; }
602  uint UserNibble(uint i) const { return _data[3 + (i<<1)]; }
603  // } 2.0
604 
606  QString GetDescription(uint i) const;
607  QString toString(void) const override; // MPEGDescriptor
608 
609  protected:
610  static void Init(void);
611 
612  protected:
613  static QMutex categoryLock;
614  static QMap<uint,QString> categoryDesc;
615  static volatile bool categoryDescExists;
616 };
617 
618 // DVB Bluebook A038 (Sept 2011) p 49
620 {
621  public:
622  CountryAvailabilityDescriptor(const unsigned char *data, int len = 300) :
623  MPEGDescriptor(data, len, DescriptorID::country_availability) { }
624  // Name bits loc expected value
625  // descriptor_tag 8 0.0 0x49
626  // descriptor_length 8 1.0
627 
628  uint CountryCount(void) const { return ((DescriptorLength() - 1) / 3); }
629 
630  // country_avail_flag 1 2.0
631  bool IsAvailable(void) const { return (_data[2] & 0x1); }
632  // reserved_future_use 7 2.1
633  //
634  // for (i=0; i<N; i++)
635  // { country_code 24 }
636  QString CountryNames(void) const
637  {
638  QString countries="";
639  for (uint i=0; i<CountryCount(); i++)
640  {
641  if (i!=0) countries.append(" ");
642  countries.append(QString::fromLatin1(
643  (const char *)_data+(3*(i+1)), 3));
644  };
645  return countries;
646  }
647 
648  QString toString(void) const override // MPEGDescriptor
649  {
650  return QString("CountryAvailabilityDescriptor: Available(%1) in (%2)")
651  .arg(IsAvailable()).arg(CountryNames());
652  }
653 };
654 
655 // DVB Bluebook A038 (Sept 2011) p 50
657 {
658  public:
659  DataBroadcastDescriptor(const unsigned char *data, int len = 300) :
660  MPEGDescriptor(data, len, DescriptorID::data_broadcast) { }
661  // Name bits loc expected value
662  // descriptor_tag 8 0.0 0x64
663  // descriptor_length 8 1.0
664 
665  // data_broadcast_id 16 2.0
666  uint DataBroadcastId(void) const { return _data[2] << 8 | _data[3]; }
667  // component_tag 8 4.0
668  uint DataComponentTag(void) const { return _data[4]; }
669  // selector_length 8 5.0
670  uint SelectorLength(void) const { return _data[5]; }
671  // for (i=0; i<selector_length; i++)
672  // {
673  // selector_byte 8
674  const unsigned char *Selector(void) const { return &_data[6]; }
675  // }
676  // ISO_639_language_code 24
677  int LanguageKey(void) const
678  { return iso639_str3_to_key(&_data[6 + SelectorLength()]); }
679  QString LanguageString(void) const
680  { return iso639_key_to_str3(LanguageKey()); }
681  int CanonicalLanguageKey(void) const
683  QString CanonicalLanguageString(void) const
685  // text_length 8
686  uint TextLength(void) const { return _data[6 + SelectorLength() + 3]; }
687  // for (i=0; i<text_length; i++) { text_char 8 }
688  QString Text(void) const
689  {
690  return dvb_decode_text(&_data[6 + SelectorLength() + 4], TextLength());
691  }
692 
693  QString toString(void) const override; // MPEGDescriptor
694 };
695 
696 // DVB Bluebook A038 (Sept 2011) p 51
698 {
699  public:
700  DataBroadcastIdDescriptor(const unsigned char *data, int len = 300) :
701  MPEGDescriptor(data, len, DescriptorID::data_broadcast_id) { }
702  // Name bits loc expected value
703  // descriptor_tag 8 0.0 0x66
704  // descriptor_length 8 1.0
705 
706  // data_broadcast_id 16 2.0
707  uint DataBroadCastId(void) const { return _data[2] << 8 | _data[3]; }
708  // for(i=0; i < N;i++ )
709  // { id_selector_byte 8 }
710 };
711 
712 // DVB Bluebook A038 (Sept 2011) p 51
714 {
715  public:
716  CableDeliverySystemDescriptor(const unsigned char *data, int len = 300) :
717  MPEGDescriptor(data, len, DescriptorID::cable_delivery_system) { }
718  // Name bits loc expected value
719  // descriptor_tag 8 0.0 0x44
720  // descriptor_length 8 1.0
721 
722  // frequency 32 2.0
723  uint FrequencyRaw(void) const
724  {
725  return ((_data[2]<<24) | (_data[3]<<16) |
726  (_data[4]<<8) | (_data[5]));
727  }
728  unsigned long long FrequencyHz(void) const
729  {
730  return byte4BCD2int(_data[2], _data[3], _data[4], _data[5]) * 100;
731  }
732  // reserved_future_use 12 6.0
733  // FEC_outer 4 7.4
734  enum
735  {
738  };
739  uint FECOuter(void) const { return _data[7] & 0xf; }
740  QString FECOuterString(void) const
741  {
742  return (FECOuter() == kOuterFEC_None) ? "None" :
743  ((FECOuter() == kOuterFEC_RS204_RS188) ? "RS(204/188)" : "unknown");
744  }
745  // modulation 8 8.0
746  enum
747  {
753  };
754  uint Modulation(void) const { return _data[8]; }
755  QString ModulationString(void) const
756  {
757  static QString ms[] =
758  { "auto", "qam_16", "qam_32", "qam_64", "qam_128", "qam_256" };
759  return (Modulation() <= kModulationQAM256) ?
760  ms[Modulation()] : QString("auto");
761  }
762  // symbol_rate 28 9.0
763  uint SymbolRateRaw(void) const
764  {
765  return ((_data[9]<<20) | (_data[10]<<12) |
766  (_data[11]<<4) | (_data[12]>>4));
767  }
768  uint SymbolRateHz(void) const
769  {
770  return ((byte3BCD2int(_data[9], _data[10], _data[11]) * 1000) +
771  (byteBCDH2int(_data[12]) * 100));
772  }
773  // FEC_inner 4 12.4
774  enum
775  {
783  };
784  uint FECInner(void) const { return _data[12] & 0xf; }
785  QString FECInnerString(void) const { return coderate_inner(FECInner()); }
786  QString toString(void) const override; // MPEGDescriptor
787 };
788 
789 // DVB Bluebook A038 (Sept 2011) p 53
791 {
792  public:
794  const unsigned char *data, int len = 300) :
795  MPEGDescriptor(data, len, DescriptorID::satellite_delivery_system) { }
796  // Name bits loc expected value
797  // descriptor_tag 8 0.0 0x43
798  // descriptor_length 8 1.0
799 
801  uint FrequencyRaw(void) const
802  {
803  return ((_data[2]<<24) | (_data[3]<<16) |
804  (_data[4]<<8) | (_data[5]));
805  }
806  unsigned long long FrequencyHz(void) const
807  {
808  return byte4BCD2int(_data[2], _data[3], _data[4], _data[5]) * 10;
809  }
811  uint OrbitalPosition(void) const
812  { return byte2BCD2int(_data[6], _data[7]); }
813  QString OrbitalPositionString(void) const
814  {
815  uint num = OrbitalPosition();
816  return QString("%1.%2 %3").arg(num / 10).arg(num % 10)
817  .arg((IsEast()) ? "East" : "West");
818  }
819  double OrbitalPositionFloat() const
820  { return ((double) OrbitalPosition()) / 10.0; }
822  bool IsEast(void) const { return ( (_data[8]&0x80) ) != 0; }
823  bool IsWest(void) const { return !IsEast(); }
824  // polarization 2 8.1
825  uint Polarization(void) const { return (_data[8]>>5)&0x3; }
826  QString PolarizationString() const
827  {
828  static QString ps[] = { "h", "v", "l", "r" };
829  return ps[Polarization()];
830  }
831  bool IsCircularPolarization(void) const { return (_data[8]>>6)&0x1; }
832  bool IsLinearPolarization(void) const { return !((_data[8]>>6)&0x1); }
833  bool IsHorizontalLeftPolarization(void) const { return (_data[8]>>5)&0x1; }
835  { return !((_data[8]>>5)&0x1); }
836  // roll off 2 8.3
837  enum
838  {
843  };
844  uint RollOff(void) const { return (_data[8]>>3)&0x3; }
845  QString RollOffString(void) const
846  {
847  static QString ro[] = { "0.35", "0.20", "0.25", "auto" };
848  return ro[RollOff()];
849  }
850  // modulation system 1 8.5
851  uint ModulationSystem(void) const { return (_data[8]>>2)&0x1; }
852  QString ModulationSystemString(void) const
853  {
854  return ModulationSystem() ? "DVB-S2" : "DVB-S";
855  }
856  // modulation 2 8.6
857  enum
858  {
859  kModulationQPSK_NS = 0x0, // Non standard QPSK for Bell ExpressVu
860  // should be "auto" according to DVB SI standard
864  };
865  uint Modulation(void) const { return _data[8]&0x03; }
866  QString ModulationString(void) const
867  {
868  static QString ms[] = { "qpsk", "qpsk", "8psk", "qam_16" };
869  return ms[Modulation()];
870  }
871  // symbol_rate 28 9.0
872  uint SymbolRate(void) const
873  {
874  return ((_data[9]<<20) | (_data[10]<<12) |
875  (_data[11]<<4) | (_data[12]>>4));
876  }
877  uint SymbolRateHz(void) const
878  {
879  return ((byte3BCD2int(_data[9], _data[10], _data[11]) * 1000) +
880  (byteBCDH2int(_data[12]) * 100));
881  }
882  // FEC_inner 4 12.4
883  enum
884  {
892  };
893  uint FECInner(void) const { return _data[12] & 0xf; }
894  QString FECInnerString(void) const { return coderate_inner(FECInner()); }
895 
896  QString toString(void) const override; // MPEGDescriptor
897 };
898 
899 // DVB Bluebook A038 (Sept 2011) p 55
901 {
902  public:
904  const unsigned char *data, int len = 300) :
905  MPEGDescriptor(data, len, DescriptorID::terrestrial_delivery_system) { }
906  // Name bits loc expected value
907  // descriptor_tag 8 0.0 0x5a
908  // descriptor_length 8 1.0
909 
910  // centre_frequency 32 2.0
911  uint Frequency(void) const
912  {
913  return ((_data[2]<<24) | (_data[3]<<16) |
914  (_data[4]<<8) | (_data[5]));
915  }
916  uint64_t FrequencyHz(void) const { return uint64_t(Frequency()) * 10ULL; }
917 
918  // bandwidth 3 6.0
919  enum
920  {
925  };
926  uint Bandwidth(void) const { return _data[6]>>5; }
927  uint BandwidthHz(void) const { return (8 - Bandwidth()) * 1000000; }
928  QString BandwidthString(void) const
929  {
930  static QString bs[] = { "8", "7", "6", "5" };
931  return (Bandwidth() <= kBandwidth5Mhz) ? bs[Bandwidth()] : "auto";
932  }
933  // priority 1 6.3
934  bool HighPriority(void) const { return ( _data[6] & 0x10 ) != 0; }
935  // time_slicing_indicator 1 6.4
936  bool IsTimeSlicingIndicatorUsed(void) const { return !(_data[6] & 0x08); }
937  // MPE-FEC_indicator 1 6.5
938  bool IsMPE_FECUsed(void) const { return !(_data[6] & 0x04); }
939  // reserved_future_use 2 6.6
940  // constellation 2 7.0
941  enum
942  {
947  };
948  uint Constellation(void) const { return _data[7]>>6; }
949  QString ConstellationString(void) const
950  {
951  static QString cs[] = { "qpsk", "qam_16", "qam_64", "qam_256" };
952  return (Constellation() <= kConstellationQAM256) ?
953  cs[Constellation()] : "auto";
954  }
955  // hierarchy_information 3 7.2
956  enum
957  {
966  };
967  uint Hierarchy(void) const { return (_data[7]>>3) & 0x7; }
968 
970  QString HierarchyString(void) const
971  {
972  static QString hs[] = { "n", "1", "2", "4", "a", "a", "a", "a" };
973  return hs[Hierarchy()];
974  }
975  bool NativeInterleaver(void) const { return ( _data[7] & 0x20 ) != 0; }
976  uint Alpha(void) const
977  {
978  uint i = (_data[7]>>3) & 0x3;
979  return (0x2 == i) ? 4 : i;
980  }
981  // code_rate-HP_stream 3 7.5
982  enum
983  {
989  };
990  uint CodeRateHP(void) const { return _data[7] & 0x7; }
991  QString CodeRateHPString(void) const
992  {
993  static QString cr[] = {
994  "1/2", "2/3", "3/4", "5/6", "7/8", "auto", "auto", "auto"
995  };
996  return cr[CodeRateHP()];
997  }
998  // code_rate-LP_stream 3 8.0
999  uint CodeRateLP(void) const { return (_data[8]>>5) & 0x7; }
1000  QString CodeRateLPString(void) const
1001  {
1002  static QString cr[] = {
1003  "1/2", "2/3", "3/4", "5/6", "7/8", "auto", "auto", "auto"
1004  };
1005  return cr[CodeRateLP()];
1006  }
1007  // guard_interval 2 8.3
1008  enum
1009  {
1014  };
1015  uint GuardInterval(void) const { return (_data[8]>>3) & 0x3; }
1016  QString GuardIntervalString(void) const
1017  {
1018  static QString gi[] = { "1/32", "1/16", "1/8", "1/4" };
1019  return gi[GuardInterval()];
1020  }
1021  // transmission_mode 2 8.5
1022  enum
1023  {
1027  };
1028  uint TransmissionMode(void) const { return (_data[8]>>1) & 0x3; }
1029  QString TransmissionModeString(void) const
1030  {
1031  static QString tm[] = { "2", "8", "4", "auto" };
1032  return tm[TransmissionMode()];
1033  }
1034  // other_frequency_flag 1 8.7
1035  bool OtherFrequencyInUse(void) const { return _data[8] & 0x1; }
1036  // reserved_future_use 32 9.0
1037 
1038  QString toString(void) const override; // MPEGDescriptor
1039 };
1040 
1041 // DVB Bluebook A038 (Sept 2011) p 58
1043 {
1044  public:
1045  DSNGDescriptor(const unsigned char *data, int len = 300) :
1046  MPEGDescriptor(data, len, DescriptorID::dsng) { }
1047  // Name bits loc expected value
1048  // descriptor_tag 8 0.0 0x68
1049  // descriptor_length 8 1.0
1050  // for (i=0;i<N;i++) { byte 8 }
1051 };
1052 
1053 // DVB Bluebook A038 (Sept 2011) p 58
1055 {
1056  public:
1057  ExtendedEventDescriptor(const unsigned char *data, int len = 300) :
1058  MPEGDescriptor(data, len, DescriptorID::extended_event) { }
1059  // Name bits loc expected value
1060  // descriptor_tag 8 0.0 0x4e
1061  // descriptor_length 8 1.0
1062 
1063  // descriptor_number 4 2.0
1064  uint DescriptorNumber(void) const { return _data[2] >> 4; }
1065  // last_number 4 2.4
1066  uint LastNumber(void) const { return _data[2] & 0xf; }
1067  // ISO_639_language_code 24 3.0
1068  int LanguageKey(void) const
1069  { return iso639_str3_to_key(&_data[3]); }
1070  QString LanguageString(void) const
1071  { return iso639_key_to_str3(LanguageKey()); }
1072  int CanonicalLanguageKey(void) const
1074  QString CanonicalLanguageString(void) const
1076  // length_of_items 8 6.0
1077  uint LengthOfItems(void) const { return _data[6]; }
1078  // for ( i=0;i<N;i++)
1079  // {
1080  // item_description_len 8 0.0+p
1081  // for (j=0;j<N;j++) { item_desc_char 8 }
1082  // item_length 8 1.0+p2
1083  // for (j=0;j<N;j++) { item_char 8 }
1084  // }
1085  QMap<QString,QString> Items(void) const;
1086  // text_length 8
1087  uint TextLength(void) const { return _data[7 + LengthOfItems()]; }
1088  // for (i=0; i<N; i++) { text_char 8 }
1089  QString Text(void) const
1090  { return dvb_decode_text(&_data[8 + LengthOfItems()], TextLength()); }
1091 
1092  // HACK beg -- Pro7Sat is missing encoding
1093  QString Text(const unsigned char *encoding_override,
1094  uint encoding_length) const
1095  {
1096  return dvb_decode_text(&_data[8 + LengthOfItems()], TextLength(),
1097  encoding_override, encoding_length);
1098  }
1099  // HACK end -- Pro7Sat is missing encoding
1100 };
1101 
1102 // DVB Bluebook A038 (Sept 2011) p 60
1104 {
1105  public:
1106  FrequencyListDescriptor(const unsigned char *data, int len = 300) :
1107  MPEGDescriptor(data, len, DescriptorID::frequency_list) { }
1108  // Name bits loc expected value
1109  // descriptor_tag 8 0.0 0x62
1110  // descriptor_length 8 1.0
1111 
1112  // reserved_future_use 6 2.0
1113  // coding_type 2 2.6
1114  enum
1115  {
1120  };
1121  uint CodingType(void) const { return _data[2] & 0x3; }
1122  // for (i=0;I<N;i++)
1123  // {
1124  // centre_frequency 32
1125  // }
1126  uint FrequencyCount() const { return DescriptorLength()>>2; }
1127  unsigned long long Frequency(uint i) const
1128  {
1130  return (((unsigned long long)_data[i*4+3]<<24) |
1131  (_data[i*4+4]<<16) |
1132  (_data[i*4+5]<<8) |
1133  (_data[i*4+6]));
1134  else
1135  return byte4BCD2int(_data[i*4+3], _data[i*4+4],
1136  _data[i*4+5], _data[i*4+6]);
1137  }
1138  unsigned long long FrequencyHz(uint i) const
1139  {
1140  return Frequency(i) *
1141  ((kCodingTypeTerrestrial == CodingType()) ? 10 : 100);
1142  }
1143 
1144  QString toString(void) const override; // MPEGDescriptor
1145 };
1146 
1147 // DVB Bluebook A038 (Sept 2011) p 70
1148 // ETSI EN 300 468 p 58
1150 {
1151  public:
1152  LocalTimeOffsetDescriptor(const unsigned char *data, int len = 300) :
1153  MPEGDescriptor(data, len, DescriptorID::local_time_offset) { }
1154  // Name bits loc expected value
1155  // descriptor_tag 8 0.0 0x58
1156  // descriptor_length 8 1.0
1157  uint Count(void) const { return DescriptorLength() / 13; }
1158  // for(i=0;i<N;i++)
1159  // {
1160  // country_code 24 0.0+p
1162  {
1163  int o = 2 + i*13;
1164  return ((_data[o] << 16) | (_data[o+1] << 8) | _data[o+2]);
1165  }
1166  QString CountryCodeString(uint i) const
1167  {
1168  int o = 2 + i*13;
1169  return QString(_data[o]) + QChar(_data[o+1]) + QChar(_data[o+2]);
1170  }
1171  // country_region_id 6 3.0+p
1172  uint CountryRegionId(uint i) const { return _data[2 + i*13 + 3] >> 2; }
1173  // reserved 1 3.6+p
1174  // local_time_off_polarity 1 3.7+p
1177  { return _data[2 + i*13 + 3] & 0x01; }
1178  // local_time_offset 16 4.0+p
1180  { return (_data[2 + i*13 + 4] << 8) | _data[2 + i*13 + 5]; }
1182  { return (LocalTimeOffsetPolarity(i) ? -1 : +1) * LocalTimeOffset(i); }
1183  // time_of_change 40 6.0+p
1184  // TODO decode this
1185  // next_time_offset 16 11.0+p
1187  { return (_data[2 + i*13 + 11]<<8) | _data[2 + i*13 + 12]; }
1188  // } 13.0
1189  QString toString(void) const override; // MPEGDescriptor
1190 };
1191 
1192 // DVB Bluebook A038 (Sept 2011) p 71
1194 {
1195  public:
1196  MosaicDescriptor(const unsigned char *data, int len = 300) :
1197  MPEGDescriptor(data, len, DescriptorID::mosaic) { }
1198  // Name bits loc expected value
1199  // descriptor_tag 8 0.0 0x51
1200  // descriptor_length 8 1.0
1201 
1202  // mosaic_entry_point 1 2.0
1203  // num_horiz_elem_cells 3 2.1
1204  // reserved_future_use 1 2.4
1205  // num_vert_elem_cells 3 2.5
1206  // for (i=0;i<N; i++)
1207  // {
1208  // logical_cell_id 6 0.0+p
1209  // reserved_future_use 7 0.6+p
1210  // logical_cell_pres_info 3 1.5+p
1211  // elem_cell_field_len 8 2.0+p
1212  // for (i=0; j<elementary_cell_field_length; j++)
1213  // {
1214  // reserved_future_use 2
1215  // elementary_cell_id 6
1216  // }
1217  // cell_linkage_info 8
1218  // if (cell_linkage_info == 0x01)
1219  // {
1220  // bouquet_id 16
1221  // }
1222  // if (cell_linkage_info == 0x02)
1223  // {
1224  // original_network_id 16
1225  // transport_stream_id 16
1226  // service_id 16
1227  // }
1228  // if (cell_linkage_info == 0x03)
1229  // {
1230  // original_network_id 16
1231  // transport_stream_id 16
1232  // service_id 16
1233  // }
1234  // if (cell_linkage_info == 0x04)
1235  // {
1236  // original_network_id 16
1237  // transport_stream_id 16
1238  // service_id 16
1239  // event_id 16
1240  // }
1241  // }
1242 };
1243 
1244 // DVB Bluebook A038 (Sept 2011) p 74
1246 {
1247  public:
1249  const unsigned char *data, int len = 300) :
1250  MPEGDescriptor(data, len, DescriptorID::multilingual_bouquet_name) { }
1251  // Name bits loc expected value
1252  // descriptor_tag 8 0.0 0x5c
1253  // descriptor_length 8 1.0
1254 
1255  // for (i=0;i<N;i++)
1256  // {
1257  // ISO_639_language_code 24
1258  // bouquet_name_length 8
1259  // for (j=0;j<N;j++) { char 8 }
1260  // }
1261 };
1262 
1263 // DVB Bluebook A038 (Sept 2011) p 75
1265 {
1266  public:
1268  const unsigned char *data, int len = 300) :
1269  MPEGDescriptor(data, len, DescriptorID::multilingual_network_name)
1270  {
1271  // Name bits loc expected value
1272  // descriptor_tag 8 0.0 0x5b
1273  // descriptor_length 8 1.0
1274  }
1275 
1276  // for (i=0;i<N;i++)
1277  // {
1278  // ISO_639_language_code 24
1279  // network_name_length 8
1280  // for (j=0;j<N;j++) { char 8 }
1281  // }
1282 };
1283 
1284 // DVB Bluebook A038 (Sept 2011) p 76
1286 {
1287  public:
1289  const unsigned char *data, int len = 300) :
1290  MPEGDescriptor(data, len, DescriptorID::multilingual_service_name) { }
1291  // Name bits loc expected value
1292  // descriptor_tag 8 0.0 0x5d
1293  // descriptor_length 8 1.0
1294 
1295  // for (i=0;i<N;i++)
1296  // {
1297  // ISO_639_language_code 24
1298  // service_provider_name_length 8
1299  // for (j=0;j<N;j++) { char 8 }
1300  // service_name_length 8
1301  // for (j=0;j<N;j++) { char 8 }
1302  // }
1303 };
1304 
1305 // DVB Bluebook A038 (Sept 2011) p 76
1307 {
1308  public:
1309  NVODReferenceDescriptor(const unsigned char *data, int len = 300) :
1310  MPEGDescriptor(data, len, DescriptorID::nvod_reference) { }
1311  // Name bits loc expected value
1312  // descriptor_tag 8 0.0 0x4b
1313  // descriptor_length 8 1.0
1314  uint Count(void) const { return DescriptorLength() / 6; }
1315 
1316  // for (i=0;i<N;i++)
1317  // {
1318  // transport_stream_id 16
1320  { return (_data[i * 6 + 2] << 8) | _data[i * 6 + 3]; }
1321  // original_network_id 16
1323  { return (_data[i * 6 + 4] << 8) | _data[i * 6 + 5]; }
1324  // service_id 16
1326  { return (_data[i * 6 + 6] << 8) | _data[i * 6 + 7]; }
1327  // }
1328  QString toString(void) const override; // MPEGDescriptor
1329 };
1330 
1331 // DVB Bluebook A038 (Sept 2011) p 78
1332 // ETSI EN 300 468
1334 {
1335  public:
1336  ParentalRatingDescriptor(const unsigned char *data, int len = 300) :
1337  MPEGDescriptor(data, len, DescriptorID::parental_rating) { }
1338  // Name bits loc expected value
1339  // descriptor_tag 8 0.0 0x55
1340  // descriptor_length 8 1.0
1341  uint Count(void) const { return DescriptorLength() / 4; }
1342 
1343  // for (i=0; i<N; i++)
1344  // {
1345  // country_code 24
1346  // rating 8
1347  // }
1348  QString CountryCodeString(uint i) const
1349  {
1350  int o = 2 + i*4;
1351  if (i < Count())
1352  {
1353  return QString(_data[o]) + QChar(_data[o+1]) + QChar(_data[o+2]);
1354  }
1355  else
1356  {
1357  return QString("");
1358  }
1359  }
1360  int Rating(uint i) const
1361  {
1362  if (i >= Count())
1363  {
1364  return -1;
1365  }
1366 
1367  unsigned char rawRating = _data[2 + 3 + i*4];
1368  if (rawRating == 0)
1369  {
1370  // 0x00 - undefined
1371  return -1;
1372  }
1373  else if ((rawRating >= 0x01) && (rawRating <= 0x0F))
1374  {
1375  // 0x01 to 0x0F - minumum age = rating + 3 years
1376  return rawRating + 3;
1377  }
1378  else
1379  {
1380  // 0x10 to 0xFF - defined by the broadcaster
1381  return -1;
1382  }
1383  }
1384 };
1385 
1386 // DVB Bluebook A038 (Sept 2011) p 78 (see also ETSI EN 300 231 PDC)
1388 {
1389  public:
1390  PDCDescriptor(const unsigned char *data, int len = 300) :
1391  MPEGDescriptor(data, len, DescriptorID::pdc, 3) { }
1392  // Name bits loc expected value
1393  // descriptor_tag 8 0.0 0x69
1394  // descriptor_length 8 1.0
1395 
1396  // reserved_future_use 4 2.0
1397  // program_id_label 20 2.4
1398  uint ProgramIdLabel(void) const
1399  { return (_data[2] & 0x0F) << 16 | _data[3] << 8 | _data[4]; }
1400  QString toString(void) const override // MPEGDescriptor
1401  {
1402  return QString("PDCDescriptor program_id_label(%1)")
1403  .arg(ProgramIdLabel());
1404  }
1405 };
1406 
1407 // DVB Bluebook A038 (Sept 2011) p 79 (see also ETSI TS 101 162)
1409 {
1410  public:
1411  PrivateDataSpecifierDescriptor(const unsigned char *data, int len = 300) :
1412  MPEGDescriptor(data, len, DescriptorID::private_data_specifier) { }
1413  // Name bits loc expected value
1414  // descriptor_tag 8 0.0 0x5f
1415  // descriptor_length 8 1.0
1416 
1417  // private_data_specifier 32 2.0
1418  uint32_t PrivateDataSpecifier (void) const
1419  {
1420  return (_data[2] << 24 | _data[3] << 16 | _data[4] << 8 | _data[5]);
1421  }
1422 };
1423 
1424 // DVB Bluebook A038 (Sept 2011) p 79
1426 {
1427  public:
1428  ScramblingDescriptor(const unsigned char *data, int len = 300) :
1429  MPEGDescriptor(data, len, DescriptorID::scrambling, 1) { }
1430  // Name bits loc expected value
1431  // descriptor_tag 8 0.0 0x65
1432  // descriptor_length 8 1.0
1433 
1434  // scrambling_mode 8 2.0
1435  uint ScramblingMode(void) const { return _data[2]; }
1436  QString toString(void) const override // MPEGDescriptor
1437  {
1438  return QString("ScramblingDescriptor scrambling_mode(%1)")
1439  .arg(ScramblingMode());
1440  }
1441 };
1442 
1443 // DVB Bluebook A038 (Feb 2019) p 83, Table 89: Service type coding
1444 // Map serviceid's to their types
1446 {
1447  public:
1448  explicit ServiceDescriptorMapping(const uint serviceid) { m_serviceid = serviceid; }
1449  enum
1450  {
1459  // reserved for future use = 0x09,
1468  // reserved for future use = 0x12 to 0x15
1480  // reserved for future use = 0x21 to 0x7F
1481  // user defined = 0x80 to 0xFE
1482  // reserved for future use = 0xFF
1483  // User Defined descriptors for Dish network
1497 
1498  };
1499  uint ServiceType(void) const { return m_serviceid; }
1500  bool IsDTV(void) const
1501  {
1502  return ((ServiceType() == kServiceTypeDigitalTelevision) ||
1504  IsHDTV() ||
1505  IsUHDTV() ||
1519  }
1520  bool IsDigitalAudio(void) const
1521  {
1522  return
1525  }
1526  bool IsHDTV(void) const
1527  {
1528  return
1532  }
1533  bool IsUHDTV(void) const
1534  {
1535  return
1538  }
1539  bool IsTeletext(void) const
1540  {
1542  }
1543  QString toString(void) const;
1544 
1545  private:
1547 };
1548 
1549 // DVB Bluebook A038 (Sept 2011) p 80
1551 {
1552  public:
1553  ServiceDescriptor(const unsigned char *data, int len = 300) :
1554  MPEGDescriptor(data, len, DescriptorID::service) { }
1555  // Name bits loc expected value
1556  // descriptor_tag 8 0.0 0x48
1557  // descriptor_length 8 1.0
1558 
1559  // service_type 8 2.0
1560  uint ServiceType(void) const { return _data[2]; }
1561  // svc_provider_name_len 8 3.0
1562  uint ServiceProviderNameLength(void) const { return _data[3]; }
1563  // for (i=0;i<N;I++) { char 8 }
1564  QString ServiceProviderName(void) const
1565  { return dvb_decode_text(_data + 4, ServiceProviderNameLength()); }
1566  QString ServiceProviderShortName(void) const
1567  {
1569  }
1570  // service_name_length 8
1572  { return _data[4 + ServiceProviderNameLength()]; }
1573  // for (i=0;i<N;I++) { char 8 }
1574  QString ServiceName(void) const
1575  {
1577  ServiceNameLength());
1578  }
1579  QString ServiceShortName(void) const
1580  {
1582  ServiceNameLength());
1583  }
1584  bool IsDTV(void) const
1585  { return ServiceDescriptorMapping(ServiceType()).IsDTV(); }
1586  bool IsDigitalAudio(void) const
1588  bool IsHDTV(void) const
1590  bool IsTeletext(void) const
1592 
1593  QString toString(void) const override // MPEGDescriptor
1594  {
1595  return QString("ServiceDescriptor: %1 %2(0x%3)")
1596  .arg(ServiceName())
1598  .arg(ServiceType(),2,16,QChar('0'));
1599  }
1600 };
1601 
1602 // DVB Bluebook A038 (Sept 2011) p 82
1604 {
1605  public:
1606  ServiceAvailabilityDescriptor(const unsigned char *data, int len = 300) :
1607  MPEGDescriptor(data, len, DescriptorID::service_availability) { }
1608  // Name bits loc expected value
1609  // descriptor_tag 8 0.0 0x72
1610  // descriptor_length 8 1.0
1611 
1612  // availability_flag 1 2.0
1613  // reserved 7 2.1
1614  // for (i=0;i<N;i++) { cell_id 16 }
1615 };
1616 
1617 // DVB Bluebook A038 (Sept 2011) p 82
1619 {
1620  public:
1621  ServiceListDescriptor(const unsigned char *data, int len = 300) :
1622  MPEGDescriptor(data, len, DescriptorID::service_list) { }
1623  // Name bits loc expected value
1624  // descriptor_tag 8 0.0 0x41
1625  // descriptor_length 8 1.0
1626 
1627  // for (i=0;i<N;I++)
1628  // {
1629  // service_id 16 0.0+p
1630  // service_type 8 2.0+p
1631  // }
1632  uint ServiceCount(void) const { return DescriptorLength() / 3; }
1633 
1635  { return (_data[2+i*3] << 8) | _data[3+i*3]; }
1636 
1637  uint ServiceType(uint i) const { return _data[4+i*3]; }
1638 
1639  QString toString(void) const override // MPEGDescriptor
1640  {
1641  QString str = QString("ServiceListDescriptor: %1 Services\n")
1642  .arg(ServiceCount());
1643  for (uint i=0; i<ServiceCount(); i++)
1644  {
1645  if (i!=0) str.append("\n");
1646  str.append(QString(" Service (%1) Type%2").arg(ServiceID(i))
1648  }
1649  return str;
1650  }
1651 };
1652 
1653 // DVB Bluebook A038 (Sept 2011) p 82
1655 {
1656  public:
1657  ServiceMoveDescriptor(const unsigned char *data, int len = 300) :
1658  MPEGDescriptor(data, len, DescriptorID::service_move) { }
1659  // Name bits loc expected value
1660  // descriptor_tag 8 0.0 0x60
1661  // descriptor_length 8 1.0
1662 
1663  // new_original_network_id 16 2.0
1664  // new_transport_stream_id 16 4.0
1665  // new_service_id 16 6.0
1666 };
1667 
1668 // DVB Bluebook A038 (Sept 2011) p 83
1670 {
1671  public:
1672  ShortEventDescriptor(const unsigned char *data, int len = 300) :
1673  MPEGDescriptor(data, len, DescriptorID::short_event) { }
1674  // Name bits loc expected value
1675  // descriptor_tag 8 0.0 0x4d
1676  // descriptor_length 8 1.0
1677 
1678  // ISO_639_language_code 24 2.0
1679  int LanguageKey(void) const
1680  { return iso639_str3_to_key(&_data[2]); }
1681  QString LanguageString(void) const
1682  { return iso639_key_to_str3(LanguageKey()); }
1683  int CanonicalLanguageKey(void) const
1685  QString CanonicalLanguageString(void) const
1687  // event_name_length 8 5.0
1688  uint EventNameLength(void) const { return _data[5]; }
1689  // for (i=0;i<event_name_length;i++) { event_name_char 8 }
1690  QString EventName(void) const
1691  { return dvb_decode_text(&_data[6], _data[5]); }
1692  QString EventShortName(void) const
1693  { return dvb_decode_short_name(&_data[6], _data[5]); }
1694  // text_length 8
1695  uint TextLength(void) const { return _data[6 + _data[5]]; }
1696  // for (i=0;i<text_length;i++) { text_char 8 }
1697  QString Text(void) const
1698  { return dvb_decode_text(&_data[7 + _data[5]], TextLength()); }
1699 
1700  // HACK beg -- Pro7Sat is missing encoding
1701  QString EventName(const unsigned char *encoding_override,
1702  uint encoding_length) const
1703  {
1704  return dvb_decode_text(&_data[6], _data[5],
1705  encoding_override, encoding_length);
1706  }
1707 
1708  QString Text(const unsigned char *encoding_override,
1709  uint encoding_length) const
1710  {
1711  return dvb_decode_text(&_data[7 + _data[5]], TextLength(),
1712  encoding_override, encoding_length);
1713  }
1714  // HACK end -- Pro7Sat is missing encoding
1715 
1716  QString toString(void) const override // MPEGDescriptor
1717  { return LanguageString() + " : " + EventName() + " : " + Text(); }
1718 };
1719 
1720 // DVB Bluebook A038 (Sept 2011) p 84
1722 {
1723  public:
1724  ShortSmoothingBufferDescriptor(const unsigned char *data, int len = 300) :
1725  MPEGDescriptor(data, len, DescriptorID::short_smoothing_buffer) { }
1726  // Name bits loc expected value
1727  // descriptor_tag 8 0.0 0x61
1728  // descriptor_length 8 1.0
1729 
1730  // sb_size 2 2.0
1731  // sb_leak_rate 6 2.2
1732  // for (i=0; i<N; i++)
1733  // { DVB_reserved 8 }
1734 };
1735 
1736 // DVB Bluebook A038 (Sept 2011) p 85
1740 {
1741  public:
1742  StreamIdentifierDescriptor(const unsigned char *data, int len = 300) :
1743  MPEGDescriptor(data, len, DescriptorID::stream_identifier, 1) { }
1744  // Name bits loc expected value
1745  // descriptor_tag 8 0.0 0x52
1746  // descriptor_length 8 1.0 0x01
1747 
1748  // component_tag 8 2.0
1749  uint ComponentTag(void) const { return _data[2]; }
1750  QString toString(void) const override // MPEGDescriptor
1751  {
1752  return QString("Stream Identifier Descriptor (0x52): ComponentTag=0x%1")
1753  .arg(ComponentTag(),1,16);
1754  }
1755 };
1756 
1757 // DVB Bluebook A038 (Sept 2011) p 86
1759 {
1760  public:
1761  StuffingDescriptor(const unsigned char *data, int len = 300) :
1762  MPEGDescriptor(data, len, DescriptorID::dvb_stuffing) { }
1763  // Name bits loc expected value
1764  // descriptor_tag 8 0.0 0x42
1765  // descriptor_length 8 1.0
1766  // stuffing_byte * 2.0
1767  QString toString(void) const override // MPEGDescriptor
1768  {
1769  return QString("Stuffing Descriptor (0x42) length(%1)")
1770  .arg(DescriptorLength());
1771  }
1772 };
1773 
1774 // DVB Bluebook A038 (Sept 2011) p 86
1776 {
1777  public:
1778  SubtitlingDescriptor(const unsigned char *data, int len = 300) :
1779  MPEGDescriptor(data, len, DescriptorID::subtitling) { }
1780  // Name bits loc expected value
1781  // descriptor_tag 8 0.0 0x59
1782  // descriptor_length 8 1.0
1783 
1784  uint StreamCount(void) const { return DescriptorLength() >> 3; }
1785  // for (i= 0;i<N;I++)
1786  // {
1787  // ISO_639_language_code 24 0.0+(i*8)
1788  int LanguageKey(uint i) const
1789  { return iso639_str3_to_key(&_data[2 + (i<<3)]); }
1790  QString LanguageString(uint i) const
1791  { return iso639_key_to_str3(LanguageKey(i)); }
1796 
1797  // subtitling_type 8 3.0+(i*8)
1799  { return _data[5 + (i<<3)]; }
1800  // composition_page_id 16 4.0+(i*8)
1802  { return (_data[6 + (i<<3)] << 8) | _data[7 + (i<<3)]; }
1803  // ancillary_page_id 16 6.0+(i*8)
1805  { return (_data[8 + (i<<3)] << 8) | _data[9 + (i<<3)]; }
1806  // } 8.0
1807 };
1808 
1809 // DVB Bluebook A038 (Sept 2011) p 87
1811 {
1812  public:
1813  TelephoneDescriptor(const unsigned char *data, int len = 300) :
1814  MPEGDescriptor(data, len, DescriptorID::telephone) { }
1815  // Name bits loc expected value
1816  // descriptor_tag 8 0.0 0x57
1817  // descriptor_length 8 1.0
1818 
1819  // reserved_future_use 2 2.0
1820  // foreign_availability 1 2.2
1821  // connection_type 5 2.3
1822  // reserved_future_use 1 3.0
1823  // country_prefix_length 2 3.1
1824  // i18n_area_code_len 3 3.4
1825  // operator_code_length 2 3.6
1826  // reserved_future_use 1 3.7
1827  // national_area_code_len 3 4.0
1828  // core_number_length 4 4.4
1829  //
1830  // for (i=0; i<N; i++)
1831  // { country_prefix_char 8 }
1832  // for (i=0; i<N; i++)
1833  // { international_area_code_char 8 }
1834  // for (i=0; i<N; i++)
1835  // { operator_code_char 8 }
1836  // for (i=0; i<N; i++)
1837  // { national_area_code_char 8 }
1838  // for (i=0; i<N; i++)
1839  // { core_number_char 8 }
1840 };
1841 
1842 // DVB Bluebook A038 (Sept 2011) p 88
1844 {
1845  public:
1846  TeletextDescriptor(const unsigned char *data, int len = 300) :
1847  MPEGDescriptor(data, len, DescriptorID::teletext) { }
1848  // Name bits loc expected value
1849  // descriptor_tag 8 0.0 0x56
1850  // descriptor_length 8 1.0
1851 
1852  uint StreamCount(void) const { return DescriptorLength() / 5; }
1853 
1854  // for (i=0; i<N; i++)
1855  // {
1856  // ISO_639_language_code 24 0.0
1857  int LanguageKey(uint i) const
1858  { return iso639_str3_to_key(&_data[2 + (i*5)]); }
1859  QString LanguageString(uint i) const
1860  { return iso639_key_to_str3(LanguageKey(i)); }
1865  // teletext_type 5 3.0
1867  { return _data[5 + (i*5)] >> 3; }
1868  // teletext_magazine_num 3 3.5
1870  { return _data[5 + (i*5)] & 0x7; }
1871  // teletext_page_num 8 4.0
1873  { return _data[6 + (i*5)]; }
1874  // } 5.0
1875  QString toString(void) const override; // MPEGDescriptor
1876 };
1877 
1878 // DVB Bluebook A038 (Sept 2011) p 89
1880 {
1881  public:
1882  TimeShiftedEventDescriptor(const unsigned char *data, int len = 300) :
1883  MPEGDescriptor(data, len, DescriptorID::time_shifted_event) { }
1884  // Name bits loc expected value
1885  // descriptor_tag 8 0.0 0x4f
1886  // descriptor_length 8 1.0
1887 
1888  // reference_service_id 16 2.0
1889  // reference_event_id 16 4.0
1890 };
1891 
1892 // DVB Bluebook A038 (Sept 2011) p 90
1894 {
1895  public:
1896  TimeShiftedServiceDescriptor(const unsigned char *data, int len = 300) :
1897  MPEGDescriptor(data, len, DescriptorID::dvb_time_shifted_service) { }
1898  // Name bits loc expected value
1899  // descriptor_tag 8 0.0 0x4c
1900  // descriptor_length 8 1.0
1901 
1902  // reference_service_id 16 2.0
1903 };
1904 
1905 // DVB Bluebook A038 (Sept 2011) p 90
1907 {
1908  public:
1909  TransportStreamDescriptor(const unsigned char *data, int len = 300) :
1910  MPEGDescriptor(data, len, DescriptorID::transport_stream) { }
1911  // Name bits loc expected value
1912  // descriptor_tag 8 0.0 0x67
1913  // descriptor_length 8 1.0
1914 
1915  // for (i=0; i<N; i++) { byte 8 }
1916  QString Data(void) const
1917  { return dvb_decode_text(&_data[2], DescriptorLength()); }
1918  QString toString(void) const override // MPEGDescriptor
1919  { return QString("TransportStreamDescriptor data(%1)").arg(Data()); }
1920 };
1921 
1922 // DVB Bluebook A038 (Sept 2011) p 91
1924 {
1925  public:
1926  VBIDataDescriptor(const unsigned char *data, int len = 300) :
1927  MPEGDescriptor(data, len, DescriptorID::vbi_data) { }
1928  // Name bits loc expected value
1929  // descriptor_tag 8 0.0 0x45
1930  // descriptor_length 8 1.0
1931 
1932  // for (i=0; i<N; i++)
1933  // {
1934  // data_service_id 8 0.0+p
1935  // data_service_length 8 1.0+p
1936  // if ((data_service_id&0x7) && data_service_id!=0x3))
1937  // {
1938  // for (i=0; i<N; i++)
1939  // {
1940  // reserved 2 2.0+p2
1941  // field_parity 1 2.2+p2
1942  // line_offset 5 2.3+p2
1943  // }
1944  // }
1945  // else
1946  // {
1947  // for (i=0; i<N; i++) { reserved 8 }
1948  // }
1949  // }
1950 };
1951 
1952 // DVB Bluebook A038 (Sept 2011) p 92
1954 {
1955  public:
1956  VBITeletextDescriptor(const unsigned char *data, int len = 300) :
1957  MPEGDescriptor(data, len, DescriptorID::vbi_teletext) { }
1958  // Name bits loc expected value
1959  // descriptor_tag 8 0.0 0x46
1960  // descriptor_length 8 1.0
1961 
1962  // for (i=0;i<N;i++)
1963  // {
1964  // ISO_639_language_code 24 0.0+p
1965  // teletext_type 5 3.0+p
1966  // teletext_magazine_num 3 3.5+p
1967  // teletext_page_num 8 4.0+p
1968  // } 5.0
1969 };
1970 
1971 // DVB Bluebook A038 (Sept 2011) p 119
1973 {
1974  public:
1975  PartialTransportStreamDescriptor(const unsigned char *data, int len = 300) :
1976  MPEGDescriptor(data, len, DescriptorID::partial_transport_stream) { }
1977  // Name bits loc expected value
1978  // descriptor_tag 8 0.0 0x63
1979  // descriptor_length 8 1.0
1980 
1981  // DVB_reserved_future_use 2 2.0
1982  // peak_rate 22 2.2
1983  uint PeakRate(void) const
1984  { return (_data[2] & 0x3f) << 16 | _data[3] | _data[4]; }
1985  // DVB_reserved_future_use 2 5.0
1986  // min_overall_smooth_rate 22 5.2
1987  uint SmoothRate(void) const
1988  { return (_data[5] & 0x3f) << 16 | _data[6] | _data[7]; }
1989  // DVB_reserved_future_use 2 8.0
1990  // max_overall_smooth_buf 14 8.2
1991  uint SmoothBuf(void) const { return ((_data[8] & 0x3f) << 8) | _data[9]; }
1992  QString toString(void) const override; // MPEGDescriptor
1993 };
1994 
1995 
1996 // a_52a.pdf p125 Table A7 (for DVB)
1998 {
1999  public:
2000  AC3Descriptor(const unsigned char *data, int len = 300) :
2001  MPEGDescriptor(data, len, DescriptorID::ac3) { }
2002  // Name bits loc expected value
2003  // descriptor_tag 8 0.0 0x6A
2004  // descriptor_length 8 1.0
2005 
2006  // component_type_flag 1 2.0
2007  bool HasComponentType(void) const { return ( _data[2] & 0x80 ) != 0; }
2008  // bsid_flag 1 2.1
2009  bool HasBSID(void) const { return ( _data[2] & 0x40 ) != 0; }
2010  // mainid_flag 1 2.2
2011  bool HasMainID(void) const { return ( _data[2] & 0x20 ) != 0; }
2012  // asvc_flag 1 2.3
2013  bool HasASVC(void) const { return ( _data[2] & 0x10 ) != 0; }
2014  // reserved_flags 4 2.4
2015  // if (component_type_flag == 1)
2016  // { component_type 8 uimsbf }
2017  uint ComponentType(void) const { return _data[3]; }
2018  // if (bsid_flag == 1)
2019  // { bsid 8 uimsbf }
2020  uint BSID(void) const
2021  { return (HasComponentType()) ? _data[4] : _data[3]; }
2022  // if (mainid_flag == 1)
2023  // { mainid 8 uimsbf }
2024  uint MainID(void) const
2025  {
2026  int offset = 3;
2027  offset += (HasComponentType()) ? 1 : 0;
2028  offset += (HasBSID()) ? 1 : 0;
2029  return _data[offset];
2030  }
2031  // if (asvc_flag==1)
2032  // { asvc 8 uimsbf }
2033  uint ASVC(void) const
2034  {
2035  int offset = 3;
2036  offset += (HasComponentType()) ? 1 : 0;
2037  offset += (HasBSID()) ? 1 : 0;
2038  offset += (HasMainID()) ? 1 : 0;
2039  return _data[offset];
2040  }
2041  // for (I=0;I<N;I++)
2042  // { additional_info[i] N*8 uimsbf }
2043  //};
2044  QString toString(void) const override; // MPEGDescriptor
2045 };
2046 
2047 static QString coderate_inner(uint cr)
2048 {
2049  switch (cr)
2050  {
2051  case 0x0: return "auto"; // not actually defined in spec
2052  case 0x1: return "1/2";
2053  case 0x2: return "2/3";
2054  case 0x3: return "3/4";
2055  case 0x4: return "5/6";
2056  case 0x5: return "7/8";
2057  case 0x8: return "8/9";
2058  case 0xf: return "none";
2059  default: return "auto"; // not actually defined in spec
2060  }
2061 }
2062 
2072 {
2073  public:
2074  DVBLogicalChannelDescriptor(const unsigned char *data, int len = 300) :
2075  MPEGDescriptor(data, len, PrivateDescriptorID::dvb_logical_channel_descriptor) { }
2076  // Name bits loc expected value
2077  // descriptor_tag 8 0.0 0x83
2078  // descriptor_length 8 1.0
2079 
2080  uint ChannelCount(void) const { return DescriptorLength() >> 2; }
2081 
2083  { return (_data[2 + (i<<2)] << 8) | _data[3 + (i<<2)]; }
2084 
2086  { return ((_data[4 + (i<<2)] << 8) | _data[5 + (i<<2)]) & 0x3ff; }
2087 
2088  QString toString(void) const override; // MPEGDescriptor
2089 };
2090 
2100 {
2101  public:
2102  DVBSimulcastChannelDescriptor(const unsigned char *data, int len = 300) :
2103  MPEGDescriptor(data, len, PrivateDescriptorID::dvb_simulcast_channel_descriptor) { }
2104  // Name bits loc expected value
2105  // descriptor_tag 8 0.0 0x88
2106  // descriptor_length 8 1.0
2107 
2108  uint ChannelCount(void) const { return DescriptorLength() >> 2; }
2109 
2111  { return (_data[2 + (i<<2)] << 8) | _data[3 + (i<<2)]; }
2112 
2114  { return ((_data[4 + (i<<2)] << 8) | _data[5 + (i<<2)]) & 0x3ff; }
2115 
2116  QString toString(void) const override; // MPEGDescriptor
2117 };
2118 
2119 // ETSI TS 102 323 (TV Anytime)
2121 {
2122  public:
2123  DVBContentIdentifierDescriptor(const unsigned char *data, int len = 300) :
2124  MPEGDescriptor(data, len, DescriptorID::dvb_content_identifier)
2125  {
2126  size_t count = 0;
2127 
2128  memset ((void *) m_crid, 0, sizeof(m_crid));
2129 
2130  if (IsValid())
2131  {
2132  uint8_t position = 2;
2133  while (_data[1] >= position)
2134  {
2135  size_t length = _data[position+1];
2136  m_crid[count] = &_data[position];
2137  count++;
2138  position+=length+2;
2139  }
2140  }
2141  m_cridCount = count;
2142  }
2143  // Name bits loc expected value
2144  // descriptor_tag 8 0.0 0x76
2145  // descriptor_length 8 1.0
2146 
2147  uint ContentType(size_t n=0) const { return m_crid[n][0] >> 2; }
2148 
2149  uint ContentEncoding(size_t n=0) const { return m_crid[n][0] & 0x03; }
2150 
2151  // A content identifier is a URI. It may contain UTF-8 encoded using %XX.
2152  QString ContentId(size_t n=0) const
2153  {
2154  int length = m_crid[n][1];
2155  int positionOfHash = length-1;
2156  while (positionOfHash >= 0) {
2157  if (m_crid[n][2 + positionOfHash] == '#') {
2158  length = positionOfHash; /* remove the hash and the following IMI */
2159  break;
2160  }
2161  positionOfHash--;
2162  }
2163  return QString::fromLatin1((const char *)&m_crid[n][2], length);
2164  }
2165 
2166  size_t CRIDCount() const
2167  {
2168  return m_cridCount;
2169  }
2170 
2171  private:
2172  size_t m_cridCount;
2173  const uint8_t *m_crid[8];
2174 };
2175 
2176 // ETSI TS 102 323 (TV Anytime)
2178 {
2179  public:
2180  DefaultAuthorityDescriptor(const unsigned char *data, int len = 300) :
2181  MPEGDescriptor(data, len, DescriptorID::default_authority) { }
2182  // Name bits loc expected value
2183  // descriptor_tag 8 0.0 0x73
2184  // descriptor_length 8 1.0
2185 
2186  QString DefaultAuthority(void) const
2187  {
2188  return QString::fromLatin1((const char *)_data+2, _data[1]);
2189  }
2190 
2191  QString toString(void) const override // MPEGDescriptor
2192  {
2193  return QString("DefaultAuthorityDescriptor: Authority(%1)")
2194  .arg(DefaultAuthority());
2195  }
2196 };
2197 
2198 /*
2199  * private UPC Cablecom (Austria) episode descriptor for Horizon middleware
2200  */
2202 {
2203  public:
2204  PrivateUPCCablecomEpisodeTitleDescriptor(const unsigned char *data, int len = 300) :
2205  MPEGDescriptor(data, len, PrivateDescriptorID::upc_event_episode_title) { }
2206  // Name bits loc expected value
2207  // descriptor_tag 8 0.0 0xa7
2208  // descriptor_length 8 1.0
2209 
2210  // ISO_639_language_code 24 2.0
2211  int LanguageKey(void) const
2212  {
2213  return iso639_str3_to_key(&_data[2]);
2214  }
2215  QString LanguageString(void) const
2216  {
2217  return iso639_key_to_str3(LanguageKey());
2218  }
2219  int CanonicalLanguageKey(void) const
2220  {
2222  }
2223  QString CanonicalLanguageString(void) const
2224  {
2226  }
2227 
2228  uint TextLength(void) const
2229  {
2230  return _data[1] - 3;
2231  }
2232 
2233  QString Text(void) const
2234  {
2235  return dvb_decode_text(&_data[5], TextLength());
2236  }
2237 };
2238 
2239 #endif
int CanonicalLanguageKey(void) const
bool IsTargetListed(void) const
unsigned long long FrequencyHz(void) const
bool HasASVC(void) const
uint Count(void) const
CellFrequencyLinkDescriptor(const unsigned char *data, int len=300)
ProgramInfo::CategoryType GetMythCategory(uint i) const
QMap< QString, QString > Items(void) const
QString BouquetName(void) const
ContentDescriptor(const unsigned char *data, int len=300)
DVB HD Simulcast Logical Channel Descriptor.
uint AncillaryPageID(uint i) const
MultilingualServiceNameDescriptor(const unsigned char *data, int len=300)
PrivateDataSpecifierDescriptor(const unsigned char *data, int len=300)
DVBLogicalChannelDescriptor(const unsigned char *data, int len=300)
QString dvb_decode_text(const unsigned char *src, uint length, const unsigned char *encoding_override, uint encoding_override_length)
int Rating(uint i) const
PDCDescriptor(const unsigned char *data, int len=300)
QString LanguageString(uint i) const
CAIdentifierDescriptor(const unsigned char *data, int len=300)
QString toString(void) const override
NVODReferenceDescriptor(const unsigned char *data, int len=300)
MultilingualBouquetNameDescriptor(const unsigned char *data, int len=300)
uint ServiceNameLength(void) const
DVBSimulcastChannelDescriptor(const unsigned char *data, int len=300)
BouquetNameDescriptor(const unsigned char *data, int len=300)
QString toString(void) const override
QString EventName(void) const
QString LanguageString(void) const
ShortEventDescriptor(const unsigned char *data, int len=300)
bool IsDTV(void) const
bool HasMobileNetworkID(void) const
unsigned char AVCProperties(void) const
bool HasComponentType(void) const
unsigned long long FrequencyHz(uint i) const
int LanguageKey(void) const
QString ServiceProviderName(void) const
unsigned char SubtitleType(void) const
ScramblingDescriptor(const unsigned char *data, int len=300)
QString BouquetShortName(void) const
int LanguageKey(void) const
QString toString(void) const override
uint ProgramIdLabel(void) const
unsigned long long Frequency(uint i) const
unsigned char AC3Properties(void) const
QString toString(void) const override
int CASystemId(uint i) const
uint SubtitleType(uint i) const
uint UserNibble(uint i) const
uint DataBroadCastId(void) const
QString MobileOriginTypeString(void) const
QString Text(const unsigned char *encoding_override, uint encoding_length) const
uint ComponentTag(void) const
int CanonicalLanguageKey(void) const
CellListDescriptor(const unsigned char *data, int len=300)
uint ComponentType(void) const
TeletextDescriptor(const unsigned char *data, int len=300)
unsigned char MPEG2Properties(void) const
This is used to label streams so the can be treated differently, for instance each stream may get it'...
QString LanguageString(void) const
DefaultAuthorityDescriptor(const unsigned char *data, int len=300)
QString CountryNames(void) const
bool IsUHDTV(void) const
QString toString(void) const override
QString FECInnerString(void) const
DVB Logical Channel Descriptor.
QString ContentId(size_t n=0) const
uint OrbitalPosition(void) const
orbital_position 16 6.0
QString EventName(const unsigned char *encoding_override, uint encoding_length) const
uint ServiceId(uint i) const
bool
Definition: pxsup2dast.c:30
QString Name(void) const
DSNGDescriptor(const unsigned char *data, int len=300)
ComponentDescriptor(const unsigned char *data, int len=300)
unsigned char VideoProperties(void) const
uint PrivateDataLength(void) const
unsigned int uint
Definition: compat.h:140
ServiceDescriptor(const unsigned char *data, int len=300)
PartialTransportStreamDescriptor(const unsigned char *data, int len=300)
static int iso639_str3_to_key(const unsigned char *iso639_2)
Definition: iso639.h:63
bool IsVerticalRightPolarization(void) const
const unsigned char * PrivateData(void) const
unsigned char MP2Properties(void) const
uint ServiceID(uint i) const
QString toString(void) const override
uint ScramblingMode(void) const
int iso639_key_to_canonical_key(int iso639_2)
Definition: iso639.cpp:121
AnnouncementSupportDescriptor(const unsigned char *data, int len=300)
uint ServiceType(uint i) const
bool IsSubtitle(void) const
QString toString(void) const override
CountryAvailabilityDescriptor(const unsigned char *data, int len=300)
TimeShiftedServiceDescriptor(const unsigned char *data, int len=300)
uint MainID(void) const
uint CountryRegionId(uint i) const
QString Data(void) const
ServiceMoveDescriptor(const unsigned char *data, int len=300)
uint ServiceID(void) const
#define byte4BCD2int(i, j, k, l)
StuffingDescriptor(const unsigned char *data, int len=300)
QString Text(void) const
uint StreamCount(void) const
uint TransportStreamId(uint i) const
VBIDataDescriptor(const unsigned char *data, int len=300)
QString ServiceProviderShortName(void) const
uint ASVC(void) const
uint DescriptorNumber(void) const
QString toString(void) const override
QString toString(void) const override
QString toString(void) const override
SubtitlingDescriptor(const unsigned char *data, int len=300)
TerrestrialDeliverySystemDescriptor(const unsigned char *data, int len=300)
uint StreamCount(void) const
int LanguageKey(void) const
LocalTimeOffsetDescriptor(const unsigned char *data, int len=300)
static void Init(void)
uint Count(void) const
static int x2
Definition: mythsocket.cpp:61
uint TeletextType(uint i) const
bool IsTeletext(void) const
#define byte3BCD2int(i, j, k)
QString toString(void) const override
QString toString(void) const override
QString Text(void) const
DVBContentIdentifierDescriptor(const unsigned char *data, int len=300)
uint ChannelNumber(uint i) const
bool IsVideo(void) const
uint SelectorLength(void) const
uint TextLength(void) const
QString toString(void) const
uint LengthOfItems(void) const
MosaicDescriptor(const unsigned char *data, int len=300)
uint MobileNetworkID(void) const
static QString coderate_inner(uint coderate)
PrivateUPCCablecomEpisodeTitleDescriptor(const unsigned char *data, int len=300)
VBITeletextDescriptor(const unsigned char *data, int len=300)
QString toString(void) const override
QString toString(void) const override
QString ModulationString(void) const
uint NextTimeOffset(uint i) const
DataBroadcastDescriptor(const unsigned char *data, int len=300)
AC3Descriptor(const unsigned char *data, int len=300)
static volatile bool categoryDescExists
QString ConstellationString(void) const
QString toString(void) const override
uint EventNameLength(void) const
uint TSID(void) const
ExtendedEventDescriptor(const unsigned char *data, int len=300)
bool IsDigitalAudio(void) const
bool IsHorizontalLeftPolarization(void) const
uint TextLength(void) const
uint TeletextPageNum(uint i) const
int LocalTimeOffsetWithPolarity(uint i) const
uint MobileInitialServiceID(void) const
static QMap< uint, QString > categoryDesc
int LanguageKey(uint i) const
FrequencyListDescriptor(const unsigned char *data, int len=300)
QString GetDescription(uint i) const
uint UserNibble1(uint i) const
bool HasBSID(void) const
MultilingualNetworkNameDescriptor(const unsigned char *data, int len=300)
uint ComponentTag(void) const
uint DataBroadcastId(void) const
AncillaryDataDescriptor(const unsigned char *data, int len=300)
QString CanonicalLanguageString(uint i) const
uint ServiceType(void) const
QString ServiceShortName(void) const
bool IsDigitalAudio(void) const
int LanguageKey(uint i) const
TimeShiftedEventDescriptor(const unsigned char *data, int len=300)
uint DescriptorLength(void) const
#define byteBCDH2int(i)
ServiceDescriptorMapping(const uint serviceid)
QString toString(void) const override
QString CountryCodeString(uint i) const
bool IsEast(void) const
west_east_flag 1 8.0
#define byte2BCD2int(i, j)
AdaptationFieldDataDescriptor(const unsigned char *data, int len=300)
QString DefaultAuthority(void) const
uint Nibble2(uint i) const
ShortSmoothingBufferDescriptor(const unsigned char *data, int len=300)
QString CanonicalLanguageString(void) const
SatelliteDeliverySystemDescriptor(const unsigned char *data, int len=300)
QString toString(void) const override
QString Text(void) const
QString toString(void) const override
bool IsTeletext(void) const
uint TargetEventID(void) const
uint TeletextMagazineNum(uint i) const
uint OriginalNetworkId(uint i) const
static int x5
Definition: mythsocket.cpp:64
uint AncillaryDataID(void) const
QString EventShortName(void) const
bool LocalTimeOffsetPolarity(uint i) const
-1 if true, +1 if false (behind utc, ahead of utc, resp).
uint32_t PrivateDataSpecifier(void) const
bool IsEventSimulcast(void) const
uint CompositionPageID(uint i) const
NetworkNameDescriptor(const unsigned char *data, int len=300)
uint TextLength(void) const
QString toString(void) const override
bool HasMobileInitialServiceID(void) const
QString TransmissionModeString(void) const
QString MobileHandOverTypeString(void) const
uint LastNumber(void) const
QString toString(void) const override
uint OriginalNetworkID() const
QString toString(void) const override
QString FECOuterString(void) const
QString LanguageString(void) const
QString toString(void) const override
QString toString(void) const override
uint ContentType(size_t n=0) const
QString FECInnerString(void) const
uint Nibble(uint i) const
TransportStreamDescriptor(const unsigned char *data, int len=300)
unsigned long long FrequencyHz(void) const
uint UserNibble2(uint i) const
const unsigned char * _data
bool HasMainID(void) const
QString LinkageTypeString(void) const
int CanonicalLanguageKey(void) const
QString CountryCodeString(uint i) const
QString ShortName(void) const
uint ServiceProviderNameLength(void) const
int CanonicalLanguageKey(uint i) const
int LanguageKey(void) const
QString CanonicalLanguageString(uint i) const
QString LanguageString(uint i) const
uint ContentEncoding(size_t n=0) const
QString ModulationSystemString(void) const
QString CanonicalLanguageString(void) const
QString toString(void) const override
static QString iso639_key_to_str3(int code)
Definition: iso639.h:46
uint MobileOriginType(void) const
QString toString(void) const override
QString toString(void) const override
bool IsValid(void) const
const unsigned char * Selector(void) const
bool IsAudio(void) const
QString CanonicalLanguageString(void) const
unsigned char HEVCProperties(void) const
uint ServiceID(uint i) const
QString dvb_decode_short_name(const unsigned char *src, uint raw_length)
uint BSID(void) const
DataBroadcastIdDescriptor(const unsigned char *data, int len=300)
int CanonicalLanguageKey(uint i) const
uint ServiceType(void) const
QString Text(const unsigned char *encoding_override, uint encoding_length) const
unsigned char HEAACProperties(void) const
QString ModulationString(void) const
TelephoneDescriptor(const unsigned char *data, int len=300)
uint ComponentType(void) const
uint StreamContent(void) const
uint DataComponentTag(void) const
ServiceAvailabilityDescriptor(const unsigned char *data, int len=300)
ServiceListDescriptor(const unsigned char *data, int len=300)
uint LinkageType(void) const
int CanonicalLanguageKey(void) const
QString toString(void) const override
uint ServiceCount(void) const
QString toString(void) const override
QString toString(void) const override
uint MobileHandOverType(void) const
uint ChannelNumber(uint i) const
static int x3
Definition: mythsocket.cpp:62
ParentalRatingDescriptor(const unsigned char *data, int len=300)
unsigned char AudioProperties(void) const
uint AdaptationFieldDataID(void) const
LinkageDescriptor(const unsigned char *data, int len=300)
uint CountryCode(uint i) const
uint CASystemCount(void) const
uint CodingType(void) const
QString OrbitalPositionString(void) const
uint LocalTimeOffset(uint i) const
static QMutex categoryLock
uint Nibble1(uint i) const
QString CanonicalLanguageString(void) const
QString ServiceName(void) const
bool IsHDTV(void) const
static int x1
Definition: mythsocket.cpp:60
CableDeliverySystemDescriptor(const unsigned char *data, int len=300)
StreamIdentifierDescriptor(const unsigned char *data, int len=300)
QString LanguageString(void) const
uint FrequencyRaw(void) const
frequency 32 2.0