MythTV  master
mpegdescriptors.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2005, Daniel Thor Kristjansson
3 
4 #include <climits>
5 
6 #include "sctedescriptors.h"
7 #include "atscdescriptors.h"
8 #include "dvbdescriptors.h"
9 #include "mythmiscutil.h" // for xml_indent
10 
13 QMap<QString,QString> RegistrationDescriptor::description_map;
14 
16  const unsigned char *data, uint len)
17 {
19  uint off = 0;
20  while (off < len)
21  {
22  tmp.push_back(data+off);
23  MPEGDescriptor desc(data+off, len-off);
24  if (!desc.IsValid())
25  {
26  tmp.pop_back();
27  break;
28  }
29  off += desc.size();
30  }
31  return tmp;
32 }
33 
35  const unsigned char *data, uint len, int excluded_descid)
36 {
38  uint off = 0;
39  while (off < len)
40  {
41  if ((data+off)[0] != excluded_descid)
42  tmp.push_back(data+off);
43  MPEGDescriptor desc(data+off, len-off);
44  if (!desc.IsValid())
45  {
46  if ((data+off)[0] != excluded_descid)
47  tmp.pop_back();
48  break;
49  }
50  off += desc.size();
51  }
52  return tmp;
53 }
54 
55 #include "mythlogging.h"
56 
58  const unsigned char *data, uint len, int excluded_descid)
59 {
61  uint off = 0;
62  while (off < len)
63  {
64  if ((data+off)[0] == excluded_descid)
65  tmp.push_back(data+off);
66  MPEGDescriptor desc(data+off, len-off);
67  if (!desc.IsValid())
68  {
69  if ((data+off)[0] == excluded_descid)
70  tmp.pop_back();
71  break;
72  }
73  off += desc.size();
74  }
75  return tmp;
76 }
77 
78 const unsigned char *MPEGDescriptor::Find(const desc_list_t &parsed,
79  uint desc_tag)
80 {
81  auto it = parsed.cbegin();
82  for (; it != parsed.cend(); ++it)
83  {
84  if ((*it)[0] == desc_tag)
85  return *it;
86  }
87  return nullptr;
88 }
89 
91 {
93  auto it = parsed.cbegin();
94  for (; it != parsed.cend(); ++it)
95  {
96  if ((*it)[0] == desc_tag)
97  tmp.push_back(*it);
98  }
99  return tmp;
100 }
101 
102 static uint maxPriority(const QMap<uint,uint> &langPrefs)
103 {
104  uint max_pri = 0;
105  QMap<uint,uint>::const_iterator it = langPrefs.begin();
106  for (; it != langPrefs.end(); ++it)
107  max_pri = max(max_pri, *it);
108  return max_pri;
109 }
110 
111 const unsigned char *MPEGDescriptor::FindBestMatch(
112  const desc_list_t &parsed, uint desc_tag, QMap<uint,uint> &langPrefs)
113 {
114  uint match_idx = 0;
115  uint match_pri = UINT_MAX;
116  int unmatched_idx = -1;
117 
118  size_t i = (desc_tag == DescriptorID::short_event) ? 0 : parsed.size();
119  for (; i < parsed.size(); i++)
120  {
121  if (DescriptorID::short_event == parsed[i][0])
122  {
123  ShortEventDescriptor sed(parsed[i]);
124  if (!sed.IsValid())
125  continue;
126  QMap<uint,uint>::const_iterator it =
127  langPrefs.find(sed.CanonicalLanguageKey());
128 
129  if ((it != langPrefs.end()) && (*it < match_pri))
130  {
131  match_idx = i;
132  match_pri = *it;
133  }
134 
135  if (unmatched_idx < 0)
136  unmatched_idx = i;
137  }
138  }
139 
140  if (match_pri != UINT_MAX)
141  return parsed[match_idx];
142 
143  if ((desc_tag == DescriptorID::short_event) && (unmatched_idx >= 0))
144  {
145  ShortEventDescriptor sed(parsed[unmatched_idx]);
146  if (sed.IsValid())
147  {
148  langPrefs[sed.CanonicalLanguageKey()] = maxPriority(langPrefs) + 1;
149  return parsed[unmatched_idx];
150  }
151  }
152 
153  return nullptr;
154 }
155 
157  const desc_list_t &parsed, uint desc_tag, QMap<uint,uint> &langPrefs)
158 {
159  uint match_pri = UINT_MAX;
160  int match_key = 0;
161  int unmatched_idx = -1;
162 
163  size_t i = (desc_tag == DescriptorID::extended_event) ? 0 : parsed.size();
164  for (; i < parsed.size(); i++)
165  {
166  if (DescriptorID::extended_event == parsed[i][0])
167  {
168  ExtendedEventDescriptor eed(parsed[i]);
169  if (!eed.IsValid())
170  continue;
171  QMap<uint,uint>::const_iterator it =
172  langPrefs.find(eed.CanonicalLanguageKey());
173 
174  if ((it != langPrefs.end()) && (*it < match_pri))
175  {
176  match_key = eed.LanguageKey();
177  match_pri = *it;
178  }
179 
180  if (unmatched_idx < 0)
181  unmatched_idx = i;
182  }
183  }
184 
185  if ((desc_tag == DescriptorID::extended_event) &&
186  (match_key == 0) && (unmatched_idx >= 0))
187  {
188  ExtendedEventDescriptor eed(parsed[unmatched_idx]);
189  if (eed.IsValid())
190  {
191  langPrefs[eed.CanonicalLanguageKey()] = maxPriority(langPrefs) + 1;
192  match_key = eed.LanguageKey();
193  }
194  }
195 
197  if (match_pri == UINT_MAX)
198  return tmp;
199 
200  for (size_t j = 0; j < parsed.size(); j++)
201  {
202  if ((DescriptorID::extended_event == desc_tag) &&
203  (DescriptorID::extended_event == parsed[j][0]))
204  {
205  ExtendedEventDescriptor eed(parsed[j]);
206  if (eed.IsValid() && (eed.LanguageKey() == match_key))
207  tmp.push_back(parsed[j]);
208  }
209  }
210 
211  return tmp;
212 }
213 
214 #define EMPTY_STR_16 "","","","", "","","","", "","","","", "","","","",
215 
216 const char *descriptor_tag_strings[256] =
217 {
218  /* 0x00 */ "", /* 0x01 */ "",
219  /* 0x02 */ "Video", /* 0x03 */ "Audio",
220  /* 0x04 */ "Hierarchy", /* 0x05 */ "Registration",
221  /* 0x06 */ "Data Stream Alignment", /* 0x07 */ "Target Background Grid",
222  /* 0x08 */ "Video Window", /* 0x09 */ "Conditional Access",
223  /* 0x0A */ "ISO-639 Language", /* 0x0B */ "System Clock",
224  /* 0x0C */ "Multiplex Buffer Utilization", /* 0x0D */ "Copyright",
225  /* 0x0E */ "Maximum Bitrate", /* 0x0F */ "Private Data Indicator",
226 
227  /* 0x10 */ "Smooting Buffer", /* 0x11 */ "STD",
228  /* 0x12 */ "IBP", /* 0x13 */ "DSM-CC Carousel Identifier",
229  /* 0x14 */ "DSM-CC Association Tag",
230  /* 0x15 */ "DSM-CC Deferred Association Tag",
231  /* 0x16 */ "Reserved(0x16)", /* 0x17 */ "DSM-CC NPT Reference",
232  /* 0x18 */ "DSM-CC NPT Endpoint", /* 0x19 */ "DSM-CC Stream Mode",
233  /* 0x1A */ "DSM-CC Stream Event", /* 0x1B */ "MPEG-4 Video",
234  /* 0x1C */ "MPEG-4 Audio", /* 0x1D */ "IOD",
235  /* 0x1E */ "SL", /* 0x1F */ "FMC",
236 
237  /* 0x20 */ "External ES ID", /* 0x21 */ "Multimpex Code",
238  /* 0x22 */ "FMX buffer Size", /* 0x23 */ "Multiplex Buffer",
239  /* 0x24 */ "Content Labeling", /* 0x25 */ "Metadata Pointer",
240  /* 0x26 */ "Metadata", /* 0x27 */ "Metadata Std",
241  /* 0x28 */ "AVC Video", /* 0x29 */ "IPMP DRM",
242  /* 0x2A */ "AVC Timing & HRD", /* 0x2B */ "AAC Audio",
243  /* 0x2C */ "Flex Mux Timing", /* 0x2D */ "",
244  /* 0x2E */ "", /* 0x2F */ "",
245 
246  /* 0x30-0x3F */ EMPTY_STR_16
247 
248  /* 0x40 */ "Network Name", /* 0x41 */ "Service List",
249  /* 0x42 */ "DVB Stuffing", /* 0x43 */ "Satellite Delivery System",
250  /* 0x44 */ "Cable Delivery System", /* 0x45 */ "VBI Data",
251  /* 0x46 */ "VBI Teletext", /* 0x47 */ "Bouquet Name",
252  /* 0x48 */ "Service", /* 0x49 */ "Country Availability",
253  /* 0x4A */ "Linkage", /* 0x4B */ "NVOD Reference",
254  /* 0x4C */ "DVB Time-shifted Service",/* 0x4D */ "Short Event",
255  /* 0x4E */ "Extended Event", /* 0x4F */ "Time-shifted Event",
256 
257  /* 0x50 */ "Component", /* 0x51 */ "Mosaic",
258  /* 0x52 */ "Stream Identifier",
259  /* 0x53 */ "Conditional Access Identifier",
260  /* 0x54 */ "Content", /* 0x55 */ "Parental Rating",
261  /* 0x56 */ "Teletext", /* 0x57 */ "Telephone",
262  /* 0x58 */ "Local Time Offset", /* 0x59 */ "Subtitling",
263  /* 0x5A */ "Terrestrial Delivery System",
264  /* 0x5B */ "Multilingual Network Name",
265  /* 0x5C */ "Multilingual Bouquet Name",
266  /* 0x5D */ "Multilingual Service Name",
267  /* 0x5E */ "Multilingual Component",
268  /* 0x5F */ "Private Data Specifier",
269 
270  /* 0x60 */ "Service Move", /* 0x61 */ "Short Smoothing Buffer",
271  /* 0x62 */ "Frequency List", /* 0x63 */ "Partial Transport Stream",
272  /* 0x64 */ "Data Broadcast", /* 0x65 */ "Scrambling",
273  /* 0x66 */ "Data Broadcast ID", /* 0x67 */ "Transport Stream",
274  /* 0x68 */ "DSNG", /* 0x69 */ "PDC",
275  /* 0x6A */ "AC-3", /* 0x6B */ "Ancillary Data",
276  /* 0x6C */ "Cell List", /* 0x6D */ "Cell Frequency Link",
277  /* 0x6E */ "Announcement Support", /* 0x6F */ "Application Signalling",
278 
279  /* 0x70 */ "Adaptation Field Data", /* 0x71 */ "Service Identifier",
280  /* 0x72 */ "Service Availability", /* 0x73 */ "Default Authority",
281  /* 0x74 */ "Related Content", /* 0x75 */ "TVA ID",
282  /* 0x76 */ "DVB Content Identifier",/* 0x77 */ "Time Slice FEC Identifier",
283  /* 0x78 */ "ECM Repetition Rate", /* 0x79 */ "DVB-S2 Delivery Identifier",
284  /* 0x7A */ "E-AC-3", /* 0x7B */ "DTS",
285  /* 0x7C */ "AAC", /* 0x7D */ "",
286  /* 0x7E */ "", /* 0x7F */ "",
287 
288  /* 0x80 */ "ATSC Stuffing", /* 0x81 */ "AC-3 Audio",
289  /* 0x82 */ "SCTE Frame Rate", /* 0x83 */ "SCTE Extended Video",
290  /* 0x84 */ "SCTE Component Name", /* 0x85 */ "ATSC Program Identifier",
291  /* 0x86 */ "Caption Service", /* 0x87 */ "Content Advisory",
292  /* 0x88 */ "ATSC CA Descriptor", /* 0x89 */ "ATSC Descriptor Tag",
293  /* 0x8A */ "SCTE CUE Identifier", /* 0x8B */ "",
294  /* 0x8C */ "TimeStamp", /* 0x8D */ "",
295  /* 0x8E */ "", /* 0x8F */ "",
296 
297  /* 0x90 */ "SCTE Frequency Spec", /* 0x91 */ "SCTE Modulation Params",
298  /* 0x92 */ "SCTE TSID", /* 0x93 */ "SCTE Revision Detection",
299  /* 0x94 */ "SCTE Two part channel", /* 0x95 */ "SCTE Channel Properties",
300  /* 0x96 */ "SCTE Daylight Savings", /* 0x97 */ "SCTE AFD",
301  /* 0x98 */ "", /* 0x99 */ "",
302  /* 0x9A */ "", /* 0x9B */ "",
303  /* 0x9C */ "", /* 0x9D */ "",
304  /* 0x9E */ "", /* 0x9F */ "",
305 
306  /* 0xA0 */ "Extended Channel Name", /* 0xA1 */ "Service Location",
307  /* 0xA2 */ "ATSC Time-shifted Service",/*0xA3*/"Component Name",
308  /* 0xA4 */ "ATSC Data Service", /* 0xA5 */ "ATSC PID Count",
309  /* 0xA6 */ "ATSC Download",
310  /* 0xA7 */ "ATSC Multiprotocol Encapsulation",
311  /* 0xA8 */ "DCC Departing Request", /* 0xA9 */ "DCC Arriving Request",
312  /* 0xAA */ "ATSC Restrictions Control",/*0xAB*/"ATSC Genre",
313  /* 0xAC */ "SCTE MAC Address List", /* 0xAD */ "ATSC Private Information",
314  /* 0xAE */ "ATSC Compatibility Wrap",/* 0xAF */"ATSC Broadcaster Policy",
315 
316  /* 0xB0 */ "", /* 0xB1 */ "",
317  /* 0xB2 */ "", /* 0xB3 */ "",
318  /* 0xB4 */ "", /* 0xB5 */ "",
319  /* 0xB6 */ "ATSC Content ID", /* 0xB7 */ "",
320  /* 0xB8 */ "", /* 0xB9 */ "",
321  /* 0xBA */ "", /* 0xBB */ "",
322  /* 0xBC */ "", /* 0xBD */ "",
323  /* 0xBE */ "", /* 0xBF */ "",
324 
325  /* 0xC0-0xCF */ EMPTY_STR_16
326  /* 0xD0-0xDF */ EMPTY_STR_16
327  /* 0xE0-0xEF */ EMPTY_STR_16
328  /* 0xF0-0xFF */ EMPTY_STR_16
329 };
330 
331 static void comma_list_append(QString &str, const QString& extra)
332 {
333  if (str.isEmpty())
334  str = extra;
335  else
336  str = str + ", " + extra;
337 }
338 
340 {
341  QString str = descriptor_tag_strings[DescriptorTag()];
342 
343  switch (DescriptorTag())
344  {
346  comma_list_append(str, "Possibly DVB Logical Channel Descriptor");
347  break;
349  comma_list_append(str, "Possibly Dishnet Rights");
350  break;
352  comma_list_append(str, "Possibly Dishnet MPAA");
353  break;
355  comma_list_append(str, "Possibly Dishnet EIT Name");
356  break;
358  comma_list_append(str, "Possibly Dishnet EIT Description");
359  break;
361  comma_list_append(str, "Possibly Dishnet Properties");
362  break;
364  comma_list_append(str, "Possibly Dishnet V-Chip");
365  break;
366  case PrivateDescriptorID::dish_event_tags: /* 0x96 */
367  comma_list_append(str, "Possibly Dishnet Tag");
368  break;
370  comma_list_append(str, "Possibly Premiere DE Content Order");
371  break;
373  comma_list_append(str, "Possibly Premiere DE Parental Information");
374  break;
376  comma_list_append(str, "Possibly Premiere DE Content Transmission");
377  break;
378  }
379 
380  if (str.isEmpty())
381  str = QString("Unknown(%1)").arg(DescriptorTag());
382 
383  return str;
384 }
385 
386 #define SET_STRING(DESC_NAME) do { \
387  if (IsValid()) { DESC_NAME d(_data, DescriptorLength()+2); \
388  if (d.IsValid()) str = d.toString(); } } while (false)
389 
390 QString MPEGDescriptor::descrDump(const QString &name) const
391 {
392  QString str;
393  str = QString("%1 Descriptor (0x%2) length(%3). Dumping\n")
394  .arg(name)
395  .arg(DescriptorTag(),2,16,QChar('0'))
396  .arg(DescriptorLength());
397  str.append(hexdump());
398  return str;
399 }
400 
401 QString MPEGDescriptor::toString(void) const
402 {
403  return toStringPD(0);
404 }
405 
406 QString MPEGDescriptor::toStringPD(uint priv_dsid) const
407 {
408  QString str;
409 
410  if (!IsValid())
411  str = "Invalid Descriptor";
432  else if (DescriptorID::service == DescriptorTag())
436  //else if (DescriptorID::linkage == DescriptorTag())
437  // SET_STRING(LinkageDescriptor);
446  //else if (DescriptorID::ancillary_data == DescriptorTag())
447  // SET_STRING(AncillaryDataDescriptor);
452  //
453  // User Defined DVB descriptors, range 0x80-0xFE
454  else if (priv_dsid == PrivateDataSpecifierID::BSB1 &&
457  else if (priv_dsid == PrivateDataSpecifierID::FSAT &&
460  else if (priv_dsid == PrivateDataSpecifierID::FSAT &&
463  else if (priv_dsid == PrivateDataSpecifierID::FSAT &&
466  else if (priv_dsid == PrivateDataSpecifierID::CASEMA &&
468  descrDump("Video on Demand");
469  else if ((priv_dsid == PrivateDataSpecifierID::EACEM ||
470  priv_dsid == PrivateDataSpecifierID::NORDIG ||
471  priv_dsid == PrivateDataSpecifierID::ITC ) &&
474  else if ((priv_dsid == PrivateDataSpecifierID::EACEM ||
475  priv_dsid == PrivateDataSpecifierID::NORDIG ||
476  priv_dsid == PrivateDataSpecifierID::ITC ) &&
479  //
480  // POSSIBLY UNSAFE ! -- begin
481  // ATSC/SCTE descriptors, range 0x80-0xFE
492  else if (priv_dsid == 0 &&
495  // POSSIBLY UNSAFE ! -- end
496  else
497  {
498  str = QString("%1 Descriptor (0x%2) length(%3). Dumping\n")
499  .arg(DescriptorTagString())
500  .arg(DescriptorTag(),2,16,QChar('0'))
501  .arg(DescriptorLength());
502  //for (uint i=0; i<DescriptorLength(); i++)
503  // str.append(QString(" 0x%1").arg(int(_data[i+2]), 0, 16));
504  str.append(hexdump());
505  }
506  return str;
507 }
508 
511 QString MPEGDescriptor::toStringXML(uint level) const
512 {
513  QString indent_0 = xml_indent(level);
514  QString indent_1 = xml_indent(level+1);
515  QString str;
516 
517  str += indent_0 + "<Descriptor>\n";
518  str += indent_1 + QString("<Tag>0x%1</Tag>\n")
519  .arg(DescriptorTag(),2,16,QChar('0'));
520  str += indent_1 + QString("<Description>%1</Description>\n")
521  .arg(DescriptorTagString(),0,16);
522 
523  str += indent_1 + "<Data>";
524  for (uint i = 0; i < DescriptorLength(); i++)
525  {
526  if (((i%8) == 0) && i)
527  str += "\n" + indent_1 + " ";
528  str += QString("0x%1 ").arg(_data[i+2],2,16,QChar('0'));
529  }
530 
531  str += "\n" + indent_1 + "</Data>\n";
532  str += indent_1 + "<Decoded>" + toString().toHtmlEscaped() + "</Decoded>\n";
533  str += indent_0 + "</Descriptor>";
534 
535  return str;
536 }
537 
538 // Dump the descriptor in the same format as hexdump -C
539 QString MPEGDescriptor::hexdump(void) const
540 {
541  uint i;
542  QString str, hex, prt;
543  for (i=0; i<DescriptorLength(); i++)
544  {
545  uint ch = _data[i+2];
546  hex.append(QString(" %1").arg(ch, 2, 16, QChar('0')));
547  prt.append(QString("%1").arg(isprint(ch) ? QChar(ch) : '.'));
548  if (((i+1) % 8) == 0)
549  hex.append(" ");
550  if (((i+1) % 16) == 0)
551  {
552  str.append(QString(" %1 %2 |%3|\n")
553  .arg(i - (i % 16),3,16,QChar('0'))
554  .arg(hex).arg(prt));
555  hex.clear();
556  prt.clear();
557  }
558  }
559  str.append(QString(" %1 %2 |%3|")
560  .arg(i - (i % 16),3,16,QChar('0'))
561  .arg(hex,-50,' ').arg(prt));
562  return str;
563 }
564 
566 {
567  QMutexLocker locker(&description_map_lock);
569  return;
570 
571  description_map["AC-3"] = "ATSC audio stream A/52";
572  description_map["AVSV"] = "China A/V Working Group";
573  description_map["BDC0"] = "Broadcast Data Corporation Software Data Service";
574  description_map["BSSD"] = "SMPTE 302M-1998 Audio data as specified in (AES3)";
575  description_map["CAPO"] = "SMPTE 315M-1999 Camera Positioning Information";
576  description_map["CUEI"] = "SCTE 35 2003, Cable Digital Program Insertion Cueing Message";
577  description_map["DDED"] = "LGEUS Digital Delivery with encryption and decryption";
578  description_map["DISH"] = "EchoStar MPEG streams";
579  description_map["DRA1"] = "Chinese EIS SJ/T11368-2006 DRA digital audio";
580  description_map["DTS1"] = "DTS Frame size of 512 bytes";
581  description_map["DTS2"] = "DTS Frame size of 1024 bytes";
582  description_map["DTS3"] = "DTS Frame size of 2048";
583  description_map["DVDF"] = "DVD compatible MPEG2-TS";
584  description_map["ETV1"] = "CableLabs ETV info is present";
585  description_map["GA94"] = "ATSC program ID A/53";
586  description_map["GWKS"] = "GuideWorks EPG info";
587  description_map["HDMV"] = "Blu-Ray A/V for read-only media (H.264 TS)";
588  description_map["HDMX"] = "Matsushita-TS";
589  description_map["KLVA"] = "SMPTE RP 217-2001 MXF KLV packets present";
590  description_map["LU-A"] = "SMPTE RDD-11 HDSDI HD serial/video data";
591  description_map["MTRM"] = "D-VHS compatible MPEG2-TS";
592  description_map["NMR1"] = "Nielsen content identifier";
593  description_map["PAUX"] = "Philips ES containing low-speed data";
594  description_map["PMSF"] = "MPEG-TS stream modified by STB";
595  description_map["PRMC"] = "Philips ES containing remote control data";
596  description_map["SCTE"] = "SCTE 54 2003 Digital Video Service Multiplex and TS for Cable";
597  description_map["SEN1"] = "ATSC Private Information identifies source of stream";
598  description_map["SESF"] = "Blu-Ray A/V for ReWritable media (H.264 TS)";
599  description_map["SPLC"] = "SMPTE Proposed 312M Splice Point compatible TS";
600  description_map["SVMD"] = "SMPTE Proposed Video Metatdata Dictionary for MPEG2-TS";
601  description_map["SZMI"] = "ATSC Private Info from Building B";
602  description_map["TRIV"] = "ATSC Private Info from Triveni Digital";
603  description_map["TSBV"] = "Toshiba self-encoded H.264 TS";
604  description_map["TSHV"] = "Sony self-encoded MPEG-TS and private data";
605  description_map["TSMV"] = "Sony self-encoded MPEG-TS and private data";
606  description_map["TVG1"] = "TV Guide EPG Data";
607  description_map["TVG2"] = "TV Guide EPG Data";
608  description_map["TVG3"] = "TV Guide EPG Data";
609  description_map["ULE1"] = "IETF RFC4326 compatible MPEG2-TS";
610  description_map["VC-1"] = "SMPTE Draft RP 227 VC-1 Bitstream Transport Encodings";
611 
612  for (uint i = 0; i <= 99; i++)
613  {
614  description_map[QString("US%1").arg(i, 2, QLatin1Char('0'))] =
615  "NIMA, Unspecified military application";
616  }
617 
619 }
620 
621 QString RegistrationDescriptor::GetDescription(const QString &fmt)
622 {
624 
625  QString ret;
626  {
627  QMutexLocker locker(&description_map_lock);
628  QMap<QString,QString>::const_iterator it = description_map.find(fmt);
629  if (it != description_map.end())
630  ret = *it;
631  }
632 
633  return ret;
634 }
635 
637 {
638  QString fmt = FormatIdentifierString();
639  QString msg = QString("Registration Descriptor: '%1' ").arg(fmt);
640 
641  QString msg2 = GetDescription(fmt);
642  if (msg2.isEmpty())
643  msg2 = "Unknown, see http://www.smpte-ra.org/mpegreg/mpegreg.html";
644 
645  return msg + msg2;
646 }
647 
649 {
650  return QString("Conditional Access: sid(0x%1) pid(0x%2) data_size(%3)")
651  .arg(SystemID(),0,16).arg(PID(),0,16).arg(DataSize());
652 }
653 
655 {
656  return QString("ISO-639 Language: code(%1) canonical(%2) eng(%3)")
659 }
660 
662 {
663  return QString("AVC Video: IDC prof(%1) IDC level(%2) sets(%3%4%5) "
664  "compat(%6) still(%7) 24hr(%8) FramePacking(%9)")
665  .arg(ProfileIDC()).arg(LevelIDC())
666  .arg(ConstaintSet0()).arg(ConstaintSet1()).arg(ConstaintSet2())
667  .arg(AVCCompatible()).arg(AVCStill()).arg(AVC24HourPicture())
669 }
670 
672 {
673  return QString("HEVC Video: ");
674 }
bool FramePackingSEINotPresentFlag(void) const
DVB HD Simulcast Logical Channel Descriptor.
bool ConstaintSet0(void) const
This descriptor is used to identify streams with SpliceInformationTable data in them.
QString toString() const override
Freesat Region descriptor.
int LanguageKey(void) const
QString CanonicalLanguageString(void) const
uint LevelIDC(void) const
int CanonicalLanguageKey(void) const
This is used to label streams so the can be treated differently, for instance each stream may get it'...
QString iso639_key_toName(int iso639_2)
Converts a canonical key to language name in English.
Definition: iso639.cpp:111
bool AVCStill(void) const
uint DescriptorTag(void) const
DVB Logical Channel Descriptor.
virtual QString toString(void) const
static void InitializeDescriptionMap(void)
static const unsigned char * FindBestMatch(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
vector< const unsigned char * > desc_list_t
static bool description_map_initialized
static QString GetDescription(const QString &fmt)
QString DescriptorTagString(void) const
static guint32 * tmp
Definition: goom_core.c:35
Freesat Channel Callsign descriptor.
uint size(void) const
static desc_list_t ParseAndExclude(const unsigned char *data, uint len, int excluded_descid)
static uint maxPriority(const QMap< uint, uint > &langPrefs)
uint AVCCompatible(void) const
virtual QString toStringPD(uint priv_dsid) const
QString descrDump(const QString &name) const
ISO 13818-1:2000/Amd.3:2004 page 11.
Freesat Logical Channel Number descriptor.
static QMutex description_map_lock
unsigned int uint
Definition: compat.h:140
BSkyB Logical Channel Number descriptor.
static QMap< QString, QString > description_map
static void comma_list_append(QString &str, const QString &extra)
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
uint DescriptorLength(void) const
int CanonicalLanguageKey(void) const
ISO 13818-1:2013/FDAM 3 (E) page 7.
QString FormatIdentifierString(void) const
bool AVC24HourPicture(void) const
QString toString() const override
const unsigned char * _data
Provides the long channel name for the virtual channel containing this descriptor.
bool ConstaintSet1(void) const
QString toString() const override
QString toString() const override
bool IsValid(void) const
bool ConstaintSet2(void) const
QString hexdump(void) const
static desc_list_t FindBestMatches(const desc_list_t &parsed, uint desc_tag, QMap< uint, uint > &langPref)
QString LanguageString(void) const
virtual QString toStringXML(uint indent_level) const
Returns XML representation of string the TS Reader XML format.
const char * descriptor_tag_strings[256]
#define EMPTY_STR_16
static desc_list_t FindAll(const desc_list_t &parsed, uint desc_tag)
int CanonicalLanguageKey(void) const
QString toString() const override
#define SET_STRING(DESC_NAME)
static desc_list_t Parse(const unsigned char *data, uint len)
static desc_list_t ParseOnlyInclude(const unsigned char *data, uint len, int excluded_descid)
uint ProfileIDC(void) const
QString xml_indent(uint level)