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 mandatory
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 {
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 std::vector<uint>& pnum, const std::vector<uint>& pid)
349 {
350  const uint count = std::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  std::vector<uint> pids, std::vector<uint> types)
409 {
410  const uint count = std::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 std::vector<uint> &pids,
430  const std::vector<uint> &types,
431  const std::vector<desc_list_t> &prog_desc)
432 {
433  const uint count = std::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  std::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  std::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 &&
627  ((StreamInfo(i)[2] & kStillPictureFlag) != 0);
628  }
629  }
630  return false;
631 }
632 
633 
643  std::vector<uint> &pids,
644  const QString &sistandard) const
645 {
647  {
648  for (uint i=0; i < StreamCount(); i++)
649  if (type == StreamType(i))
650  pids.push_back(StreamPID(i));
651  }
652  else if (StreamID::AnyVideo == type)
653  {
654  for (uint i=0; i < StreamCount(); i++)
655  if (IsVideo(i, sistandard))
656  pids.push_back(StreamPID(i));
657  }
658  else if (StreamID::AnyAudio == type)
659  {
660  for (uint i=0; i < StreamCount(); i++)
661  if (IsAudio(i, sistandard))
662  pids.push_back(StreamPID(i));
663  }
664 
665  return pids.size();
666 }
667 
679  std::vector<uint> &pids,
680  std::vector<uint> &types,
681  const QString &sistandard,
682  bool normalize) const
683 {
684  uint pids_start = pids.size();
685 
687  {
688  for (uint i=0; i < StreamCount(); i++)
689  {
690  if (type == StreamType(i))
691  {
692  pids.push_back(StreamPID(i));
693  types.push_back(StreamType(i));
694  }
695  }
696  }
697  else if (StreamID::AnyVideo == type)
698  {
699  for (uint i=0; i < StreamCount(); i++)
700  {
701  if (IsVideo(i, sistandard))
702  {
703  pids.push_back(StreamPID(i));
704  types.push_back(StreamType(i));
705  }
706  }
707  }
708  else if (StreamID::AnyAudio == type)
709  {
710  for (uint i=0; i < StreamCount(); i++)
711  {
712  if (IsAudio(i, sistandard))
713  {
714  pids.push_back(StreamPID(i));
715  types.push_back(StreamType(i));
716  }
717  }
718  }
719 
720  if (!normalize)
721  return pids.size();
722 
723  for (size_t i = pids_start; i < pids.size(); i++)
724  {
725  int index = FindPID(pids[i]);
726  if (index >= 0)
727  {
730  types[i] = StreamID::Normalize(types[i], desc, sistandard);
731  }
732  }
733 
734  return pids.size();
735 }
736 
738 {
739  uint pid = desired_pid;
740  if (pid >= PID::MPEG_NULL_PID)
741  pid = 0x20;
742 
743  while (FindPID(pid) != -1)
744  pid += 0x10;
745 
746  if (pid < PID::MPEG_NULL_PID)
747  return pid;
748 
749  pid = desired_pid;
750  while (FindPID(pid) != -1)
751  pid += 1;
752 
753  if (pid < PID::MPEG_NULL_PID)
754  return pid;
755 
756  pid = 0x20;
757  while (FindPID(pid) != -1)
758  pid += 1;
759 
760  return pid & 0x1fff;
761 }
762 
763 QString PSIPTable::toString(void) const
764 {
765  QString str;
766  str.append(QString(" PSIP tableID(0x%1) length(%2) extension(0x%3)\n")
767  .arg(TableID(), 0, 16).arg(Length())
768  .arg(TableIDExtension(), 0, 16));
769  str.append(QString(" version(%1) current(%2) "
770  "section(%3) last_section(%4)\n")
771  .arg(Version()).arg(static_cast<int>(IsCurrent()))
772  .arg(Section()).arg(LastSection()));
773  if ((TableID() >= TableID::MGT) && (TableID() <= TableID::SRM))
774  {
775  str.append(QString(" atsc_protocol_version(%1)\n")
776  .arg(ATSCProtocolVersion()));
777  }
778  return str;
779 }
780 
781 QString PSIPTable::toStringXML(uint indent_level) const
782 {
783  QString indent = StringUtil::indentSpaces(indent_level);
784  return indent + "<PSIPSection " + XMLValues(indent_level + 1) + " />";
785 }
786 
787 QString PSIPTable::XMLValues(uint indent_level) const
788 {
789  QString indent = StringUtil::indentSpaces(indent_level);
790 
791  QString str = QString(
792  R"(table_id="0x%1" length="%2")")
793  .arg(TableID(), 2, 16, QChar('0'))
794  .arg(Length());
795 
796  if (HasSectionNumber())
797  {
798  str += QString(R"( section="%4" last_section="%5")")
799  .arg(Section()).arg(LastSection());
800  }
801 
802  if ((TableID() >= TableID::MGT) && (TableID() <= TableID::SRM))
803  {
804  str += QString("\n%1version=\"%2\" current=\"%3\" "
805  "protocol_version=\"%4\" extension=\"0x%5\"")
806  .arg(indent)
808  .arg(ATSCProtocolVersion())
809  .arg(TableIDExtension(), 0, 16);
810  }
811 
812  return str;
813 }
814 
816 {
817  QString str;
818  str.append(QString("Program Association Section\n"));
819  str.append(PSIPTable::toString());
820  str.append(QString(" tsid(%1) ").arg(TransportStreamID()));
821  str.append(QString("programCount(%1)\n").arg(ProgramCount()));
822 
823  uint cnt0 = 0;
824  uint cnt1fff = 0;
825  for (uint i = 0; i < ProgramCount(); i++)
826  {
827  if (0x1fff == ProgramPID(i))
828  {
829  cnt1fff++;
830  continue;
831  }
832 
833  if (0x0 == ProgramPID(i))
834  {
835  cnt0++;
836  continue;
837  }
838 
839  str += QString(" program number %1 has PID 0x%2\n")
840  .arg(ProgramNumber(i),5)
841  .arg(ProgramPID(i),4,16,QChar('0'));
842  }
843 
844  if (cnt0 || cnt1fff)
845  {
846  str.append(QString(" also contains %1 dummy programs\n")
847  .arg(cnt0 + cnt1fff));
848  }
849 
850  return str;
851 }
852 
853 QString ProgramAssociationTable::toStringXML(uint indent_level) const
854 {
855  QString indent_0 = StringUtil::indentSpaces(indent_level);
856  QString indent_1 = StringUtil::indentSpaces(indent_level + 1);
857 
858  QString str = QString(
859  "%1<ProgramAssociationSection tsid=\"0x%2\" program_count=\"%3\""
860  "\n%4%5>\n")
861  .arg(indent_0)
862  .arg(TransportStreamID(),4,16,QChar('0'))
863  .arg(ProgramCount())
864  .arg(indent_1,
865  PSIPTable::XMLValues(indent_level + 1));
866 
867  for (uint i = 0; i < ProgramCount(); i++)
868  {
869  bool dummy = (0x1fff == ProgramPID(i)) || (0x0 == ProgramPID(i));
870  str += QString("%1<Program number=\"%2\" pid=\"0x%3\" %4/>\n")
871  .arg(indent_1)
872  .arg(ProgramNumber(i))
873  .arg(ProgramPID(i),4,16,QChar('0'))
874  .arg(dummy ? "comment=\"Dummy Program\" " : "");
875  }
876 
877  return str + indent_0 + "</ProgramAssociationSection>";
878 }
879 
880 QString ProgramMapTable::toString(void) const
881 {
882  QString str =
883  QString("Program Map Section"
884  "\n%1"
885  " pnum(%2) pid(0x%3) pcrpid(0x%4)")
886  .arg(PSIPTable::toString())
887  .arg(ProgramNumber())
888  .arg(tsheader()->PID(),0,16)
889  .arg(PCRPID(),0,16);
890 
891  std::vector<const unsigned char*> desc =
893  for (auto & d : desc)
894  {
895  str.append(QString("\n %1")
896  .arg(MPEGDescriptor(d, 300).toString()));
897  }
898 
899  for (uint i = 0; i < StreamCount(); i++)
900  {
901  str.append(QString("\n Stream #%1 pid(0x%2) type(0x%3 %4)")
902  .arg(i).arg(StreamPID(i), 0, 16)
903  .arg(StreamType(i), 2, 16, QChar('0'))
904  .arg(StreamTypeString(i)));
906  for (auto & d : desc)
907  {
908  str.append(QString("\n %1")
909  .arg(MPEGDescriptor(d, 300).toString()));
910  }
911  }
912  return str;
913 }
914 
915 QString ProgramMapTable::toStringXML(uint indent_level) const
916 {
917  QString indent_0 = StringUtil::indentSpaces(indent_level);
918  QString indent_1 = StringUtil::indentSpaces(indent_level + 1);
919 
920  QString str = QString(
921  "%1<ProgramMapSection pcr_pid=\"0x%2\" program_number=\"%3\"\n"
922  "%4program_info_length=\"%5\" stream_count=\"%7\"%8>\n")
923  .arg(indent_0)
924  .arg(PCRPID(),0,16)
925  .arg(ProgramNumber())
926  .arg(indent_1)
927  .arg(ProgramInfoLength())
928  .arg(StreamCount())
929  .arg(PSIPTable::XMLValues(indent_level + 1));
930 
931  std::vector<const unsigned char*> gdesc =
933  for (auto & gd : gdesc)
934  {
935  str += MPEGDescriptor(gd, 300)
936  .toStringXML(indent_level + 1) + "\n";
937  }
938 
939  for (uint i = 0; i < StreamCount(); i++)
940  {
941  str += QString("%1<Stream pid=\"0x%2\" type=\"0x%3\" "
942  "type_desc=\"%4\" stream_info_length=\"%5\"")
943  .arg(indent_1)
944  .arg(StreamPID(i),2,16,QChar('0'))
945  .arg(StreamType(i),2,16,QChar('0'))
946  .arg(StreamTypeString(i))
947  .arg(StreamInfoLength(i));
948  std::vector<const unsigned char*> ldesc =
950  str += (ldesc.empty()) ? " />\n" : ">\n";
951  for (auto & ld : ldesc)
952  {
953  str += MPEGDescriptor(ld, 300)
954  .toStringXML(indent_level + 2) + "\n";
955  }
956  if (!ldesc.empty())
957  str += indent_1 + "</Stream>\n";
958  }
959 
960  return str + indent_0 + "</ProgramMapSection>";
961 }
962 
963 const char *StreamID::toString(uint streamID)
964 {
965  // valid for some ATSC/DVB stuff too
966  switch (streamID)
967  {
969  return "video-mpeg2";
971  return "video-mpeg1";
973  return "video-mpeg4";
974  case StreamID::H264Video:
975  return "video-h264";
976  case StreamID::H265Video:
977  return "video-h265";
979  return "video-opencable";
980 
981  // audio
982  case StreamID::AC3Audio:
983  return "audio-ac3"; // EIT, PMT
984  case StreamID::EAC3Audio:
985  return "audio-eac3"; // EIT, PMT
987  return "audio-mp2-layer[1,2,3]"; // EIT, PMT
989  return "audio-mp1-layer[1,2,3]"; // EIT, PMT
991  return "audio-aac-latm"; // EIT, PMT
993  return "audio-aac"; // EIT, PMT
994  case StreamID::DTSAudio:
995  return "audio-dts"; // EIT, PMT
996 
997  // other
998  case StreamID::PrivSec:
999  return "private-sec";
1000  case StreamID::PrivData:
1001  return "private-data";
1002 
1003  // DSMCC Object Carousel
1004  case StreamID::DSMCC_A:
1005  return "dsmcc-a encap";
1006  case StreamID::DSMCC_B:
1007  return "dsmcc-b std data";
1008  case StreamID::DSMCC_C:
1009  return "dsmcc-c NPD data";
1010  case StreamID::DSMCC_D:
1011  return "dsmcc-d data";
1012 
1013  // Can be in any MPEG stream ATSC, DVB, or ARIB ; but defined in SCTE 35
1014  case StreamID::Splice:
1015  return "splice"; // PMT
1016 
1017  //case TableID::STUFFING: XXX: Duplicate?
1018  // return "stuffing"; // optionally in any
1019  //case TableID::CENSOR: FIXME collides with StreamID::EAC3Audio
1020  // return "censor"; // EIT, optionally in PMT
1021  case TableID::ECN:
1022  return "extended channel name";
1023  case TableID::SRVLOC:
1024  return "service location"; // required in VCT
1025  case TableID::TSS: // other channels with same stuff
1026  return "time-shifted service";
1027  case TableID::CMPNAME:
1028  return "component name"; //??? PMT
1029  }
1030  return "unknown";
1031 }
1032 
1033 QString StreamID::GetDescription(uint stream_id)
1034 {
1035  // valid for some ATSC/DVB stuff too
1036  switch (stream_id)
1037  {
1038  // video
1039  case StreamID::MPEG1Video:
1040  return "11172-2 MPEG-1 Video";
1041  case StreamID::MPEG2Video:
1042  return "13818-2 MPEG-2 Video";
1043  case StreamID::MPEG4Video:
1044  return "14492-2 MPEG-4 Video";
1045  case StreamID::H264Video:
1046  return "H.264 Video";
1047  case StreamID::H265Video:
1048  return "H.265 Video";
1050  return "OpenCable Video";
1051  case StreamID::VC1Video:
1052  return "VC-1 Video";
1053 
1054  // audio
1055  case StreamID::MPEG1Audio:
1056  return "11172-2 MPEG-1 Audio";
1057  case StreamID::MPEG2Audio:
1058  return "13818-3 MPEG-2 Audio";
1060  return "13818-7 AAC MPEG-2 Audio";
1062  return "13818-3 AAC LATM MPEG-2 Audio";
1063  case StreamID::AC3Audio:
1064  return "AC3 Audio";
1065  case StreamID::EAC3Audio:
1066  return "E-AC3 Audio";
1067  case StreamID::DTSAudio:
1068  return "DTS Audio";
1069 
1070  // DSMCC Object Carousel
1071  case StreamID::DSMCC:
1072  return "13818-1 DSM-CC";
1073  case StreamID::DSMCC_A:
1074  return "13818-6 DSM-CC Type A";
1075  case StreamID::DSMCC_B:
1076  return "13818-6 DSM-CC Type B";
1077  case StreamID::DSMCC_C:
1078  return "13818-6 DSM-CC Type C";
1079  case StreamID::DSMCC_D:
1080  return "13818-6 DSM-CC Type D";
1081  case StreamID::DSMCC_DL:
1082  return "13818-6 Download";
1083  case StreamID::MetaDataPES:
1084  return "13818-6 Metadata in PES";
1085  case StreamID::MetaDataSec:
1086  return "13818-6 Metadata in Sections";
1087  case StreamID::MetaDataDC:
1088  return "13818-6 Metadata in Data Carousel";
1089  case StreamID::MetaDataOC:
1090  return "13818-6 Metadata in Obj Carousel";
1091  case StreamID::MetaDataDL:
1092  return "13818-6 Metadata in Download";
1093 
1094  // other
1095  case StreamID::PrivSec:
1096  return "13818-1 Private Sections";
1097  case StreamID::PrivData:
1098  return "13818-3 Private Data";
1099  case StreamID::MHEG:
1100  return "13522 MHEG";
1101  case StreamID::H222_1:
1102  return "ITU H.222.1";
1103  case StreamID::MPEG2Aux:
1104  return "13818-1 Aux & ITU H.222.0";
1105  case StreamID::FlexMuxPES:
1106  return "14496-1 SL/FlexMux in PES";
1107  case StreamID::FlexMuxSec:
1108  return "14496-1 SL/FlexMux in Sections";
1109  case StreamID::MPEG2IPMP:
1110  return "13818-10 IPMP";
1111  case StreamID::MPEG2IPMP2:
1112  return "13818-10 IPMP2";
1113 
1114  case AnyMask: return {};
1115  case AnyVideo: return "video";
1116  case AnyAudio: return "audio";
1117  }
1118 
1119  return {};
1120 }
1121 
1123 {
1124  const desc_list_t list = MPEGDescriptor::Parse(
1125  StreamInfo(i), StreamInfoLength(i));
1126  const unsigned char *lang_desc = MPEGDescriptor::Find(
1128 
1129  if (!lang_desc)
1130  return {};
1131 
1132  ISO639LanguageDescriptor iso_lang(lang_desc);
1133  if (!iso_lang.IsValid())
1134  return "";
1135  return iso_lang.CanonicalLanguageString();
1136 }
1137 
1139 {
1140  const desc_list_t list = MPEGDescriptor::Parse(
1141  StreamInfo(i), StreamInfoLength(i));
1142  const unsigned char *lang_desc = MPEGDescriptor::Find(
1144 
1145  if (!lang_desc)
1146  return 0;
1147 
1148  ISO639LanguageDescriptor iso_lang(lang_desc);
1149  if (!iso_lang.IsValid())
1150  return 0;
1151 
1152  // Hack for non-standard AD labelling on UK Satellite and Irish DTTV
1153  // Language string of 'nar' for narrative indicates an AD track
1154  if (iso_lang.AudioType() == 0x0 &&
1155  iso_lang.LanguageString() == "nar")
1156  return 0x03;
1157 
1158  return iso_lang.AudioType();
1159 }
1160 
1161 QString ProgramMapTable::StreamDescription(uint i, const QString& sistandard) const
1162 {
1163  desc_list_t list;
1164 
1166  uint type = StreamID::Normalize(StreamType(i), list, sistandard);
1167  QString desc = StreamID::toString(type);
1168  QString lang = GetLanguage(i);
1169 
1170  if (!lang.isEmpty())
1171  desc += QString(" (%1)").arg(lang);
1172 
1173  return desc;
1174 }
1175 
1177 {
1178  QString str =
1179  QString("Conditional Access Section %1")
1180  .arg(PSIPTable::toString());
1181 
1182  std::vector<const unsigned char*> gdesc =
1184  for (auto & gd : gdesc)
1185  str += " " + MPEGDescriptor(gd, 300).toString() + "\n";
1186 
1187  return str;
1188 }
1189 
1190 QString ConditionalAccessTable::toStringXML(uint indent_level) const
1191 {
1192  QString indent_0 = StringUtil::indentSpaces(indent_level);
1193 
1194  QString str =
1195  QString("%1<ConditionalAccessSection %3")
1196  .arg(indent_0,
1197  PSIPTable::XMLValues(indent_level + 1));
1198 
1199  std::vector<const unsigned char*> gdesc =
1201  str += (gdesc.empty()) ? " />\n" : ">\n";
1202  for (auto & gd : gdesc)
1203  {
1204  str += MPEGDescriptor(gd, 300)
1205  .toStringXML(indent_level + 1) + "\n";
1206  }
1207  if (!gdesc.empty())
1208  str += indent_0 + "</ConditionalAccessSection>\n";
1209 
1210  return str;
1211 }
1212 
1213 QString SpliceTimeView::toString(int64_t first, int64_t last) const
1214 {
1215  if (!IsTimeSpecified())
1216  return {"splice_time(N/A)"};
1217 
1218  int64_t abs_pts_time = PTSTime();
1219  if ((first > 0) && (last > 0))
1220  {
1221  int64_t elapsed = abs_pts_time - first;
1222  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1223  QTime abs = QTime(0,0,0,0).addMSecs(elapsed/90);
1224 
1225  elapsed = abs_pts_time - last; /* rel_pts_time */
1226  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1227  QTime rel = QTime(0,0,0,0).addMSecs(elapsed/90);
1228 
1229  return QString("splice_time(pts: %1 abs: %2, rel: +%3)")
1230  .arg(QString::number(abs_pts_time),
1231  abs.toString("hh:mm:ss.zzz"),
1232  rel.toString("hh:mm:ss.zzz"));
1233  }
1234 
1235  return QString("splice_time(pts: %1)").arg(abs_pts_time);
1236 }
1237 
1239  uint indent_level, int64_t first, int64_t last) const
1240 {
1241  QString indent = StringUtil::indentSpaces(indent_level);
1242 
1243  if (!IsTimeSpecified())
1244  return indent + "<SpliceTime />";
1245 
1246  int64_t abs_pts_time = PTSTime();
1247 
1248  QString abs_str;
1249  if (first > 0)
1250  {
1251  int64_t elapsed = abs_pts_time - first;
1252  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1253  QTime abs = QTime(0,0,0,0).addMSecs(elapsed/90);
1254  abs_str = QString("absolute=\"%1\" ")
1255  .arg(abs.toString("hh:mm:ss.zzz"));
1256  }
1257 
1258  QString rel_str;
1259  if (last > 0)
1260  {
1261  int64_t elapsed = abs_pts_time - last; /* rel_pts_time */
1262  elapsed = (elapsed < 0) ? elapsed + 0x1000000000LL : elapsed;
1263  QTime rel = QTime(0,0,0,0).addMSecs(elapsed/90);
1264  rel_str = QString("relative=\"+%1\" ")
1265  .arg(rel.toString("hh:mm:ss.zzz"));
1266  }
1267 
1268  return QString("%1<SpliceTime pts=\"%2\" %3%4/>")
1269  .arg(indent,QString::number(abs_pts_time),abs_str,rel_str);
1270 }
1271 
1274  const QString &/*codeWord*/)
1275 {
1276  // TODO
1277  return nullptr;
1278 }
1279 
1281 {
1282  m_epilog = nullptr;
1283  m_ptrs0.clear();
1284  m_ptrs1.clear();
1285 
1286  if (TableID::SITscte != TableID())
1287  return false;
1288 
1289  if (SpliceProtocolVersion() != 0)
1290  return false;
1291 
1292  if (IsEncryptedPacket())
1293  return true; // it's "parsed" but you can't read encrypted portion
1294 
1297  {
1298  m_epilog = pesdata() + 14;
1299  }
1300  else if (kSCTTimeSignal == type)
1301  {
1302  m_epilog = pesdata() + 14 + TimeSignal().size();
1303  }
1304  else if (kSCTSpliceSchedule == type)
1305  {
1306  uint splice_count = pesdata()[14];
1307  const unsigned char *cur = pesdata() + 15;
1308  for (uint i = 0; i < splice_count; i++)
1309  {
1310  m_ptrs0.push_back(cur);
1311  bool event_cancel = (cur[4] & 0x80) != 0;
1312  if (event_cancel)
1313  {
1314  m_ptrs1.push_back(nullptr);
1315  cur += 5;
1316  continue;
1317  }
1318  bool program_slice = (cur[5] & 0x40) != 0;
1319  uint component_count = cur[6];
1320  m_ptrs1.push_back(cur + (program_slice ? 10 : 7 * component_count));
1321  }
1322  if (splice_count)
1323  {
1324  bool duration = (m_ptrs0.back()[5] & 0x2) != 0;
1325  m_epilog = m_ptrs1.back() + ((duration) ? 9 : 4);
1326  }
1327  else
1328  {
1329  m_epilog = cur;
1330  }
1331  }
1332  else if (kSCTSpliceInsert == type)
1333  {
1334  m_ptrs1.push_back(pesdata() + 14);
1335  bool splice_cancel = (pesdata()[18] & 0x80) != 0;
1336  if (splice_cancel)
1337  {
1338  m_epilog = pesdata() + 19;
1339  }
1340  else
1341  {
1342  bool program_splice = (pesdata()[19] & 0x40) != 0;
1343  bool duration = (pesdata()[19] & 0x20) != 0;
1344  bool splice_immediate = (pesdata()[19] & 0x10) != 0;
1345  const unsigned char *cur = pesdata() + 20;
1346  if (program_splice && !splice_immediate)
1347  {
1348  cur += SpliceTimeView(cur).size();
1349  }
1350  else if (!program_splice)
1351  {
1352  uint component_count = pesdata()[20];
1353  cur = pesdata() + 21;
1354  for (uint i = 0; i < component_count; i++)
1355  {
1356  m_ptrs0.push_back(cur);
1357  cur += (splice_immediate) ?
1358  1 : 1 + SpliceTimeView(cur).size();
1359  }
1360  }
1361  m_ptrs1.push_back(cur);
1362  m_ptrs1.push_back(cur + (duration ? 5 : 0));
1363  }
1364  }
1365  else
1366  {
1367  m_epilog = nullptr;
1368  }
1369 
1370  return m_epilog != nullptr;
1371 }
1372 
1374 {
1375  uint alg = EncryptionAlgorithm();
1376  switch (alg)
1377  {
1378  case kNoEncryption: return "None";
1379  case kECB: return "DES-ECB";
1380  case kCBC: return "DES-CBC";
1381  case k3DES: return "3DES";
1382  default:
1383  return QString((alg<32) ? "Reserved(%1)" : "Private(%1)").arg(alg);
1384  }
1385 }
1386 
1388 {
1390  switch (type)
1391  {
1392  case kSCTNull:
1393  return "Null";
1394  case kSCTSpliceSchedule:
1395  return "SpliceSchedule";
1396  case kSCTSpliceInsert:
1397  return "SpliceInsert";
1398  case kSCTTimeSignal:
1399  return "TimeSignal";
1401  return "BandwidthReservation";
1402  case kSCTPrivateCommand:
1403  return "Private";
1404  default:
1405  return QString("Reserved(%1)").arg(type);
1406  };
1407 }
1408 
1409 QString SpliceInformationTable::toString(int64_t first, int64_t last) const
1410 {
1411  QString str =
1412  QString("SpliceInformationSection enc_alg(%1) pts_adj(%2)")
1414  .arg(PTSAdjustment());
1415  str += IsEncryptedPacket() ? QString(" cw_index(%1)") : QString("");
1416  str += QString(" command_len(%1) command_type(%2) scte_pid(0x%3)")
1417  .arg(SpliceCommandLength())
1419  .arg(getSCTEPID(), 0, 16));
1420 
1421  if (IsEncryptedPacket())
1422  return str;
1423 
1424  switch (SpliceCommandType())
1425  {
1426  case kSCTSpliceSchedule:
1427  break;
1428  case kSCTSpliceInsert:
1429  {
1430  str += "\n " + SpliceInsert().toString(first, last);
1431  break;
1432  }
1433  case kSCTTimeSignal:
1434  break;
1435  }
1436 
1437  return str;
1438 }
1439 
1440 QString SpliceInsertView::toString(int64_t first, int64_t last) const
1441 {
1442  QString str =
1443  QString("eventid(0x%1) cancel(%2) "
1444  "out_of_network(%3) program_splice(%4) "
1445  "duration(%5) immediate(%6)\n ")
1446  .arg(SpliceEventID(),0,16)
1447  .arg(IsSpliceEventCancel()?"yes":"no",
1448  IsOutOfNetwork()?"yes":"no",
1449  IsProgramSplice()?"yes":"no",
1450  IsDuration()?"yes":"no",
1451  IsSpliceImmediate()?"yes":"no");
1452 
1453  if (IsProgramSplice() && !IsSpliceImmediate())
1454  str += SpliceTime().toString(first, last);
1455 
1456  str += QString(" unique_program_id(%1)")
1457  .arg(UniqueProgramID());
1458 
1459  str += QString(" avail(%1/%2)")
1460  .arg(AvailNum()).arg(AvailsExpected());
1461 
1462  return str;
1463 }
1464 
1466  uint indent_level, int64_t first, int64_t last) const
1467 {
1468  QString indent = StringUtil::indentSpaces(indent_level);
1469 
1470  QString cap_time = "";
1471  if (first >= 0)
1472  {
1473  cap_time = QString("pts=\"%1\" ").arg(first);
1474  if (last >= 0)
1475  {
1476  QTime abs = QTime(0,0,0,0).addMSecs((last - first)/90);
1477  cap_time += QString("capture_time=\"%1\" ")
1478  .arg(abs.toString("hh:mm:ss.zzz"));
1479  }
1480  }
1481 
1482  QString str = QString(
1483  "%1<SpliceInformationSection %2 encryption_algorithm=\"%3\" "
1484  "pts_adjustment=\"%4\" code_word_index=\"%5\" command_type=\"%6\" scte_pid=\"0x%7\" >\n")
1485  .arg(indent,
1486  cap_time,
1488  .arg(PTSAdjustment())
1489  .arg(CodeWordIndex())
1490  .arg(SpliceCommandTypeString())
1491  .arg(getSCTEPID(), 0 ,16);
1492 
1493  if (IsEncryptedPacket())
1494  return str + indent + "</SpliceInformationSection>";
1495 
1496  switch (SpliceCommandType())
1497  {
1498  case kSCTSpliceSchedule:
1499  break;
1500  case kSCTSpliceInsert:
1501  {
1502  str += SpliceInsert().toStringXML(indent_level + 1, first, last);
1503  str += "\n";
1504  break;
1505  }
1506  case kSCTTimeSignal:
1507  break;
1508  }
1509 
1510  str += indent + "</SpliceInformationSection>";
1511  return str;
1512 }
1513 
1515  uint indent_level, int64_t first, int64_t last) const
1516 {
1517  QString indent_0 = StringUtil::indentSpaces(indent_level);
1518  QString indent_1 = StringUtil::indentSpaces(indent_level + 1);
1519  QString str = QString(
1520  "%1<SpliceInsert eventid=\"0x%2\" cancel=\"%3\"\n")
1521  .arg(indent_0)
1522  .arg(SpliceEventID(),0,16)
1524 
1525  str += QString(
1526  "%1out_of_network=\"%2\" program_splice=\"%3\" duration=\"%4\"\n")
1527  .arg(indent_1,
1531 
1532  str += QString(
1533  "%1immediate=\"%2\" unique_program_id=\"%3\"\n"
1534  "%4avail_num=\"%5\" avails_expected=\"%6\">\n")
1535  .arg(indent_1,
1537  .arg(UniqueProgramID())
1538  .arg(indent_1)
1539  .arg(AvailNum())
1540  .arg(AvailsExpected());
1541 
1542  if (IsProgramSplice() && !IsSpliceImmediate())
1543  {
1544  str += SpliceTime().toStringXML(indent_level + 1, first, last) + "\n";
1545  }
1546 
1547  str += indent_0 + "</SpliceInsert>";
1548  return str;
1549 }
ProgramMapTable::ProgramInfo
const unsigned char * ProgramInfo(void) const
Definition: mpegtables.h:737
MPEGDescriptor::toString
virtual QString toString(void) const
Definition: mpegdescriptors.cpp:410
StreamID::H264Video
@ H264Video
ISO 14492-10 & ITU H.264 (aka MPEG-4-AVC)
Definition: mpegtables.h:118
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:468
ProgramAssociationTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:853
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:648
SpliceInsertView::UniqueProgramID
uint UniqueProgramID(void) const
Definition: mpegtables.h:1012
TableID::SDTo
@ SDTo
Definition: mpegtables.h:277
SpliceInformationTable::m_ptrs1
std::vector< const unsigned char * > m_ptrs1
Definition: mpegtables.h:1204
DescriptorID::ac3
@ ac3
Definition: mpegdescriptors.h:116
DescriptorID::subtitling
@ subtitling
Definition: mpegdescriptors.h:98
SpliceTimeView::toStringXML
virtual QString toStringXML(uint indent_level, int64_t first, int64_t last) const
Definition: mpegtables.cpp:1238
DescriptorID::conditional_access
@ conditional_access
Definition: mpegdescriptors.h:33
StreamID::MetaDataDC
@ MetaDataDC
ISO 13818-6 Metadata in Data Carousel.
Definition: mpegtables.h:141
ISO639LanguageDescriptor::CanonicalLanguageString
QString CanonicalLanguageString(void) const
Definition: mpegdescriptors.h:503
SpliceInformationTable::TimeSignal
SpliceTimeView TimeSignal(void) const
Definition: mpegtables.h:1154
SpliceInformationTable::kSCTNull
@ kSCTNull
Definition: mpegtables.h:1118
StreamID::AnyVideo
@ AnyVideo
Definition: mpegtables.h:164
StreamID::H265Video
@ H265Video
ISO 23008-2 & ITU H.265 (aka HEVC, Ultra HD)
Definition: mpegtables.h:119
TableID::AETT
@ AETT
Definition: mpegtables.h:378
ProgramMapTable::StreamCount
uint StreamCount(void) const
Definition: mpegtables.h:752
StreamID::Splice
@ Splice
ANSI/SCTE 35 2007.
Definition: mpegtables.h:160
ISO639LanguageDescriptor::AudioType
uint AudioType() const
Definition: mpegdescriptors.h:495
TableID::LTST
@ LTST
Definition: mpegtables.h:373
TableID::DET
@ DET
Definition: mpegtables.h:368
SpliceInsertView::SpliceTime
SpliceTimeView SpliceTime(void) const
Definition: mpegtables.h:997
SpliceInformationTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.h:1196
ProgramMapTable::kPmtHeaderMinOffset
static const uint kPmtHeaderMinOffset
Definition: mpegtables.h:849
TableID::DCCSCT
@ DCCSCT
Definition: mpegtables.h:375
ConditionalAccessTable::Descriptors
const unsigned char * Descriptors(void) const
Definition: mpegtables.h:882
TableID::DCCT
@ DCCT
Definition: mpegtables.h:374
PSIPTable::IsCurrent
bool IsCurrent(void) const
Definition: mpegtables.h:547
TableID::ECM0
@ ECM0
Definition: mpegtables.h:355
DescriptorID::teletext
@ teletext
Definition: mpegdescriptors.h:95
PESPacket::SetTotalLength
void SetTotalLength(uint len)
Definition: pespacket.h:178
ProgramMapTable::SetProgramInfo
void SetProgramInfo(unsigned char *streamInfo, uint infoLength)
Definition: mpegtables.h:841
StreamID::MPEG2Audio
@ MPEG2Audio
ISO 13818-3.
Definition: mpegtables.h:125
ProgramMapTable::StreamInfo
const unsigned char * StreamInfo(uint i) const
Definition: mpegtables.h:749
TableID::ETT
@ ETT
Definition: mpegtables.h:366
ProgramAssociationTable::SetTranportStreamID
void SetTranportStreamID(uint gtsid)
Definition: mpegtables.h:654
SpliceInformationTable::EncryptionAlgorithm
uint EncryptionAlgorithm(void) const
Definition: mpegtables.h:1076
PESPacket::pesdata
const unsigned char * pesdata() const
Definition: pespacket.h:166
TableID::CVCT
@ CVCT
Definition: mpegtables.h:363
TableID::EIT
@ EIT
Definition: mpegtables.h:365
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:694
SpliceInformationTable::EncryptionAlgorithmString
QString EncryptionAlgorithmString(void) const
Definition: mpegtables.cpp:1373
PESPacket::tsheader
const TSHeader * tsheader() const
Definition: pespacket.h:92
StreamID::H222_1
@ H222_1
ITU H.222.1.
Definition: mpegtables.h:150
ProgramMapTable::FindPID
int FindPID(uint pid) const
Locates stream index of pid.
Definition: mpegtables.h:799
ProgramMapTable::PCRPID
uint PCRPID(void) const
stream that contains program clock reference.
Definition: mpegtables.h:728
SpliceInformationTable
Definition: mpegtables.h:1029
StreamID::FlexMuxSec
@ FlexMuxSec
ISO 14496-1 SL/FlexMux in 14496_sections.
Definition: mpegtables.h:155
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:227
SpliceInformationTable::Parse
bool Parse(void)
Definition: mpegtables.cpp:1280
ProgramMapTable::CreateBlank
static ProgramMapTable * CreateBlank(bool smallPacket=true)
Definition: mpegtables.cpp:381
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
ProgramMapTable::ProgramNumber
uint ProgramNumber(void) const
Definition: mpegtables.h:731
SpliceInformationTable::toString
QString toString(void) const override
Definition: mpegtables.h:1194
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
StreamID::VC1Video
@ VC1Video
SMPTE 421M video codec (aka VC1) in Blu-Ray.
Definition: mpegtables.h:121
TableID::SRVLOC
@ SRVLOC
Definition: mpegtables.h:393
StreamID::AnyAudio
@ AnyAudio
Definition: mpegtables.h:165
RegistrationDescriptor
Definition: mpegdescriptors.h:429
ProgramAssociationTable::ProgramCount
uint ProgramCount(void) const
Definition: mpegtables.h:638
SpliceInformationTable::kNoEncryption
@ kNoEncryption
Definition: mpegtables.h:1069
PSIPTable::ATSCProtocolVersion
uint ATSCProtocolVersion(void) const
Definition: mpegtables.h:557
PSIPTable::SetVersionNumber
void SetVersionNumber(uint ver)
Definition: mpegtables.h:575
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::CMPNAME
@ CMPNAME
Definition: mpegtables.h:395
StreamID::DSMCC_D
@ DSMCC_D
ISO 13818-6 type D Any DSMCC Data.
Definition: mpegtables.h:137
PSIPTable::kPsipOffset
static const uint kPsipOffset
Definition: mpegtables.h:593
ProgramMapTable::StreamTypeString
QString StreamTypeString(uint i) const
Returns a string representation of type at stream index i.
Definition: mpegtables.h:782
StreamID::MPEG2AACAudio
@ MPEG2AACAudio
ISO 13818-7 Audio w/ADTS syntax.
Definition: mpegtables.h:126
SpliceInformationTable::kSCTBandwidthReservation
@ kSCTBandwidthReservation
Definition: mpegtables.h:1125
PSIPTable::Section
uint Section(void) const
Definition: mpegtables.h:550
RegistrationDescriptor::FormatIdentifierString
QString FormatIdentifierString(void) const
Definition: mpegdescriptors.h:443
SpliceInformationTable::getSCTEPID
int getSCTEPID(void) const
Definition: mpegtables.h:1047
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
TableID::ECN
@ ECN
Definition: mpegtables.h:392
ConditionalAccessTable::DescriptorsLength
uint DescriptorsLength(void) const
Definition: mpegtables.h:880
SpliceInformationTable::SpliceProtocolVersion
uint SpliceProtocolVersion(void) const
Definition: mpegtables.h:1058
DescriptorID::iso_639_language
@ iso_639_language
Definition: mpegdescriptors.h:34
SpliceInsertView::SpliceEventID
uint SpliceEventID(void) const
Definition: mpegtables.h:977
PSIPTable
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:409
StreamID::MPEG4Video
@ MPEG4Video
ISO 14492-2 (aka MPEG-4)
Definition: mpegtables.h:117
StreamID::GetDescription
static QString GetDescription(uint stream_id)
Definition: mpegtables.cpp:1033
MPEGDescriptor::IsValid
bool IsValid(void) const
Definition: mpegdescriptors.h:342
SpliceInformationTable::kSCTSpliceSchedule
@ kSCTSpliceSchedule
Definition: mpegtables.h:1122
PSIPTable::toString
virtual QString toString(void) const
Definition: mpegtables.cpp:763
ProgramMapTable::IsStreamEncrypted
bool IsStreamEncrypted(uint pid) const
Returns true iff PMT contains CA descriptor.
Definition: mpegtables.cpp:595
TableID::PAT
@ PAT
Definition: mpegtables.h:264
ProgramMapTable::RemoveAllStreams
void RemoveAllStreams(void)
Definition: mpegtables.h:808
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:1161
TableID::TVCT
@ TVCT
Definition: mpegtables.h:362
SpliceInsertView::IsSpliceImmediate
bool IsSpliceImmediate(void) const
Definition: mpegtables.h:993
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:636
ProgramAssociationTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: mpegtables.h:645
splicedescriptors.h
MPEGDescriptor::Parse
static desc_list_t Parse(const unsigned char *data, uint len)
Definition: mpegdescriptors.cpp:17
StreamID::DSMCC_C
@ DSMCC_C
ISO 13818-6 type C NPT DSMCC Data.
Definition: mpegtables.h:136
ProgramMapTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:880
TableID::PMT
@ PMT
Definition: mpegtables.h:266
MythFile::copy
MBASE_PUBLIC long long copy(QFile &dst, QFile &src, uint block_size=0)
Copies src file to dst file.
Definition: mythmiscutil.cpp:263
ConditionalAccessDescriptor::SystemID
uint SystemID(void) const
Definition: mpegdescriptors.h:481
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
SpliceInformationTable::m_ptrs0
std::vector< const unsigned char * > m_ptrs0
Definition: mpegtables.h:1203
PSIPTable::HasSectionNumber
bool HasSectionNumber(void) const
Definition: mpegtables.cpp:211
StreamID::PrivData
@ PrivData
ISO 13818-1 PES private data & ITU H.222.0.
Definition: mpegtables.h:147
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
StreamID::FlexMuxPES
@ FlexMuxPES
ISO 14496-1 SL/FlexMux in PES packets.
Definition: mpegtables.h:154
TSPacket
Used to access the data of a Transport Stream packet.
Definition: tspacket.h:205
SpliceInformationTable::kECB
@ kECB
Definition: mpegtables.h:1070
SpliceInformationTable::m_epilog
const unsigned char * m_epilog
Definition: mpegtables.h:1205
StreamID::MetaDataOC
@ MetaDataOC
ISO 13818-6 Metadata in Object Carousel.
Definition: mpegtables.h:142
ProgramMapTable::StreamType
uint StreamType(uint i) const
Definition: mpegtables.h:740
ConditionalAccessTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:1176
TableID::MGT
@ MGT
Definition: mpegtables.h:361
ConditionalAccessDescriptor
Definition: mpegdescriptors.h:475
desc_list_t
std::vector< const unsigned char * > desc_list_t
Definition: mpegdescriptors.h:18
DescriptorID::eac3
@ eac3
Definition: mpegdescriptors.h:133
TableID::BAT
@ BAT
Definition: mpegtables.h:278
MPEGDescriptor::ParseOnlyInclude
static desc_list_t ParseOnlyInclude(const unsigned char *data, uint len, int excluded_descid)
Definition: mpegdescriptors.cpp:57
TableID::NITo
@ NITo
Definition: mpegtables.h:276
StreamID::MPEG2AudioAmd1
@ MPEG2AudioAmd1
ISO 13818-3/AMD-1 Audio using LATM syntax.
Definition: mpegtables.h:127
TableID::DN_EITendo
@ DN_EITendo
Definition: mpegtables.h:315
stringutil.h
TableID::NIT
@ NIT
Definition: mpegtables.h:270
ProgramMapTable::FindUnusedPID
uint FindUnusedPID(uint desired_pid=0x20) const
Definition: mpegtables.cpp:737
ProgramAssociationTable::toString
QString toString(void) const override
Definition: mpegtables.cpp:815
ProgramAssociationTable::CreateBlank
static ProgramAssociationTable * CreateBlank(bool smallPacket=true)
Definition: mpegtables.cpp:331
SpliceInsertView::AvailsExpected
uint AvailsExpected(void) const
Definition: mpegtables.h:1017
PSIPTable::toStringXML
virtual QString toStringXML(uint indent_level) const
Definition: mpegtables.cpp:781
SpliceInsertView::IsOutOfNetwork
bool IsOutOfNetwork(void) const
Definition: mpegtables.h:987
TableID::RST
@ RST
Definition: mpegtables.h:284
SpliceInformationTable::CodeWordIndex
uint CodeWordIndex(void) const
Definition: mpegtables.h:1102
PESPacket::Length
uint Length() const
Definition: pespacket.h:101
mpegtables.h
SpliceInformationTable::kCBC
@ kCBC
Definition: mpegtables.h:1071
ProgramMapTable::IsStillPicture
bool IsStillPicture(const QString &sistandard) const
Returns true iff PMT contains a still-picture video stream.
Definition: mpegtables.cpp:617
StreamID::OpenCableVideo
@ OpenCableVideo
Always MPEG-2??
Definition: mpegtables.h:120
ProgramMapTable::SetStreamPID
void SetStreamPID(uint i, uint pid)
Definition: mpegtables.h:764
SpliceInformationTable::kSCTPrivateCommand
@ kSCTPrivateCommand
Definition: mpegtables.h:1127
StreamID::DSMCC
@ DSMCC
ISO 13818-1 Annex A DSM-CC & ITU H.222.0.
Definition: mpegtables.h:133
PID
Contains Packet Identifier numeric values.
Definition: mpegtables.h:206
SpliceInformationTable::SpliceCommandType
uint SpliceCommandType(void) const
Definition: mpegtables.h:1129
TableID::NRT
@ NRT
Definition: mpegtables.h:372
uint
unsigned int uint
Definition: compat.h:81
TableID::AEIT
@ AEIT
Definition: mpegtables.h:377
DescriptorID::registration
@ registration
Definition: mpegdescriptors.h:29
SpliceInformationTable::k3DES
@ k3DES
Definition: mpegtables.h:1072
StreamID::MPEG1Audio
@ MPEG1Audio
ISO 11172-3.
Definition: mpegtables.h:124
ProgramAssociationTable
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
Definition: mpegtables.h:617
TSPacket::CreatePayloadOnlyPacket
static TSPacket * CreatePayloadOnlyPacket(void)
Definition: tspacket.h:213
PSIPTable::LastSection
uint LastSection(void) const
Definition: mpegtables.h:553
StreamID::MetaDataDL
@ MetaDataDL
ISO 13818-6 Metadata in Download Protocol.
Definition: mpegtables.h:143
ProgramMapTable::FindPIDs
uint FindPIDs(uint type, std::vector< uint > &pids, const QString &sistandard) const
Finds all pids matching type.
Definition: mpegtables.cpp:642
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:983
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
StreamID::MPEG2IPMP2
@ MPEG2IPMP2
ISO 13818-10 Digital Restrictions Mangment.
Definition: mpegtables.h:158
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:406
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:489
SpliceInformationTable::kSCTSpliceInsert
@ kSCTSpliceInsert
Definition: mpegtables.h:1123
TableID::RRT
@ RRT
Definition: mpegtables.h:364
ProgramMapTable::SetStreamProgramInfo
void SetStreamProgramInfo(uint i, unsigned char *streamInfo, uint infoLength)
Definition: mpegtables.h:827
PESPacket::Finalize
void Finalize()
Definition: pespacket.h:219
DescriptorID::video_stream
@ video_stream
Definition: mpegdescriptors.h:26
PSIPTable::VerifyPSIP
bool VerifyPSIP(bool verify_crc) const
Definition: mpegtables.cpp:237
TableID::STT
@ STT
Definition: mpegtables.h:367
TableID::TSS
@ TSS
Definition: mpegtables.h:394
PSIPTable::SectionLength
uint SectionLength(void) const
Definition: mpegtables.h:526
TableID::NTT
@ NTT
Definition: mpegtables.h:341
SpliceInformationTable::SpliceCommandLength
uint SpliceCommandLength(void) const
Definition: mpegtables.h:1106
TableID::PF_EIT
@ PF_EIT
Definition: mpegtables.h:272
StreamID::MetaDataPES
@ MetaDataPES
Meta data in PES packets.
Definition: mpegtables.h:139
ProgramMapTable::ProgramInfoLength
uint ProgramInfoLength(void) const
Definition: mpegtables.h:734
StreamID::MPEG2Aux
@ MPEG2Aux
ISO 13818-1 auxiliary & ITU H.222.0.
Definition: mpegtables.h:152
PSIPTable::View
static PSIPTable View(const TSPacket &tspacket)
Definition: mpegtables.h:506
ProgramMapTable::SetPCRPID
void SetPCRPID(uint pid)
Definition: mpegtables.h:756
TableID::SVCT
@ SVCT
Definition: mpegtables.h:379
PESPacket::CRC
uint CRC(void) const
Definition: pespacket.h:191
TableID::DIT
@ DIT
Definition: mpegtables.h:292
SpliceInformationTable::kSCTTimeSignal
@ kSCTTimeSignal
Definition: mpegtables.h:1124
SpliceInsertView::IsProgramSplice
bool IsProgramSplice(void) const
Definition: mpegtables.h:989
ProgramMapTable::SetProgramNumber
void SetProgramNumber(uint num)
Definition: mpegtables.h:762
TableID::DN_EITbego
@ DN_EITbego
Definition: mpegtables.h:314
SpliceInsertView::toStringXML
virtual QString toStringXML(uint indent_level, int64_t first, int64_t last) const
Definition: mpegtables.cpp:1514
TableID::TOT
@ TOT
Definition: mpegtables.h:286
StreamID::toString
static const char * toString(uint streamID)
Definition: mpegtables.cpp:963
ProgramAssociationTable::ProgramAssociationTable
ProgramAssociationTable(const ProgramAssociationTable &table)
Definition: mpegtables.h:620
SpliceInsertView::AvailNum
uint AvailNum(void) const
Definition: mpegtables.h:1015
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:515
PSIPTable::TableIDExtension
uint TableIDExtension(void) const
Definition: mpegtables.h:534
StreamID::DSMCC_B
@ DSMCC_B
ISO 13818-6 type B Std DSMCC Data.
Definition: mpegtables.h:135
DEFAULT_PAT_HEADER
const std::array< const uint8_t, 8 > DEFAULT_PAT_HEADER
Definition: mpegtables.cpp:12
TableID::SDT
@ SDT
Definition: mpegtables.h:271
TSHeader::SetPID
void SetPID(unsigned int pid)
Definition: tspacket.h:158
TableID::PF_EITo
@ PF_EITo
Definition: mpegtables.h:279
SpliceTimeView::PTSTime
uint64_t PTSTime(void) const
Definition: mpegtables.h:899
TableID::TDT
@ TDT
Definition: mpegtables.h:273
ConditionalAccessTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:1190
StreamID::MPEG2Video
@ MPEG2Video
ISO 13818-2 & ITU H.262 (aka MPEG-2)
Definition: mpegtables.h:116
SpliceTimeView::toString
virtual QString toString(int64_t first, int64_t last) const
Definition: mpegtables.cpp:1213
PESPacket::SetLength
void SetLength(uint len)
Definition: pespacket.h:173
SpliceInformationTable::PTSAdjustment
uint64_t PTSAdjustment(void) const
Definition: mpegtables.h:1084
TSHeader
Used to access header of a TSPacket.
Definition: tspacket.h:44
TableID::CAT
@ CAT
Definition: mpegtables.h:265
ProgramAssociationTable::Create
static ProgramAssociationTable * Create(uint tsid, uint version, const std::vector< uint > &pnum, const std::vector< uint > &pid)
Definition: mpegtables.cpp:346
TableID::SRM
@ SRM
Definition: mpegtables.h:381
StreamID::AnyMask
@ AnyMask
Definition: mpegtables.h:163
StreamID::EAC3Audio
@ EAC3Audio
A/53 Part 3:2009 6.7.3.
Definition: mpegtables.h:129
ProgramMapTable::SetStreamType
void SetStreamType(uint i, uint type)
Definition: mpegtables.h:770
StreamID::MHEG
@ MHEG
ISO 13522 MHEG.
Definition: mpegtables.h:149
StreamID::AC3Audio
@ AC3Audio
A/53 Part 3:2009 6.7.1.
Definition: mpegtables.h:128
TableID::STTscte
@ STTscte
Definition: mpegtables.h:343
ConditionalAccessDescriptor::toString
QString toString() const override
Definition: mpegdescriptors.cpp:883
PSIPTable::XMLValues
QString XMLValues(uint indent_level) const
Definition: mpegtables.cpp:787
SpliceTimeView
Definition: mpegtables.h:890
PESPacket::m_fullBuffer
unsigned char * m_fullBuffer
Pointer to allocated data.
Definition: pespacket.h:222
StreamID::DSMCC_A
@ DSMCC_A
ISO 13818-6 type A Multi-protocol Encap.
Definition: mpegtables.h:134
SpliceInformationTable::SpliceCommandTypeString
QString SpliceCommandTypeString(void) const
Definition: mpegtables.cpp:1387
ProgramMapTable::GetAudioType
uint GetAudioType(uint i) const
Returns the audio type from the iso 639 descriptor.
Definition: mpegtables.cpp:1138
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
TableID::ADET
@ ADET
Definition: mpegtables.h:348
StreamID::MPEG2IPMP
@ MPEG2IPMP
ISO 13818-10 Digital Restrictions Mangment.
Definition: mpegtables.h:157
ProgramMapTable::m_ptrs
std::vector< unsigned char * > m_ptrs
Definition: mpegtables.h:850
ProgramMapTable::toStringXML
QString toStringXML(uint indent_level) const override
Definition: mpegtables.cpp:915
TableID::SC_EITbeg
@ SC_EITbeg
Definition: mpegtables.h:280
ProgramMapTable::StreamInfoLength
uint StreamInfoLength(uint i) const
Definition: mpegtables.h:746
StreamID::Normalize
static uint Normalize(uint stream_id, const desc_list_t &desc, const QString &sistandard)
Definition: mpegtables.cpp:47
StreamID::PrivSec
@ PrivSec
ISO 13818-1 private tables & ITU H.222.0.
Definition: mpegtables.h:146
MPEGDescriptor::Find
static const unsigned char * Find(const desc_list_t &parsed, uint desc_tag)
Definition: mpegdescriptors.cpp:78
TableID::ECMend
@ ECMend
Definition: mpegtables.h:358
TableID::SC_EITendo
@ SC_EITendo
Definition: mpegtables.h:283
ProgramMapTable::GetLanguage
QString GetLanguage(uint i) const
Returns the canonical language if we find the iso639 descriptor.
Definition: mpegtables.cpp:1122
indent
static QString indent(uint level)
Definition: mythsettings.cpp:21
TableID::ST
@ ST
Definition: mpegtables.h:285
SpliceTimeView::IsTimeSpecified
bool IsTimeSpecified(void) const
Definition: mpegtables.h:895
StringUtil::bool_to_string
QString bool_to_string(bool val)
This is equivalent to QVariant(bool).toString()
Definition: stringutil.h:41
StreamID::DSMCC_DL
@ DSMCC_DL
ISO 13818-6 Download Protocol.
Definition: mpegtables.h:138
ProgramMapTable::IsProgramEncrypted
bool IsProgramEncrypted(void) const
Returns true iff PMT's ProgramInfo contains CA descriptor.
Definition: mpegtables.cpp:567
StreamID::MetaDataSec
@ MetaDataSec
Meta data in metadata_section's.
Definition: mpegtables.h:140
SpliceInformationTable::SpliceInsert
SpliceInsertView SpliceInsert(void) const
Definition: mpegtables.h:1148
SpliceInsertView::IsDuration
bool IsDuration(void) const
Definition: mpegtables.h:991
SpliceTimeView::size
uint size(void) const
Definition: mpegtables.h:914
TableID::SIT
@ SIT
Definition: mpegtables.h:293
SpliceInformationTable::GetDecrypted
static SpliceInformationTable * GetDecrypted(const QString &codeWord)
Returns decrypted version of this packet.
Definition: mpegtables.cpp:1273
StreamID::DTSAudio
@ DTSAudio
Definition: mpegtables.h:130
ProgramMapTable::StreamPID
uint StreamPID(uint i) const
Definition: mpegtables.h:743
SpliceInsertView::toString
virtual QString toString(int64_t first, int64_t last) const
Definition: mpegtables.cpp:1440
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:698
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:1061
PSIPTable::Version
uint Version(void) const
Definition: mpegtables.h:541
TableID::DST
@ DST
Definition: mpegtables.h:369
TableID::NITscte
@ NITscte
Definition: mpegtables.h:340
StreamID::MPEG1Video
@ MPEG1Video
ISO 11172-2 (aka MPEG-1)
Definition: mpegtables.h:115
ConditionalAccessDescriptor::PID
uint PID(void) const
Definition: mpegdescriptors.h:482
PSIPTable::psipdata
const unsigned char * psipdata(void) const
Definition: mpegtables.h:560
TableID::SVCTscte
@ SVCTscte
Definition: mpegtables.h:342
TableID::SITscte
@ SITscte
Definition: mpegtables.h:351