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