MythTV  master
mpegtables.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2004, Daniel Thor Kristjansson
3 
4 #include "splicedescriptors.h"
5 #include "atscdescriptors.h"
6 #include "mythmiscutil.h" // for xml_indent
7 #include "mythlogging.h"
8 #include "mpegtables.h"
9 
10 const std::array<const uint8_t,8> DEFAULT_PAT_HEADER
11 {
12  0x00, // TableID::PAT
13  0xb0, // Syntax indicator
14  0x00, // Length (set separately)
15  0x00, // Transport stream ID top bits
16 
17  0x00, // Transport stream ID bottom bits
18  0xc1, // current | reserved
19  0x00, // Current Section
20  0x00, // Last Section
21 };
22 
23 const std::array<const uint8_t,12> DEFAULT_PMT_HEADER
24 {
25  0x02, // TableID::PMT
26  0xb0, // Syntax indicator
27  0x00, // Length (set separately)
28  0x00, // MPEG Program number top bits (set separately)
29 
30  0x00, // MPEG Program number bottom bits (set separately)
31  0xc1, // Version + Current/Next
32  0x00, // Current Section
33  0x00, // Last Section
34  0xff, 0xff, // PCR pid
35  0x00, 0x00, // Program Info Length
36 };
37 
38 static const std::array<const uint,4> len_for_alloc
39 {
41  - 1 /* for start of field pointer */
42  - 3 /* for data before data last byte of pes length */,
43  4000,
44 };
45 
46 uint StreamID::Normalize(uint stream_id, const desc_list_t &desc,
47  const QString &sistandard)
48 {
49  if ((sistandard != "dvb") && (OpenCableVideo == stream_id))
50  return MPEG2Video;
51 
52  /* normalize DVB style signalling to ATSC style signalling to make
53  * IsAudio work with either, see A/52:2010 A4 vs A5 */
55  return AC3Audio;
56 
57  /* normalize DVB style signalling to ATSC style signalling to make
58  * IsAudio work with either */
60  return EAC3Audio;
61 
62  QString reg;
63  const unsigned char *d = MPEGDescriptor::Find(
65  if (d)
66  {
68  if (rd.IsValid())
69  reg = rd.FormatIdentifierString();
70  }
71 
72  /* normalize all three DTS frame sizes, via http://www.smpte-ra.org/mpegreg/mpegreg.html */
73  if ((reg == "DTS1") || (reg == "DTS2") || (reg == "DTS3"))
74  return DTSAudio;
75 
76  /* normalize AC-3 signalling according to A/52:2010 A4 */
77  if (reg == "AC-3")
78  return AC3Audio;
79 
80  /* normalize E-AC-3 signalling with guesswork via http://www.smpte-ra.org/mpegreg/mpegreg.html */
81  if (reg == "EAC3")
82  return EAC3Audio;
83 
84 #if 0
85  // not needed while there is no specific stream id for these
88  return stream_id;
89 #endif
90 
91  return stream_id;
92 }
93 
94 bool PSIPTable::HasCRC(void) const
95 {
96  // default is false, but gets set to true for 0x80-0xfe at the end!
97  bool has_crc = false;
98 
99  switch (TableID())
100  {
101  // MPEG
102  case TableID::PAT: // NOLINT(bugprone-branch-clone)
103  case TableID::CAT:
104  case TableID::PMT:
105  has_crc = true;
106  break;
107 // case TableID::TSDT
108 
109  // DVB manditory
110  case TableID::NIT:
111  case TableID::SDT:
112  case TableID::PF_EIT:
113  has_crc = true;
114  break;
115  case TableID::TDT:
116  has_crc = false;
117  break;
118 
119  // DVB optional
120  case TableID::NITo:
121  case TableID::SDTo:
122  case TableID::BAT:
123  case TableID::PF_EITo:
124  has_crc = true;
125  break;
126  case TableID::RST:
127  case TableID::ST:
128  has_crc = false;
129  break;
130  case TableID::TOT:
131  has_crc = true;
132  break;
133 // case TableID::RNT:
134 // case TableID::CT:
135 // case TableID::RCT:
136 // case TableID::CIT:
137 // case TableID::MPEFEC:
138  case TableID::DIT:
139  has_crc = false;
140  break;
141  case TableID::SIT: // NOLINT(bugprone-branch-clone)
142  has_crc = true;
143  break;
144 
145  // SCTE
146  case TableID::NITscte:
147  case TableID::NTT:
148  case TableID::SVCTscte:
149  case TableID::STTscte:
150  case TableID::SITscte:
151  has_crc = true;
152  break;
153  case TableID::ADET:
154  has_crc = false;
155  break;
156 
157  // ATSC
158  case TableID::MGT:
159  case TableID::TVCT:
160  case TableID::CVCT:
161  case TableID::RRT:
162  case TableID::EIT:
163  case TableID::ETT:
164  case TableID::STT:
165  case TableID::DET:
166  case TableID::DST:
167 
168  //case TableID::PIT:
169  case TableID::NRT:
170  case TableID::LTST:
171  case TableID::DCCT:
172  case TableID::DCCSCT:
173  //case TableID::SITatsc:
174  case TableID::AEIT:
175  case TableID::AETT:
176  case TableID::SVCT:
177  has_crc = true;
178  break;
179 
180  default:
181  {
182  // DVB Longterm EIT data
183  if (TableID::SC_EITbeg <= TableID() &&
185  {
186  has_crc = true;
187  }
188 
189  // FIXME Dishnet Longterm EIT data, only on PID 0x300! Forces
190  // table_id 0x80-0xfe to true, unless handled before or after!
191  if (TableID::DN_EITbego <= TableID() &&
193  {
194  has_crc = true;
195  }
196 
197  // ATSC/DVB conditional access ECM/EMM, reset to false after Dishnet
198  if (TableID::ECM0 <= TableID() &&
200  {
201  has_crc = false;
202  }
203  }
204  break;
205  }
206 
207  return has_crc;
208 }
209 
211 {
212  bool has_sn = false;
213  switch (TableID())
214  {
215  // MPEG
216  case TableID::PAT:
217  case TableID::CAT:
218  case TableID::PMT:
219  // ATSC
220  case TableID::MGT:
221  case TableID::TVCT:
222  case TableID::CVCT:
223  case TableID::RRT:
224  case TableID::EIT:
225  case TableID::ETT:
226  case TableID::STT:
227  case TableID::DET:
228  case TableID::DST:
229  has_sn = true;
230  break;
231  }
232 
233  return has_sn;
234 }
235 
236 bool PSIPTable::VerifyPSIP(bool verify_crc) const
237 {
238  if (verify_crc && (CalcCRC() != CRC()))
239  {
240  LOG(VB_SIPARSER, LOG_ERR,
241  QString("PSIPTable: Failed CRC check 0x%1 != 0x%2 "
242  "for StreamID = 0x%3")
243  .arg(CRC(),0,16).arg(CalcCRC(),0,16).arg(StreamID(),0,16));
244  return false;
245  }
246 
247  unsigned char *bufend = m_fullBuffer + m_allocSize;
248 
249  if ((m_pesData + 2) >= bufend)
250  return false; // can't query length
251 
252  if (psipdata() >= bufend)
253  return false; // data outside buffer
254 
255  if (TableID::PAT == TableID())
256  {
257  uint pcnt = (SectionLength() - kPsipOffset - 2) >> 2;
258  bool ok = (psipdata() + (pcnt << 2) + 3 < bufend);
259  if (!ok)
260  {
261  LOG(VB_SIPARSER, LOG_ERR,
262  "PSIPTable: PAT: program list extends past end of buffer");
263  return false;
264  }
265 
266  if ((Length() == 0xfff) && (TableIDExtension() == 0xffff) &&
267  (Section() == 0xff) && (LastSection() == 0xff))
268  {
269  LOG(VB_SIPARSER, LOG_ERR, "PSIPTable: PAT: All values at maximums");
270  return false;
271  }
272 
273  return true;
274  }
275 
276  if (TableID::PMT == TableID())
277  {
278  if (psipdata() + 3 >= bufend)
279  {
280  LOG(VB_SIPARSER, LOG_ERR,
281  "PSIPTable: PMT: can't query program info length");
282  return false;
283  }
284 
285  if (psipdata() + Length() - 9 > bufend)
286  {
287  LOG(VB_SIPARSER, LOG_ERR,
288  "PSIPTable: PMT: reported length too large");
289  return false;
290  }
291 
292  uint proginfolen = ((psipdata()[2]<<8) | psipdata()[3]) & 0x0fff;
293  const unsigned char *proginfo = psipdata() + 4;
294  const unsigned char *cpos = proginfo + proginfolen;
295  if (cpos > bufend)
296  {
297  LOG(VB_SIPARSER, LOG_ERR,
298  "PSIPTable: PMT: program info extends past end of buffer");
299  return false;
300  }
301 
302  const unsigned char *pos = cpos;
303  uint i = 0;
304  for (; pos < psipdata() + Length() - 9; i++)
305  {
306  const unsigned char *ptr = pos;
307  if (pos + 4 > bufend)
308  {
309  LOG(VB_SIPARSER, LOG_ERR,
310  QString("PSIPTable: PMT: stream info %1 extends "
311  "past end of buffer").arg(i));
312  return false;
313  }
314  pos += 5 + (((ptr[3] << 8) | ptr[4]) & 0x0fff);
315  }
316  if (pos > bufend)
317  {
318  LOG(VB_SIPARSER, LOG_ERR,
319  QString("PSIPTable: PMT: last stream info %1 extends "
320  "past end of buffer").arg(i));
321  return false;
322  }
323 
324  return true;
325  }
326 
327  return true;
328 }
329 
331 {
332  (void) smallPacket; // currently always a small packet..
334  auto *dst = tspacket->data() + sizeof(TSHeader) + 1; /* start of field pointer */
335  std::copy(DEFAULT_PAT_HEADER.cbegin(), DEFAULT_PAT_HEADER.cend(), dst);
336  PSIPTable psip = PSIPTable::View(*tspacket);
338  - 1 /* for start of field pointer */
339  - 3 /* for data before data last byte of pes length */);
340  auto *pat = new ProgramAssociationTable(psip);
341  pat->SetTotalLength(DEFAULT_PAT_HEADER.size());
342  delete tspacket;
343  return pat;
344 }
345 
347  uint tsid, uint version,
348  const vector<uint>& pnum, const vector<uint>& pid)
349 {
350  const uint count = min(pnum.size(), pid.size());
353  pat->SetTranportStreamID(tsid);
354  pat->SetTotalLength(kPsipOffset + (count * 4));
355 
356  // create PAT data
357  if ((count * 4) >= (184 - (kPsipOffset+1)))
358  { // old PAT must be in single TS for this create function
359  LOG(VB_GENERAL, LOG_ERR,
360  "PAT::Create: Error, old PAT size exceeds maximum PAT size.");
361  delete pat;
362  return nullptr;
363  }
364 
365  uint offset = kPsipOffset;
366  for (uint i = 0; i < count; i++)
367  {
368  // pnum
369  pat->pesdata()[offset++] = pnum[i]>>8;
370  pat->pesdata()[offset++] = pnum[i] & 0xff;
371  // pid
372  pat->pesdata()[offset++] = ((pid[i]>>8) & 0x1f) | 0xe0;
373  pat->pesdata()[offset++] = pid[i] & 0xff;
374  }
375 
376  pat->Finalize();
377 
378  return pat;
379 }
380 
382 {
383  ProgramMapTable *pmt = nullptr;
385  auto *dst = tspacket->data() + sizeof(TSHeader) + 1; /* start of field pointer */
386  std::copy(DEFAULT_PMT_HEADER.cbegin(), DEFAULT_PMT_HEADER.cend(), dst);
387 
388  if (smallPacket)
389  {
390  PSIPTable psip = PSIPTable::View(*tspacket);
391  psip.SetLength(len_for_alloc[0]);
392  pmt = new ProgramMapTable(psip);
393  }
394  else
395  {
396  PSIPTable psip(*tspacket);
397  psip.SetLength(len_for_alloc[1]);
398  pmt = new ProgramMapTable(psip);
399  }
400 
401  pmt->SetTotalLength(DEFAULT_PMT_HEADER.size());
402  delete tspacket;
403  return pmt;
404 }
405 
407  uint programNumber, uint basepid, uint pcrpid, uint version,
408  vector<uint> pids, vector<uint> types)
409 {
410  const uint count = min(pids.size(), types.size());
411  ProgramMapTable* pmt = CreateBlank(false);
412  pmt->tsheader()->SetPID(basepid);
413 
414  pmt->RemoveAllStreams();
415  pmt->SetProgramNumber(programNumber);
416  pmt->SetPCRPID(pcrpid);
418 
419  for (uint i=0; i<count; i++)
420  pmt->AppendStream(pids[i], types[i]);
421  pmt->Finalize();
422 
423  return pmt;
424 }
425 
427  uint programNumber, uint basepid, uint pcrpid, uint version,
428  const desc_list_t &global_desc,
429  const vector<uint> &pids,
430  const vector<uint> &types,
431  const vector<desc_list_t> &prog_desc)
432 {
433  const uint count = min(pids.size(), types.size());
434  ProgramMapTable* pmt = CreateBlank(false);
435  pmt->tsheader()->SetPID(basepid);
436 
437  pmt->RemoveAllStreams();
438  pmt->SetProgramNumber(programNumber);
439  pmt->SetPCRPID(pcrpid);
441 
442  vector<unsigned char> gdesc;
443  for (const auto *gd : global_desc)
444  {
445  uint len = gd[1] + 2;
446  gdesc.insert(gdesc.end(), gd, gd + len);
447  }
448  pmt->SetProgramInfo(gdesc.data(), gdesc.size());
449 
450  for (uint i = 0; i < count; i++)
451  {
452  vector<unsigned char> pdesc;
453  for (const auto *pd : prog_desc[i])
454  {
455  uint len = pd[1] + 2;
456  pdesc.insert(pdesc.end(), pd, pd + len);
457  }
458 
459  pmt->AppendStream(pids[i], types[i], pdesc.data(), pdesc.size());
460  }
461  pmt->Finalize();
462 
463  LOG(VB_SIPARSER, LOG_INFO, "Created PMT \n" + pmt->toString());
464 
465  return pmt;
466 }
467 
469 {
470  m_ptrs.clear();
471  const unsigned char *cpos = psipdata() + kPmtHeaderMinOffset + ProgramInfoLength();
472  auto *pos = const_cast<unsigned char*>(cpos);
473  for (uint i = 0; pos < psipdata() + Length() - 9; i++)
474  {
475  m_ptrs.push_back(pos);
476  pos += 5 + StreamInfoLength(i);
477 #if 0
478  LOG(VB_SIPARSER, LOG_DEBUG, QString("Parsing PMT(0x%1) i(%2) len(%3)")
479  .arg((uint64_t)this, 0, 16) .arg(i) .arg(StreamInfoLength(i)));
480 #endif
481  }
482  m_ptrs.push_back(pos);
483 #if 0
484  LOG(VB_SIPARSER, LOG_DEBUG, QString("Parsed PMT(0x%1)\n%2")
485  .arg((uint64_t)this, 0, 16) .arg(toString()));
486 #endif
487 }
488 
490  uint pid, uint type,
491  unsigned char* streamInfo, uint infoLength)
492 {
493  if (!StreamCount())
495  memset(m_ptrs[StreamCount()], 0xff, 5);
496  SetStreamPID(StreamCount(), pid);
498  SetStreamProgramInfo(StreamCount(), streamInfo, infoLength);
501 }
502 
513 bool ProgramMapTable::IsVideo(uint i, const QString& sistandard) const
514 {
516  return true;
517 
520  uint stream_id = StreamID::Normalize(StreamType(i), list, sistandard);
521 
522  return StreamID::IsVideo(stream_id);
523 }
524 
535 bool ProgramMapTable::IsAudio(uint i, const QString& sistandard) const
536 {
538  return true;
539 
542  uint stream_id = StreamID::Normalize(StreamType(i), list, sistandard);
543 
544  return StreamID::IsAudio(stream_id);
545 }
546 
551 bool ProgramMapTable::IsEncrypted(const QString& sistandard) const
552 {
553  bool encrypted = IsProgramEncrypted();
554 
555  for (uint i = 0; !encrypted && i < StreamCount(); i++) {
556  /* Only check audio/video streams */
557  if (IsAudio(i,sistandard) || IsVideo(i,sistandard))
558  encrypted |= IsStreamEncrypted(i);
559  }
560 
561  return encrypted;
562 }
563 
568 {
571 
572  uint encrypted = 0;
573  QMap<uint,uint> encryption_system;
574  for (auto & desc : descs)
575  {
576  ConditionalAccessDescriptor cad(desc);
577  if (!cad.IsValid())
578  continue;
579  encryption_system[cad.PID()] = cad.SystemID();
580  encrypted |= cad.SystemID();
581 
582 #if 0
583  LOG(VB_GENERAL, LOG_INFO, "DTVsm: " + cad.toString());
584 #endif
585  }
586 
587  return encrypted != 0;
588 }
589 
596 {
599 
600  uint encrypted = 0;
601  QMap<uint,uint> encryption_system;
602  for (auto & desc : descs)
603  {
604  ConditionalAccessDescriptor cad(desc);
605  if (!cad.IsValid())
606  continue;
607  encryption_system[cad.PID()] = cad.SystemID();
608  encrypted |= cad.SystemID();
609 #if 0
610  LOG(VB_GENERAL, LOG_INFO, "DTVsm: " + cad.toString());
611 #endif
612  }
613 
614  return encrypted != 0;
615 }
616 
617 bool ProgramMapTable::IsStillPicture(const QString& sistandard) const
618 {
619  static constexpr unsigned char kStillPictureFlag = 0x01;
620 
621  for (uint i = 0; i < StreamCount(); i++)
622  {
623  if (IsVideo(i, sistandard))
624  {
625  return StreamInfoLength(i) > 2 &&
626  ((StreamInfo(i)[2] & kStillPictureFlag) != 0);
627  }
628  }
629  return false;
630 }
631 
632 
642  vector<uint> &pids,
643  const QString &sistandard) const
644 {
646  {
647  for (uint i=0; i < StreamCount(); i++)
648  if (type == StreamType(i))
649  pids.push_back(StreamPID(i));
650  }
651  else if (StreamID::AnyVideo == type)
652  {
653  for (uint i=0; i < StreamCount(); i++)
654  if (IsVideo(i, sistandard))
655  pids.push_back(StreamPID(i));
656  }
657  else if (StreamID::AnyAudio == type)
658  {
659  for (uint i=0; i < StreamCount(); i++)
660  if (IsAudio(i, sistandard))
661  pids.push_back(StreamPID(i));
662  }
663 
664  return pids.size();
665 }
666 
678  vector<uint> &pids,
679  vector<uint> &types,
680  const QString &sistandard,
681  bool normalize) const
682 {
683  uint pids_start = pids.size();
684 
686  {
687  for (uint i=0; i < StreamCount(); i++)
688  {
689  if (type == StreamType(i))
690  {
691  pids.push_back(StreamPID(i));
692  types.push_back(StreamType(i));
693  }
694  }
695  }
696  else if (StreamID::AnyVideo == type)
697  {
698  for (uint i=0; i < StreamCount(); i++)
699  {
700  if (IsVideo(i, sistandard))
701  {
702  pids.push_back(StreamPID(i));
703  types.push_back(StreamType(i));
704  }
705  }
706  }
707  else if (StreamID::AnyAudio == type)
708  {
709  for (uint i=0; i < StreamCount(); i++)
710  {
711  if (IsAudio(i, sistandard))
712  {
713  pids.push_back(StreamPID(i));
714  types.push_back(StreamType(i));
715  }
716  }
717  }
718 
719  if (!normalize)
720  return pids.size();
721 
722  for (size_t i = pids_start; i < pids.size(); i++)
723  {
724  int index = FindPID(pids[i]);
725  if (index >= 0)
726  {
729  types[i] = StreamID::Normalize(types[i], desc, sistandard);
730  }
731  }
732 
733  return pids.size();
734 }
735 
737 {
738  uint pid = desired_pid;
739  if (pid >= MPEG_NULL_PID)
740  pid = 0x20;
741 
742  while (FindPID(pid) != -1)
743  pid += 0x10;
744 
745  if (pid < MPEG_NULL_PID)
746  return pid;
747 
748  pid = desired_pid;
749  while (FindPID(pid) != -1)
750  pid += 1;
751 
752  if (pid < MPEG_NULL_PID)
753  return pid;
754 
755  pid = 0x20;
756  while (FindPID(pid) != -1)
757  pid += 1;
758 
759  return pid & 0x1fff;
760 }
761 
762 QString PSIPTable::toString(void) const
763 {
764  QString str;
765  str.append(QString(" PSIP tableID(0x%1) length(%2) extension(0x%3)\n")
766  .arg(TableID(), 0, 16).arg(Length())
767  .arg(TableIDExtension(), 0, 16));
768  str.append(QString(" version(%1) current(%2) "
769  "section(%3) last_section(%4)\n")
770  .arg(Version()).arg(static_cast<int>(IsCurrent()))
771  .arg(Section()).arg(LastSection()));
772  if ((TableID() >= TableID::MGT) && (TableID() <= TableID::SRM))
773  {
774  str.append(QString(" atsc_protocol_version(%1)\n")
776  }
777  return str;
778 }
779 
780 QString PSIPTable::toStringXML(uint indent_level) const
781 {
782  QString indent = xml_indent(indent_level);
783  return indent + "<PSIPSection " + XMLValues(indent_level + 1) + " />";
784 }
785 
786 QString PSIPTable::XMLValues(uint indent_level) const
787 {
788  QString indent = xml_indent(indent_level);
789 
790  QString str = QString(
791  R"(table_id="0x%1" length="%2")")
792  .arg(TableID(), 2, 16, QChar('0'))
793  .arg(Length());
794 
795  if (HasSectionNumber())
796  {
797  str += QString(R"( section="%4" last_section="%5")")
798  .arg(Section()).arg(LastSection());
799  }
800 
801  if ((TableID() >= TableID::MGT) && (TableID() <= TableID::SRM))
802  {
803  str += QString("\n%1version=\"%2\" current=\"%3\" "
804  "protocol_version=\"%4\" extension=\"0x%5\"")
805  .arg(indent)
806  .arg(Version()).arg(xml_bool_to_string(IsCurrent()))
807  .arg(ATSCProtocolVersion())
808  .arg(TableIDExtension(), 0, 16);
809  }
810 
811  return str;
812 }
813 
815 {
816  QString str;
817  str.append(QString("Program Association Section\n"));
818  str.append(PSIPTable::toString());
819  str.append(QString(" tsid(%1) ").arg(TransportStreamID()));
820  str.append(QString("programCount(%1)\n").arg(ProgramCount()));
821 
822  uint cnt0 = 0;
823  uint cnt1fff = 0;
824  for (uint i = 0; i < ProgramCount(); i++)
825  {
826  if (0x1fff == ProgramPID(i))
827  {
828  cnt1fff++;
829  continue;
830  }
831 
832  if (0x0 == ProgramPID(i))
833  {
834  cnt0++;
835  continue;
836  }
837 
838  str += QString(" program number %1 has PID 0x%2\n")
839  .arg(ProgramNumber(i),5)
840  .arg(ProgramPID(i),4,16,QChar('0'));
841  }
842 
843  if (cnt0 || cnt1fff)
844  {
845  str.append(QString(" also contains %1 dummy programs\n")
846  .arg(cnt0 + cnt1fff));
847  }
848 
849  return str;
850 }
851 
852 QString ProgramAssociationTable::toStringXML(uint indent_level) const
853 {
854  QString indent_0 = xml_indent(indent_level);
855  QString indent_1 = xml_indent(indent_level + 1);
856 
857  QString str = QString(
858  "%1<ProgramAssociationSection tsid=\"0x%2\" program_count=\"%3\""
859  "\n%4%5>\n")
860  .arg(indent_0)
861  .arg(TransportStreamID(),4,16,QChar('0'))
862  .arg(ProgramCount())
863  .arg(indent_1)
864  .arg(PSIPTable::XMLValues(indent_level + 1));
865 
866  for (uint i = 0; i < ProgramCount(); i++)
867  {
868  bool dummy = (0x1fff == ProgramPID(i)) || (0x0 == ProgramPID(i));
869  str += QString("%1<Program number=\"%2\" pid=\"0x%3\" %4/>\n")
870  .arg(indent_1)
871  .arg(ProgramNumber(i))
872  .arg(ProgramPID(i),4,16,QChar('0'))
873  .arg(dummy ? "comment=\"Dummy Program\" " : "");
874  }
875 
876  return str + indent_0 + "</ProgramAssociationSection>";
877 }
878 
879 QString ProgramMapTable::toString(void) const
880 {
881  QString str =
882  QString("Program Map Section"
883  "\n%1"
884  " pnum(%2) pid(0x%3) pcrpid(0x%4)\n")
885  .arg(PSIPTable::toString())
886  .arg(ProgramNumber())
887  .arg(tsheader()->PID(),0,16)
888  .arg(PCRPID(),0,16);
889 
890  vector<const unsigned char*> desc =
892  for (auto & d : desc)
893  {
894  str.append(QString(" %1\n")
895  .arg(MPEGDescriptor(d, 300).toString()));
896  }
897 
898  for (uint i = 0; i < StreamCount(); i++)
899  {
900  str.append(QString(" Stream #%1 pid(0x%2) type(0x%3 %4)\n")
901  .arg(i).arg(StreamPID(i), 0, 16)
902  .arg(StreamType(i), 2, 16, QChar('0'))
903  .arg(StreamTypeString(i)));
905  for (auto & d : desc)
906  {
907  str.append(QString(" %1\n")
908  .arg(MPEGDescriptor(d, 300).toString()));
909  }
910  }
911  return str;
912 }
913 
914 QString ProgramMapTable::toStringXML(uint indent_level) const
915 {
916  QString indent_0 = xml_indent(indent_level);
917  QString indent_1 = xml_indent(indent_level + 1);
918 
919  QString str = QString(
920  "%1<ProgramMapSection pcr_pid=\"0x%2\" program_number=\"%3\"\n"
921  "%4program_info_length=\"%5\" stream_count=\"%7\"%8>\n")
922  .arg(indent_0)
923  .arg(PCRPID(),0,16)
924  .arg(ProgramNumber())
925  .arg(indent_1)
926  .arg(ProgramInfoLength())
927  .arg(StreamCount())
928  .arg(PSIPTable::XMLValues(indent_level + 1));
929 
930  vector<const unsigned char*> gdesc =
932  for (auto & gd : gdesc)
933  {
934  str += MPEGDescriptor(gd, 300)
935  .toStringXML(indent_level + 1) + "\n";
936  }
937 
938  for (uint i = 0; i < StreamCount(); i++)
939  {
940  str += QString("%1<Stream pid=\"0x%2\" type=\"0x%3\" "
941  "type_desc=\"%4\" stream_info_length=\"%5\"")
942  .arg(indent_1)
943  .arg(StreamPID(i),2,16,QChar('0'))
944  .arg(StreamType(i),2,16,QChar('0'))
945  .arg(StreamTypeString(i))
946  .arg(StreamInfoLength(i));
947  vector<const unsigned char*> ldesc =
949  str += (ldesc.empty()) ? " />\n" : ">\n";
950  for (auto & ld : ldesc)
951  {
952  str += MPEGDescriptor(ld, 300)
953  .toStringXML(indent_level + 2) + "\n";
954  }
955  if (!ldesc.empty())
956  str += indent_1 + "</Stream>\n";
957  }
958 
959  return str + indent_0 + "</ProgramMapSection>";
960 }
961 
962 const char *StreamID::toString(uint streamID)
963 {
964  // valid for some ATSC/DVB stuff too
965  switch (streamID)
966  {
968  return "video-mpeg2";
970  return "video-mpeg1";
972  return "video-mpeg4";
973  case StreamID::H264Video:
974  return "video-h264";
975  case StreamID::H265Video:
976  return "video-h265";
978  return "video-opencable";
979 
980  // audio
981  case StreamID::AC3Audio:
982  return "audio-ac3"; // EIT, PMT
983  case StreamID::EAC3Audio:
984  return "audio-eac3"; // EIT, PMT
986  return "audio-mp2-layer[1,2,3]"; // EIT, PMT
988  return "audio-mp1-layer[1,2,3]"; // EIT, PMT
990  return "audio-aac-latm"; // EIT, PMT
992  return "audio-aac"; // EIT, PMT
993  case StreamID::DTSAudio:
994  return "audio-dts"; // EIT, PMT
995 
996  // other
997  case StreamID::PrivSec:
998  return "private-sec";
999  case StreamID::PrivData:
1000  return "private-data";
1001 
1002  // DSMCC Object Carousel
1003  case StreamID::DSMCC_A:
1004  return "dsmcc-a encap";
1005  case StreamID::DSMCC_B:
1006  return "dsmcc-b std data";
1007  case StreamID::DSMCC_C:
1008  return "dsmcc-c NPD data";
1009  case StreamID::DSMCC_D:
1010  return "dsmcc-d data";
1011 
1012  // Can be in any MPEG stream ATSC, DVB, or ARIB ; but defined in SCTE 35
1013  case StreamID::Splice:
1014  return "splice"; // PMT
1015 
1016  //case TableID::STUFFING: XXX: Duplicate?
1017  // return "stuffing"; // optionally in any
1018  //case TableID::CENSOR: FIXME collides with StreamID::EAC3Audio
1019  // return "censor"; // EIT, optionally in PMT
1020  case TableID::ECN:
1021  return "extended channel name";
1022  case TableID::SRVLOC:
1023  return "service location"; // required in VCT
1024  case TableID::TSS: // other channels with same stuff
1025  return "time-shifted service";
1026  case TableID::CMPNAME:
1027  return "component name"; //??? PMT
1028  }
1029  return "unknown";
1030 }
1031 
1032 QString StreamID::GetDescription(uint stream_id)
1033 {
1034  // valid for some ATSC/DVB stuff too
1035  switch (stream_id)
1036  {
1037  // video
1038  case StreamID::MPEG1Video:
1039  return "11172-2 MPEG-1 Video";
1040  case StreamID::MPEG2Video:
1041  return "13818-2 MPEG-2 Video";
1042  case StreamID::MPEG4Video:
1043  return "14492-2 MPEG-4 Video";
1044  case StreamID::H264Video:
1045  return "H.264 Video";
1046  case StreamID::H265Video:
1047  return "H.265 Video";
1049  return "OpenCable Video";
1050  case StreamID::VC1Video:
1051  return "VC-1 Video";
1052 
1053  // audio
1054  case StreamID::MPEG1Audio:
1055  return "11172-2 MPEG-1 Audio";
1056  case StreamID::MPEG2Audio:
1057  return "13818-3 MPEG-2 Audio";
1059  return "13818-7 AAC MPEG-2 Audio";
1061  return "13818-3 AAC LATM MPEG-2 Audio";
1062  case StreamID::AC3Audio:
1063  return "AC3 Audio";
1064  case StreamID::EAC3Audio:
1065  return "E-AC3 Audio";
1066  case StreamID::DTSAudio:
1067  return "DTS Audio";
1068 
1069  // DSMCC Object Carousel
1070  case StreamID::DSMCC:
1071  return "13818-1 DSM-CC";
1072  case StreamID::DSMCC_A:
1073  return "13818-6 DSM-CC Type A";
1074  case StreamID::DSMCC_B:
1075  return "13818-6 DSM-CC Type B";
1076  case StreamID::DSMCC_C:
1077  return "13818-6 DSM-CC Type C";
1078  case StreamID::DSMCC_D:
1079  return "13818-6 DSM-CC Type D";
1080  case StreamID::DSMCC_DL:
1081  return "13818-6 Download";
1082  case StreamID::MetaDataPES:
1083  return "13818-6 Metadata in PES";
1084  case StreamID::MetaDataSec:
1085  return "13818-6 Metadata in Sections";
1086  case StreamID::MetaDataDC:
1087  return "13818-6 Metadata in Data Carousel";
1088  case StreamID::MetaDataOC:
1089  return "13818-6 Metadata in Obj Carousel";
1090  case StreamID::MetaDataDL:
1091  return "13818-6 Metadata in Download";
1092 
1093  // other
1094  case StreamID::PrivSec:
1095  return "13818-1 Private Sections";
1096  case StreamID::PrivData:
1097  return "13818-3 Private Data";
1098  case StreamID::MHEG:
1099  return "13522 MHEG";
1100  case StreamID::H222_1:
1101  return "ITU H.222.1";
1102  case StreamID::MPEG2Aux:
1103  return "13818-1 Aux & ITU H.222.0";
1104  case StreamID::FlexMuxPES:
1105  return "14496-1 SL/FlexMux in PES";
1106  case StreamID::FlexMuxSec:
1107  return "14496-1 SL/FlexMux in Sections";
1108  case StreamID::MPEG2IPMP:
1109  return "13818-10 IPMP";
1110  case StreamID::MPEG2IPMP2:
1111  return "13818-10 IPMP2";
1112 
1113  case AnyMask: return QString();
1114  case AnyVideo: return "video";
1115  case AnyAudio: return "audio";
1116  }
1117 
1118  return QString();
1119 }
1120 
1122 {
1123  const desc_list_t list = MPEGDescriptor::Parse(
1124  StreamInfo(i), StreamInfoLength(i));
1125  const unsigned char *lang_desc = MPEGDescriptor::Find(
1127 
1128  if (!lang_desc)
1129  return QString();
1130 
1131  ISO639LanguageDescriptor iso_lang(lang_desc);
1132  if (!iso_lang.IsValid())
1133  return "";
1134  return iso_lang.CanonicalLanguageString();
1135 }
1136 
1138 {
1139  const desc_list_t list = MPEGDescriptor::Parse(
1140  StreamInfo(i), StreamInfoLength(i));
1141  const unsigned char *lang_desc = MPEGDescriptor::Find(
1143 
1144  if (!lang_desc)
1145  return 0;
1146 
1147  ISO639LanguageDescriptor iso_lang(lang_desc);
1148  if (!iso_lang.IsValid())
1149  return 0;
1150 
1151  // Hack for non-standard AD labelling on UK Satellite and Irish DTTV
1152  // Language string of 'nar' for narrative indicates an AD track
1153  if (iso_lang.AudioType() == 0x0 &&
1154  iso_lang.LanguageString() == "nar")
1155  return 0x03;
1156 
1157  return iso_lang.AudioType();
1158 }
1159 
1160 QString ProgramMapTable::StreamDescription(uint i, const QString& sistandard) const
1161 {
1162  desc_list_t list;
1163 
1165  uint type = StreamID::Normalize(StreamType(i), list, sistandard);
1166  QString desc = StreamID::toString(type);
1167  QString lang = GetLanguage(i);
1168 
1169  if (!lang.isEmpty())
1170  desc += QString(" (%1)").arg(lang);
1171 
1172  return desc;
1173 }
1174 
1176 {
1177  QString str =
1178  QString("Conditional Access Section %1")
1179  .arg(PSIPTable::toString());
1180 
1181  vector<const unsigned char*> gdesc =
1183  for (auto & gd : gdesc)
1184  str += " " + MPEGDescriptor(gd, 300).toString() + "\n";
1185 
1186  return str;
1187 }
1188 
1189 QString ConditionalAccessTable::toStringXML(uint indent_level) const
1190 {
1191  QString indent_0 = xml_indent(indent_level);
1192 
1193  QString str =
1194  QString("%1<ConditionalAccessSection %3")
1195  .arg(indent_0)
1196  .arg(PSIPTable::XMLValues(indent_level + 1));
1197 
1198  vector<const unsigned char*> gdesc =
1200  str += (gdesc.empty()) ? " />\n" : ">\n";
1201  for (auto & gd : gdesc)
1202  {
1203  str += MPEGDescriptor(gd, 300)
1204  .toStringXML(indent_level + 1) + "\n";
1205  }
1206  if (!gdesc.empty())
1207  str += indent_0 + "</ConditionalAccessSection>\n";
1208 
1209  return str;
1210 }
1211 
1212 QString SpliceTimeView::toString(int64_t first, int64_t last) const
1213 {
1214  if (!IsTimeSpecified())
1215  return QString("splice_time(N/A)");
1216 
1217  int64_t abs_pts_time = PTSTime();
1218  if ((first > 0) && (last > 0))
1219  {
1220  int64_t elapsed = abs_pts_time - first;
1221  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1222  QTime abs = QTime(0,0,0,0).addMSecs(elapsed/90);
1223 
1224  elapsed = abs_pts_time - last; /* rel_pts_time */
1225  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1226  QTime rel = QTime(0,0,0,0).addMSecs(elapsed/90);
1227 
1228  return QString("splice_time(pts: %1 abs: %2, rel: +%3)")
1229  .arg(abs_pts_time)
1230  .arg(abs.toString("hh:mm:ss.zzz"))
1231  .arg(rel.toString("hh:mm:ss.zzz"));
1232  }
1233 
1234  return QString("splice_time(pts: %1)").arg(abs_pts_time);
1235 }
1236 
1238  uint indent_level, int64_t first, int64_t last) const
1239 {
1240  QString indent = xml_indent(indent_level);
1241 
1242  if (!IsTimeSpecified())
1243  return indent + "<SpliceTime />";
1244 
1245  int64_t abs_pts_time = PTSTime();
1246 
1247  QString abs_str;
1248  if (first > 0)
1249  {
1250  int64_t elapsed = abs_pts_time - first;
1251  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1252  QTime abs = QTime(0,0,0,0).addMSecs(elapsed/90);
1253  abs_str = QString("absolute=\"%1\" ")
1254  .arg(abs.toString("hh:mm:ss.zzz"));
1255  }
1256 
1257  QString rel_str;
1258  if (last > 0)
1259  {
1260  int64_t elapsed = abs_pts_time - last; /* rel_pts_time */
1261  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1262  QTime rel = QTime(0,0,0,0).addMSecs(elapsed/90);
1263  rel_str = QString("relative=\"+%1\" ")
1264  .arg(rel.toString("hh:mm:ss.zzz"));
1265  }
1266 
1267  return QString("%1<SpliceTime pts=\"%2\" %3%4/>")
1268  .arg(indent).arg(abs_pts_time).arg(abs_str).arg(rel_str);
1269 }
1270 
1273  const QString &/*codeWord*/)
1274 {
1275  // TODO
1276  return nullptr;
1277 }
1278 
1280 {
1281  m_epilog = nullptr;
1282  m_ptrs0.clear();
1283  m_ptrs1.clear();
1284 
1285  if (TableID::SITscte != TableID())
1286  return false;
1287 
1288  if (SpliceProtocolVersion() != 0)
1289  return false;
1290 
1291  if (IsEncryptedPacket())
1292  return true; // it's "parsed" but you can't read encrypted portion
1293 
1296  {
1297  m_epilog = pesdata() + 14;
1298  }
1299  else if (kSCTTimeSignal == type)
1300  {
1301  m_epilog = pesdata() + 14 + TimeSignal().size();
1302  }
1303  else if (kSCTSpliceSchedule == type)
1304  {
1305  uint splice_count = pesdata()[14];
1306  const unsigned char *cur = pesdata() + 15;
1307  for (uint i = 0; i < splice_count; i++)
1308  {
1309  m_ptrs0.push_back(cur);
1310  bool event_cancel = (cur[4] & 0x80) != 0;
1311  if (event_cancel)
1312  {
1313  m_ptrs1.push_back(nullptr);
1314  cur += 5;
1315  continue;
1316  }
1317  bool program_slice = (cur[5] & 0x40) != 0;
1318  uint component_count = cur[6];
1319  m_ptrs1.push_back(cur + (program_slice ? 10 : 7 * component_count));
1320  }
1321  if (splice_count)
1322  {
1323  bool duration = (m_ptrs0.back()[5] & 0x2) != 0;
1324  m_epilog = m_ptrs1.back() + ((duration) ? 9 : 4);
1325  }
1326  else
1327  {
1328  m_epilog = cur;
1329  }
1330  }
1331  else if (kSCTSpliceInsert == type)
1332  {
1333  m_ptrs1.push_back(pesdata() + 14);
1334  bool splice_cancel = (pesdata()[18] & 0x80) != 0;
1335  if (splice_cancel)
1336  {
1337  m_epilog = pesdata() + 19;
1338  }
1339  else
1340  {
1341  bool program_splice = (pesdata()[19] & 0x40) != 0;
1342  bool duration = (pesdata()[19] & 0x20) != 0;
1343  bool splice_immediate = (pesdata()[19] & 0x10) != 0;
1344  const unsigned char *cur = pesdata() + 20;
1345  if (program_splice && !splice_immediate)
1346  {
1347  cur += SpliceTimeView(cur).size();
1348  }
1349  else if (!program_splice)
1350  {
1351  uint component_count = pesdata()[20];
1352  cur = pesdata() + 21;
1353  for (uint i = 0; i < component_count; i++)
1354  {
1355  m_ptrs0.push_back(cur);
1356  cur += (splice_immediate) ?
1357  1 : 1 + SpliceTimeView(cur).size();
1358  }
1359  }
1360  m_ptrs1.push_back(cur);
1361  m_ptrs1.push_back(cur + (duration ? 5 : 0));
1362  }
1363  }
1364  else
1365  {
1366  m_epilog = nullptr;
1367  }
1368 
1369  return m_epilog != nullptr;
1370 }
1371 
1373 {
1374  uint alg = EncryptionAlgorithm();
1375  switch (alg)
1376  {
1377  case kNoEncryption: return "None";
1378  case kECB: return "DES-ECB";
1379  case kCBC: return "DES-CBC";
1380  case k3DES: return "3DES";
1381  default:
1382  return QString((alg<32) ? "Reserved(%1)" : "Private(%1)").arg(alg);
1383  }
1384 }
1385 
1387 {
1389  switch (type)
1390  {
1391  case kSCTNull:
1392  return "Null";
1393  case kSCTSpliceSchedule:
1394  return "SpliceSchedule";
1395  case kSCTSpliceInsert:
1396  return "SpliceInsert";
1397  case kSCTTimeSignal:
1398  return "TimeSignal";
1400  return "BandwidthReservation";
1401  case kSCTPrivateCommand:
1402  return "Private";
1403  default:
1404  return QString("Reserved(%1)").arg(type);
1405  };
1406 }
1407 
1408 QString SpliceInformationTable::toString(int64_t first, int64_t last) const
1409 {
1410  QString str =
1411  QString("SpliceInformationSection enc_alg(%1) pts_adj(%2)")
1413  .arg(PTSAdjustment());
1414  str += IsEncryptedPacket() ? QString(" cw_index(%1)") : QString("");
1415  str += QString(" command_len(%1) command_type(%2) scte_pid(0x%3)")
1416  .arg(SpliceCommandLength())
1418  .arg(getSCTEPID(), 0, 16));
1419 
1420  if (IsEncryptedPacket())
1421  return str;
1422 
1423  switch (SpliceCommandType())
1424  {
1425  case kSCTSpliceSchedule:
1426  break;
1427  case kSCTSpliceInsert:
1428  {
1429  str += "\n " + SpliceInsert().toString(first, last);
1430  break;
1431  }
1432  case kSCTTimeSignal:
1433  break;
1434  }
1435 
1436  return str;
1437 }
1438 
1439 QString SpliceInsertView::toString(int64_t first, int64_t last) const
1440 {
1441  QString str =
1442  QString("eventid(0x%1) cancel(%2) "
1443  "out_of_network(%3) program_splice(%4) "
1444  "duration(%5) immediate(%6)\n ")
1445  .arg(SpliceEventID(),0,16)
1446  .arg(IsSpliceEventCancel()?"yes":"no")
1447  .arg(IsOutOfNetwork()?"yes":"no")
1448  .arg(IsProgramSplice()?"yes":"no")
1449  .arg(IsDuration()?"yes":"no")
1450  .arg(IsSpliceImmediate()?"yes":"no");
1451 
1452  if (IsProgramSplice() && !IsSpliceImmediate())
1453  str += SpliceTime().toString(first, last);
1454 
1455  str += QString(" unique_program_id(%1)")
1456  .arg(UniqueProgramID());
1457 
1458  str += QString(" avail(%1/%2)")
1459  .arg(AvailNum()).arg(AvailsExpected());
1460 
1461  return str;
1462 }
1463 
1465  uint indent_level, int64_t first, int64_t last) const
1466 {
1467  QString indent = xml_indent(indent_level);
1468 
1469  QString cap_time = "";
1470  if (first >= 0)
1471  {
1472  cap_time = QString("pts=\"%1\" ").arg(first);
1473  if (last >= 0)
1474  {
1475  QTime abs = QTime(0,0,0,0).addMSecs((last - first)/90);
1476  cap_time += QString("capture_time=\"%1\" ")
1477  .arg(abs.toString("hh:mm:ss.zzz"));
1478  }
1479  }
1480 
1481  QString str = QString(
1482  "%1<SpliceInformationSection %2 encryption_algorithm=\"%3\" "
1483  "pts_adjustment=\"%4\" code_word_index=\"%5\" command_type=\"%6\" scte_pid=\"0x%7\" >\n")
1484  .arg(indent)
1485  .arg(cap_time)
1487  .arg(PTSAdjustment())
1488  .arg(CodeWordIndex())
1489  .arg(SpliceCommandTypeString())
1490  .arg(getSCTEPID(), 0 ,16);
1491 
1492  if (IsEncryptedPacket())
1493  return str + indent + "</SpliceInformationSection>";
1494 
1495  switch (SpliceCommandType())
1496  {
1497  case kSCTSpliceSchedule:
1498  break;
1499  case kSCTSpliceInsert:
1500  {
1501  str += SpliceInsert().toStringXML(indent_level + 1, first, last);
1502  str += "\n";
1503  break;
1504  }
1505  case kSCTTimeSignal:
1506  break;
1507  }
1508 
1509  str += indent + "</SpliceInformationSection>";
1510  return str;
1511 }
1512 
1514  uint indent_level, int64_t first, int64_t last) const
1515 {
1516  QString indent_0 = xml_indent(indent_level);
1517  QString indent_1 = xml_indent(indent_level + 1);
1518  QString str = QString(
1519  "%1<SpliceInsert eventid=\"0x%2\" cancel=\"%3\"\n")
1520  .arg(indent_0)
1521  .arg(SpliceEventID(),0,16)
1523 
1524  str += QString(
1525  "%1out_of_network=\"%2\" program_splice=\"%3\" duration=\"%4\"\n")
1526  .arg(indent_1)
1529  .arg(xml_bool_to_string(IsDuration()));
1530 
1531  str += QString(
1532  "%1immediate=\"%2\" unique_program_id=\"%3\"\n"
1533  "%4avail_num=\"%5\" avails_expected=\"%6\">\n")
1534  .arg(indent_1)
1536  .arg(UniqueProgramID())
1537  .arg(indent_1)
1538  .arg(AvailNum())
1539  .arg(AvailsExpected());
1540 
1541  if (IsProgramSplice() && !IsSpliceImmediate())
1542  {
1543  str += SpliceTime().toStringXML(indent_level + 1, first, last) + "\n";
1544  }
1545 
1546  str += indent_0 + "</SpliceInsert>";
1547  return str;
1548 }
ProgramMapTable::ProgramInfo
const unsigned char * ProgramInfo(void) const
Definition: mpegtables.h:727
MPEGDescriptor::toString
virtual QString toString(void) const
Definition: mpegdescriptors.cpp:418
PESPacket::m_pesData
unsigned char * m_pesData
Pointer to PES data in full buffer.
Definition: pespacket.h:220
ProgramMapTable::Parse
void Parse(void) const
Definition: mpegtables.cpp:468
ProgramAssociationTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:852
StreamID::VC1Video
@ VC1Video
SMPTE 421M video codec (aka VC1) in Blu-Ray.
Definition: mpegtables.h:121
len_for_alloc
static const std::array< const uint, 4 > len_for_alloc
Definition: mpegtables.cpp:39
ProgramAssociationTable::ProgramPID
uint ProgramPID(uint i) const
Definition: mpegtables.h:638
SpliceInsertView::UniqueProgramID
uint UniqueProgramID(void) const
Definition: mpegtables.h:1002
SpliceTimeView::toStringXML
virtual QString toStringXML(uint indent_level, int64_t first, int64_t last) const
Definition: mpegtables.cpp:1237
StreamID::MPEG2Video
@ MPEG2Video
ISO 13818-2 & ITU H.262 (aka MPEG-2)
Definition: mpegtables.h:116
DescriptorID::teletext
@ teletext
Definition: mpegdescriptors.h:96
ISO639LanguageDescriptor::CanonicalLanguageString
QString CanonicalLanguageString(void) const
Definition: mpegdescriptors.h:436
SpliceInformationTable::TimeSignal
SpliceTimeView TimeSignal(void) const
Definition: mpegtables.h:1144
copy
long long copy(QFile &dst, QFile &src, uint block_size)
Copies src file to dst file.
Definition: mythmiscutil.cpp:307
TableID::PF_EIT
@ PF_EIT
Definition: mpegtables.h:261
StreamID::MPEG2AACAudio
@ MPEG2AACAudio
ISO 13818-7 Audio w/ADTS syntax.
Definition: mpegtables.h:126
TableID::SRVLOC
@ SRVLOC
Definition: mpegtables.h:382
StreamID::MPEG1Audio
@ MPEG1Audio
ISO 11172-3.
Definition: mpegtables.h:124
StreamID::MetaDataDC
@ MetaDataDC
ISO 13818-6 Metadata in Data Carousel.
Definition: mpegtables.h:141
TableID::RST
@ RST
Definition: mpegtables.h:273
ProgramMapTable::StreamCount
uint StreamCount(void) const
Definition: mpegtables.h:742
TableID::ST
@ ST
Definition: mpegtables.h:274
ISO639LanguageDescriptor::AudioType
uint AudioType() const
Definition: mpegdescriptors.h:428
StreamID::MetaDataOC
@ MetaDataOC
ISO 13818-6 Metadata in Object Carousel.
Definition: mpegtables.h:142
ProgramAssociationTable::Create
static ProgramAssociationTable * Create(uint tsid, uint version, const vector< uint > &pnum, const vector< uint > &pid)
Definition: mpegtables.cpp:346
SpliceInsertView::SpliceTime
SpliceTimeView SpliceTime(void) const
Definition: mpegtables.h:987
SpliceInformationTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.h:1186
ProgramMapTable::kPmtHeaderMinOffset
static const uint kPmtHeaderMinOffset
Definition: mpegtables.h:839
TableID::MGT
@ MGT
Definition: mpegtables.h:350
TableID::STTscte
@ STTscte
Definition: mpegtables.h:332
TableID::SIT
@ SIT
Definition: mpegtables.h:282
ConditionalAccessTable::Descriptors
const unsigned char * Descriptors(void) const
Definition: mpegtables.h:872
PSIPTable::IsCurrent
bool IsCurrent(void) const
Definition: mpegtables.h:537
TableID::AETT
@ AETT
Definition: mpegtables.h:367
TableID::DN_EITendo
@ DN_EITendo
Definition: mpegtables.h:304
SpliceInformationTable::k3DES
@ k3DES
Definition: mpegtables.h:1062
TableID::DN_EITbego
@ DN_EITbego
Definition: mpegtables.h:303
PESPacket::SetTotalLength
void SetTotalLength(uint len)
Definition: pespacket.h:178
ProgramMapTable::SetProgramInfo
void SetProgramInfo(unsigned char *streamInfo, uint infoLength)
Definition: mpegtables.h:831
ProgramMapTable::StreamInfo
const unsigned char * StreamInfo(uint i) const
Definition: mpegtables.h:739
TableID::SDTo
@ SDTo
Definition: mpegtables.h:266
SpliceInformationTable::kSCTTimeSignal
@ kSCTTimeSignal
Definition: mpegtables.h:1114
TableID::DCCT
@ DCCT
Definition: mpegtables.h:363
StreamID::H222_1
@ H222_1
ITU H.222.1.
Definition: mpegtables.h:150
TableID::ECM0
@ ECM0
Definition: mpegtables.h:344
ProgramAssociationTable::SetTranportStreamID
void SetTranportStreamID(uint gtsid)
Definition: mpegtables.h:644
SpliceInformationTable::EncryptionAlgorithm
uint EncryptionAlgorithm(void) const
Definition: mpegtables.h:1066
PESPacket::pesdata
const unsigned char * pesdata() const
Definition: pespacket.h:166
ISO639LanguageDescriptor
Definition: mpegdescriptors.h:422
ProgramMapTable
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
Definition: mpegtables.h:685
SpliceInformationTable::EncryptionAlgorithmString
QString EncryptionAlgorithmString(void) const
Definition: mpegtables.cpp:1372
PESPacket::tsheader
const TSHeader * tsheader() const
Definition: pespacket.h:92
ProgramMapTable::FindPID
int FindPID(uint pid) const
Locates stream index of pid.
Definition: mpegtables.h:789
TableID::SRM
@ SRM
Definition: mpegtables.h:370
TableID::SVCTscte
@ SVCTscte
Definition: mpegtables.h:331
StreamID::DSMCC_DL
@ DSMCC_DL
ISO 13818-6 Download Protocol.
Definition: mpegtables.h:138
ProgramMapTable::PCRPID
uint PCRPID(void) const
stream that contains program clock reference.
Definition: mpegtables.h:718
TableID::CAT
@ CAT
Definition: mpegtables.h:254
SpliceInformationTable
Definition: mpegtables.h:1020
arg
arg(title).arg(filename).arg(doDelete))
DescriptorID::conditional_access
@ conditional_access
Definition: mpegdescriptors.h:34
desc_list_t
vector< const unsigned char * > desc_list_t
Definition: mpegdescriptors.h:19
ProgramMapTable::IsVideo
bool IsVideo(uint i, const QString &sistandard) const
Returns true iff the stream at index i is a video stream.
Definition: mpegtables.cpp:513
PESPacket::m_allocSize
uint m_allocSize
Total number of bytes we allocated.
Definition: pespacket.h:226
SpliceInformationTable::Parse
bool Parse(void)
Definition: mpegtables.cpp:1279
DescriptorID::iso_639_language
@ iso_639_language
Definition: mpegdescriptors.h:35
ProgramMapTable::CreateBlank
static ProgramMapTable * CreateBlank(bool smallPacket=true)
Definition: mpegtables.cpp:381
PESPacket::CalcCRC
uint CalcCRC(void) const
Definition: pespacket.cpp:145
x0
static int x0
Definition: mythsocket.cpp:59
StreamID::MetaDataDL
@ MetaDataDL
ISO 13818-6 Metadata in Download Protocol.
Definition: mpegtables.h:143
ProgramMapTable::ProgramNumber
uint ProgramNumber(void) const
Definition: mpegtables.h:721
SpliceInformationTable::toString
QString toString(void) const override
Definition: mpegtables.h:1184
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
SpliceInformationTable::kSCTSpliceSchedule
@ kSCTSpliceSchedule
Definition: mpegtables.h:1112
RegistrationDescriptor
Definition: mpegdescriptors.h:378
ProgramAssociationTable::ProgramCount
uint ProgramCount(void) const
Definition: mpegtables.h:628
TableID::DIT
@ DIT
Definition: mpegtables.h:281
PESPacket::StreamID
uint StreamID() const
Definition: pespacket.h:100
PSIPTable::ATSCProtocolVersion
uint ATSCProtocolVersion(void) const
Definition: mpegtables.h:547
PSIPTable::SetVersionNumber
void SetVersionNumber(uint ver)
Definition: mpegtables.h:565
ProgramMapTable::IsEncrypted
bool IsEncrypted(const QString &sistandard) const
Returns true iff PMT contains CA descriptor for a vid/aud stream.
Definition: mpegtables.cpp:551
TableID::NIT
@ NIT
Definition: mpegtables.h:259
TableID::BAT
@ BAT
Definition: mpegtables.h:267
TableID::ADET
@ ADET
Definition: mpegtables.h:337
StreamID::MetaDataPES
@ MetaDataPES
Meta data in PES packets.
Definition: mpegtables.h:139
DescriptorID::subtitling
@ subtitling
Definition: mpegdescriptors.h:99
SpliceInformationTable::kSCTSpliceInsert
@ kSCTSpliceInsert
Definition: mpegtables.h:1113
PSIPTable::kPsipOffset
static const uint kPsipOffset
Definition: mpegtables.h:583
ProgramMapTable::StreamTypeString
QString StreamTypeString(uint i) const
Returns a string representation of type at stream index i.
Definition: mpegtables.h:772
StreamID::PrivData
@ PrivData
ISO 13818-1 PES private data & ITU H.222.0.
Definition: mpegtables.h:147
PSIPTable::Section
uint Section(void) const
Definition: mpegtables.h:540
RegistrationDescriptor::FormatIdentifierString
QString FormatIdentifierString(void) const
Definition: mpegdescriptors.h:391
SpliceInformationTable::getSCTEPID
int getSCTEPID(void) const
Definition: mpegtables.h:1037
TableID::TOT
@ TOT
Definition: mpegtables.h:275
StreamID::IsVideo
static bool IsVideo(uint type)
Returns true iff video is an MPEG1/2/3, H264 or open cable video stream.
Definition: mpegtables.h:168
StreamID::AC3Audio
@ AC3Audio
A/53 Part 3:2009 6.7.1.
Definition: mpegtables.h:128
atscdescriptors.h
SpliceInformationTable::m_ptrs1
vector< const unsigned char * > m_ptrs1
Definition: mpegtables.h:1194
TableID::DCCSCT
@ DCCSCT
Definition: mpegtables.h:364
TableID::PF_EITo
@ PF_EITo
Definition: mpegtables.h:268
ConditionalAccessTable::DescriptorsLength
uint DescriptorsLength(void) const
Definition: mpegtables.h:870
SpliceInformationTable::SpliceProtocolVersion
uint SpliceProtocolVersion(void) const
Definition: mpegtables.h:1048
TableID::ECN
@ ECN
Definition: mpegtables.h:381
StreamID::H264Video
@ H264Video
ISO 14492-10 & ITU H.264 (aka MPEG-4-AVC)
Definition: mpegtables.h:118
TableID::SDT
@ SDT
Definition: mpegtables.h:260
SpliceInsertView::SpliceEventID
uint SpliceEventID(void) const
Definition: mpegtables.h:967
PSIPTable
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:399
StreamID::GetDescription
static QString GetDescription(uint stream_id)
Definition: mpegtables.cpp:1032
MPEGDescriptor::IsValid
bool IsValid(void) const
Definition: mpegdescriptors.h:341
PSIPTable::toString
virtual QString toString(void) const
Definition: mpegtables.cpp:762
TableID::ETT
@ ETT
Definition: mpegtables.h:355
SpliceInformationTable::kECB
@ kECB
Definition: mpegtables.h:1060
ProgramMapTable::IsStreamEncrypted
bool IsStreamEncrypted(uint pid) const
Returns true iff PMT contains CA descriptor.
Definition: mpegtables.cpp:595
ProgramMapTable::RemoveAllStreams
void RemoveAllStreams(void)
Definition: mpegtables.h:798
ProgramMapTable::StreamDescription
QString StreamDescription(uint i, const QString &sistandard) const
Returns a better (and more expensive) string representation of type at stream index i than StreamType...
Definition: mpegtables.cpp:1160
SpliceInsertView::IsSpliceImmediate
bool IsSpliceImmediate(void) const
Definition: mpegtables.h:983
StreamID::OpenCableVideo
@ OpenCableVideo
Always MPEG-2??
Definition: mpegtables.h:120
mythlogging.h
MPEGDescriptor::toStringXML
virtual QString toStringXML(uint indent_level) const
Returns XML representation of string the TS Reader XML format.
Definition: mpegdescriptors.cpp:672
ProgramAssociationTable::TransportStreamID
uint TransportStreamID(void) const
Definition: mpegtables.h:626
ProgramAssociationTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: mpegtables.h:635
splicedescriptors.h
MPEGDescriptor::Parse
static desc_list_t Parse(const unsigned char *data, uint len)
Definition: mpegdescriptors.cpp:15
ProgramMapTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:879
TableID::STT
@ STT
Definition: mpegtables.h:356
ConditionalAccessDescriptor::SystemID
uint SystemID(void) const
Definition: mpegdescriptors.h:414
PSIPTable::HasSectionNumber
bool HasSectionNumber(void) const
Definition: mpegtables.cpp:210
TableID::TVCT
@ TVCT
Definition: mpegtables.h:351
StreamID::MPEG2IPMP
@ MPEG2IPMP
ISO 13818-10 Digital Restrictions Mangment.
Definition: mpegtables.h:157
TableID::RRT
@ RRT
Definition: mpegtables.h:353
StreamID::IsAudio
static bool IsAudio(uint type)
Returns true iff audio is MPEG1/2, AAC, AC3 or DTS audio stream.
Definition: mpegtables.h:179
MPEGDescriptor
Definition: mpegdescriptors.h:302
TSPacket
Used to access the data of a Transport Stream packet.
Definition: tspacket.h:170
SpliceInformationTable::m_epilog
const unsigned char * m_epilog
Definition: mpegtables.h:1195
TableID::LTST
@ LTST
Definition: mpegtables.h:362
ProgramMapTable::StreamType
uint StreamType(uint i) const
Definition: mpegtables.h:730
ConditionalAccessTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:1175
DescriptorID::eac3
@ eac3
Definition: mpegdescriptors.h:134
ConditionalAccessDescriptor
Definition: mpegdescriptors.h:409
MPEGDescriptor::ParseOnlyInclude
static desc_list_t ParseOnlyInclude(const unsigned char *data, uint len, int excluded_descid)
Definition: mpegdescriptors.cpp:57
StreamID::MPEG2AudioAmd1
@ MPEG2AudioAmd1
ISO 13818-3/AMD-1 Audio using LATM syntax.
Definition: mpegtables.h:127
TableID::SC_EITbeg
@ SC_EITbeg
Definition: mpegtables.h:269
ProgramMapTable::FindUnusedPID
uint FindUnusedPID(uint desired_pid=0x20) const
Definition: mpegtables.cpp:736
ProgramAssociationTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:814
ProgramAssociationTable::CreateBlank
static ProgramAssociationTable * CreateBlank(bool smallPacket=true)
Definition: mpegtables.cpp:330
SpliceInsertView::AvailsExpected
uint AvailsExpected(void) const
Definition: mpegtables.h:1007
PSIPTable::toStringXML
virtual QString toStringXML(uint indent_level) const
Definition: mpegtables.cpp:780
SpliceInsertView::IsOutOfNetwork
bool IsOutOfNetwork(void) const
Definition: mpegtables.h:977
SpliceInformationTable::CodeWordIndex
uint CodeWordIndex(void) const
Definition: mpegtables.h:1092
PESPacket::Length
uint Length() const
Definition: pespacket.h:101
mpegtables.h
StreamID::MPEG1Video
@ MPEG1Video
ISO 11172-2 (aka MPEG-1)
Definition: mpegtables.h:115
ProgramMapTable::IsStillPicture
bool IsStillPicture(const QString &sistandard) const
Returns true iff PMT contains a still-picture video stream.
Definition: mpegtables.cpp:617
ProgramMapTable::SetStreamPID
void SetStreamPID(uint i, uint pid)
Definition: mpegtables.h:754
StreamID::FlexMuxSec
@ FlexMuxSec
ISO 14496-1 SL/FlexMux in 14496_sections.
Definition: mpegtables.h:155
SpliceInformationTable::SpliceCommandType
uint SpliceCommandType(void) const
Definition: mpegtables.h:1119
StreamID::DSMCC_A
@ DSMCC_A
ISO 13818-6 type A Multi-protocol Encap.
Definition: mpegtables.h:134
StreamID::H265Video
@ H265Video
ISO 23008-2 & ITU H.265 (aka HEVC, Ultra HD)
Definition: mpegtables.h:119
uint
unsigned int uint
Definition: compat.h:140
SpliceInformationTable::m_ptrs0
vector< const unsigned char * > m_ptrs0
Definition: mpegtables.h:1193
ProgramMapTable::FindPIDs
uint FindPIDs(uint type, vector< uint > &pids, const QString &sistandard) const
Finds all pids matching type.
Definition: mpegtables.cpp:641
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:608
StreamID::MetaDataSec
@ MetaDataSec
Meta data in metadata_section's.
Definition: mpegtables.h:140
TableID::EIT
@ EIT
Definition: mpegtables.h:354
TSPacket::CreatePayloadOnlyPacket
static TSPacket * CreatePayloadOnlyPacket(void)
Definition: tspacket.h:177
PSIPTable::LastSection
uint LastSection(void) const
Definition: mpegtables.h:543
StreamID::Splice
@ Splice
ANSI/SCTE 35 2007.
Definition: mpegtables.h:160
PSIPTable::HasCRC
bool HasCRC(void) const override
1 bit Cyclic Redundancy Check present
Definition: mpegtables.cpp:94
SpliceInsertView::IsSpliceEventCancel
bool IsSpliceEventCancel(void) const
Definition: mpegtables.h:973
ProgramMapTable::IsAudio
bool IsAudio(uint i, const QString &sistandard) const
Returns true iff the stream at index i is an audio stream.
Definition: mpegtables.cpp:535
TSPacket::kPayloadSize
static constexpr unsigned int kPayloadSize
Definition: tspacket.h:224
TableID::SITscte
@ SITscte
Definition: mpegtables.h:340
TableID::NITscte
@ NITscte
Definition: mpegtables.h:329
ISO639LanguageDescriptor::LanguageString
QString LanguageString(void) const
Definition: mpegdescriptors.h:432
ProgramMapTable::AppendStream
void AppendStream(uint pid, uint type, unsigned char *streamInfo=nullptr, uint infoLength=0)
Definition: mpegtables.cpp:489
ProgramMapTable::SetStreamProgramInfo
void SetStreamProgramInfo(uint i, unsigned char *streamInfo, uint infoLength)
Definition: mpegtables.h:817
PESPacket::Finalize
void Finalize()
Definition: pespacket.h:218
xml_bool_to_string
static QString xml_bool_to_string(bool val)
Definition: mythmiscutil.h:78
TableID::PMT
@ PMT
Definition: mpegtables.h:255
PSIPTable::VerifyPSIP
bool VerifyPSIP(bool verify_crc) const
Definition: mpegtables.cpp:236
PSIPTable::SectionLength
uint SectionLength(void) const
Definition: mpegtables.h:518
SpliceInformationTable::SpliceCommandLength
uint SpliceCommandLength(void) const
Definition: mpegtables.h:1096
TableID::NTT
@ NTT
Definition: mpegtables.h:330
StreamID::MPEG2IPMP2
@ MPEG2IPMP2
ISO 13818-10 Digital Restrictions Mangment.
Definition: mpegtables.h:158
ProgramMapTable::ProgramInfoLength
uint ProgramInfoLength(void) const
Definition: mpegtables.h:724
SpliceInformationTable::kNoEncryption
@ kNoEncryption
Definition: mpegtables.h:1059
mythmiscutil.h
PSIPTable::View
static PSIPTable View(const TSPacket &tspacket)
Definition: mpegtables.h:495
ProgramMapTable::SetPCRPID
void SetPCRPID(uint pid)
Definition: mpegtables.h:746
TableID::CMPNAME
@ CMPNAME
Definition: mpegtables.h:384
PESPacket::CRC
uint CRC(void) const
Definition: pespacket.h:191
SpliceInsertView::IsProgramSplice
bool IsProgramSplice(void) const
Definition: mpegtables.h:979
ProgramMapTable::SetProgramNumber
void SetProgramNumber(uint num)
Definition: mpegtables.h:752
StreamID::PrivSec
@ PrivSec
ISO 13818-1 private tables & ITU H.222.0.
Definition: mpegtables.h:146
SpliceInsertView::toStringXML
virtual QString toStringXML(uint indent_level, int64_t first, int64_t last) const
Definition: mpegtables.cpp:1513
StreamID::MPEG2Audio
@ MPEG2Audio
ISO 13818-3.
Definition: mpegtables.h:125
TableID::NRT
@ NRT
Definition: mpegtables.h:361
StreamID::toString
static const char * toString(uint streamID)
Definition: mpegtables.cpp:962
ProgramAssociationTable::ProgramAssociationTable
ProgramAssociationTable(const ProgramAssociationTable &table)
Definition: mpegtables.h:610
SpliceInsertView::AvailNum
uint AvailNum(void) const
Definition: mpegtables.h:1005
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:507
PSIPTable::TableIDExtension
uint TableIDExtension(void) const
Definition: mpegtables.h:524
TableID::SC_EITendo
@ SC_EITendo
Definition: mpegtables.h:272
StreamID::EAC3Audio
@ EAC3Audio
A/53 Part 3:2009 6.7.3.
Definition: mpegtables.h:129
StreamID::DTSAudio
@ DTSAudio
Definition: mpegtables.h:130
DEFAULT_PAT_HEADER
const std::array< const uint8_t, 8 > DEFAULT_PAT_HEADER
Definition: mpegtables.cpp:11
TSHeader::SetPID
void SetPID(unsigned int pid)
Definition: tspacket.h:141
SpliceTimeView::PTSTime
uint64_t PTSTime(void) const
Definition: mpegtables.h:889
TableID::DST
@ DST
Definition: mpegtables.h:358
ConditionalAccessTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:1189
TableID::AEIT
@ AEIT
Definition: mpegtables.h:366
SpliceTimeView::toString
virtual QString toString(int64_t first, int64_t last) const
Definition: mpegtables.cpp:1212
DescriptorID::registration
@ registration
Definition: mpegdescriptors.h:30
PESPacket::SetLength
void SetLength(uint len)
Definition: pespacket.h:173
xml_indent
QString xml_indent(uint level)
Definition: mythmiscutil.cpp:1005
SpliceInformationTable::PTSAdjustment
uint64_t PTSAdjustment(void) const
Definition: mpegtables.h:1074
StreamID::DSMCC_C
@ DSMCC_C
ISO 13818-6 type C NPT DSMCC Data.
Definition: mpegtables.h:136
TSHeader
Used to access header of a TSPacket.
Definition: tspacket.h:28
SpliceInformationTable::kSCTPrivateCommand
@ kSCTPrivateCommand
Definition: mpegtables.h:1117
StreamID::FlexMuxPES
@ FlexMuxPES
ISO 14496-1 SL/FlexMux in PES packets.
Definition: mpegtables.h:154
StreamID::MPEG4Video
@ MPEG4Video
ISO 14492-2 (aka MPEG-4)
Definition: mpegtables.h:117
TableID::TSS
@ TSS
Definition: mpegtables.h:383
DescriptorID::ac3
@ ac3
Definition: mpegdescriptors.h:117
ProgramMapTable::SetStreamType
void SetStreamType(uint i, uint type)
Definition: mpegtables.h:760
SpliceInformationTable::kCBC
@ kCBC
Definition: mpegtables.h:1061
ConditionalAccessDescriptor::toString
QString toString() const override
Definition: mpegdescriptors.cpp:818
PSIPTable::XMLValues
QString XMLValues(uint indent_level) const
Definition: mpegtables.cpp:786
SpliceTimeView
Definition: mpegtables.h:881
StreamID::DSMCC_B
@ DSMCC_B
ISO 13818-6 type B Std DSMCC Data.
Definition: mpegtables.h:135
PESPacket::m_fullBuffer
unsigned char * m_fullBuffer
Pointer to allocated data.
Definition: pespacket.h:221
TableID::NITo
@ NITo
Definition: mpegtables.h:265
StreamID::DSMCC
@ DSMCC
ISO 13818-1 Annex A DSM-CC & ITU H.222.0.
Definition: mpegtables.h:133
SpliceInformationTable::SpliceCommandTypeString
QString SpliceCommandTypeString(void) const
Definition: mpegtables.cpp:1386
ProgramMapTable::GetAudioType
uint GetAudioType(uint i) const
Returns the audio type from the iso 639 descriptor.
Definition: mpegtables.cpp:1137
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
SpliceInformationTable::kSCTNull
@ kSCTNull
Definition: mpegtables.h:1108
TableID::SVCT
@ SVCT
Definition: mpegtables.h:368
ProgramMapTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:914
ProgramMapTable::StreamInfoLength
uint StreamInfoLength(uint i) const
Definition: mpegtables.h:736
StreamID::Normalize
static uint Normalize(uint stream_id, const desc_list_t &desc, const QString &sistandard)
Definition: mpegtables.cpp:46
StreamID::MHEG
@ MHEG
ISO 13522 MHEG.
Definition: mpegtables.h:149
MPEGDescriptor::Find
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
Definition: mpegdescriptors.cpp:78
ProgramMapTable::GetLanguage
QString GetLanguage(uint i) const
Returns the canonical language if we find the iso639 descriptor.
Definition: mpegtables.cpp:1121
indent
static QString indent(uint level)
Definition: mythsettings.cpp:17
SpliceTimeView::IsTimeSpecified
bool IsTimeSpecified(void) const
Definition: mpegtables.h:885
TableID::DET
@ DET
Definition: mpegtables.h:357
ProgramMapTable::IsProgramEncrypted
bool IsProgramEncrypted(void) const
Returns true iff PMT's ProgramInfo contains CA descriptor.
Definition: mpegtables.cpp:567
SpliceInformationTable::SpliceInsert
SpliceInsertView SpliceInsert(void) const
Definition: mpegtables.h:1138
SpliceInsertView::IsDuration
bool IsDuration(void) const
Definition: mpegtables.h:981
SpliceTimeView::size
uint size(void) const
Definition: mpegtables.h:904
SpliceInformationTable::GetDecrypted
static SpliceInformationTable * GetDecrypted(const QString &codeWord)
Returns decrypted version of this packet.
Definition: mpegtables.cpp:1272
StreamID::MPEG2Aux
@ MPEG2Aux
ISO 13818-1 auxiliary & ITU H.222.0.
Definition: mpegtables.h:152
ProgramMapTable::StreamPID
uint StreamPID(uint i) const
Definition: mpegtables.h:733
StreamID::AnyAudio
@ AnyAudio
Definition: mpegtables.h:165
SpliceInsertView::toString
virtual QString toString(int64_t first, int64_t last) const
Definition: mpegtables.cpp:1439
StreamID::AnyMask
@ AnyMask
Definition: mpegtables.h:163
nv_python_libs.bbciplayer.bbciplayer_api.version
string version
Definition: bbciplayer_api.py:81
TSHeader::data
const unsigned char * data(void) const
Definition: tspacket.h:155
ProgramMapTable::ProgramMapTable
ProgramMapTable(const ProgramMapTable &table)
Definition: mpegtables.h:688
TableID::CVCT
@ CVCT
Definition: mpegtables.h:352
StreamID::AnyVideo
@ AnyVideo
Definition: mpegtables.h:164
DEFAULT_PMT_HEADER
const std::array< const uint8_t, 12 > DEFAULT_PMT_HEADER
Definition: mpegtables.cpp:24
SpliceInformationTable::IsEncryptedPacket
bool IsEncryptedPacket(void) const
Definition: mpegtables.h:1051
TableID::ECMend
@ ECMend
Definition: mpegtables.h:347
PSIPTable::Version
uint Version(void) const
Definition: mpegtables.h:531
ProgramMapTable::m_ptrs
vector< unsigned char * > m_ptrs
Definition: mpegtables.h:840
ProgramMapTable::Create
static ProgramMapTable * Create(uint programNumber, uint basepid, uint pcrpid, uint version, vector< uint > pids, vector< uint > types)
Definition: mpegtables.cpp:406
TableID::TDT
@ TDT
Definition: mpegtables.h:262
ConditionalAccessDescriptor::PID
uint PID(void) const
Definition: mpegdescriptors.h:415
StreamID::DSMCC_D
@ DSMCC_D
ISO 13818-6 type D Any DSMCC Data.
Definition: mpegtables.h:137
PSIPTable::psipdata
const unsigned char * psipdata(void) const
Definition: mpegtables.h:550
TableID::PAT
@ PAT
Definition: mpegtables.h:253
MPEG_NULL_PID
@ MPEG_NULL_PID
The all-ones PID value 0x1FFF indicates a Null TS Packet introduced to maintain a constant bit rate o...
Definition: mpegtables.h:236
SpliceInformationTable::kSCTBandwidthReservation
@ kSCTBandwidthReservation
Definition: mpegtables.h:1115