MythTV  master
atsctables.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2004, Daniel Thor Kristjansson
3 #ifndef ATSC_TABLES_H
4 #define ATSC_TABLES_H
5 
6 #include "libmythbase/mythconfig.h"
7 
8 #include <cstdint> // uint32_t
9 #include <limits> // workaround QTBUG-90395
10 
11 #include <QString>
12 #include <QtEndian>
13 
14 #include "libmythbase/mythdate.h"
15 #include "libmythbase/mythmiscutil.h" // for xml_indent
18 #include "libmythtv/mythtvexp.h"
19 
20 // Some sample code is in pcHDTV's dtvscan.c,
21 // accum_sect/dequeue_buf/atsc_tables. We should stuff
22 // this data back into the channel's guide data, though if
23 // it's unreliable we will need to be able to prefer the
24 // downloaded XMLTV data.
25 
57 {
58  public:
60  {
61  UNKNOWN = -1,
62  TVCTc = 0,
63  TVCTnc = 1,
64  CVCTc = 2,
65  CVCTnc = 3,
66  ETTc = 4,
67  DCCSCT = 5,
68  EIT = 6,
69  ETTe = 7,
70  DCCT = 8,
71  RRT = 9,
72  };
73 };
74 
80 {
81  public:
83  {
85  Parse();
86  }
87  explicit MasterGuideTable(const PSIPTable& table) : PSIPTable(table)
88  {
90  Parse();
91  }
92  ~MasterGuideTable() override { ; }
93 
94  // Name bits loc expected value
95  // table_id 8 0.0 0xC7
96  // section_syntax_indicator 1 1.0 1
97  // private_indicator 1 1.1 1
98  // reserved 2 1.2 3
99  // section_length 12 1.4 0-4093
100  // table_id_extension 16 3.0 0x0000
101 
102  /* Each Map ID corresponds to one set of channel mappings. Each STB
103  * is expected to ignore any Map ID's other than the one corresponding
104  * to it's head-end.
105  *
106  * Note: This is only defined for SCTE streams, it is always 0 in ATSC streams
107  */
108  uint SCTEMapId() const
109  {
110  return (pesdata()[3]<<8) | pesdata()[4];
111  }
112 
113  // reserved 2 5.0 3
114  // current_next_indicator 1 5.7 1
115  // section_number 8 6.0 0x00
116  // last_section_number 8 7.0 0x00
117  // protocol_version 8 8.0 0x00 for now
118 
119  // tables_defined 16 9.0, 6-370 valid OTA, 2-370 valid w/Cable
120  uint TableCount() const { return (pesdata()[9]<<8) | pesdata()[10]; }
121  uint TableCountRaw() const { return (pesdata()[9]<<8) | pesdata()[10]; }
122  // for (i=0; i<tableCount(); i++) {
123  // table_type 16 0.0
124  uint TableType(uint i) const
125  {
126  return (m_ptrs[i][0]<<8) | m_ptrs[i][1];
127  }
128  int TableClass(uint i) const;
129  QString TableClassString(uint i) const;
130  // reserved 3 2.0 0x7
131  // table_type_PID 13 2.3
132  uint TablePID(uint i) const
133  {
134  return ((m_ptrs[i][2]<<8) | (m_ptrs[i][3])) & 0x1fff;
135  }
136  // reserved 3 4.0 0x7
137  // table_type_version_number 5 4.3
139  {
140  return (m_ptrs[i][4]) & 0x1f;
141  }
142  // number_bytes for table desc. 32 5.0
144  {
145  return ((m_ptrs[i][5]<<24) | (m_ptrs[i][6]<<16) |
146  (m_ptrs[i][7]<<8) | (m_ptrs[i][8]));
147  }
148  // reserved 4 9.0 0xf
149  // table_type_descriptors_length 12 9.4
151  {
152  return ((m_ptrs[i][9]<<8) | (m_ptrs[i][10])) & 0xfff;
153  }
154 
155  // for (I = 0; I<M; I++)
156  // descriptor = 11 + (offset)
157  // }
158  // }
159  const unsigned char* TableDescriptors(uint i) const
160  {
161  return m_ptrs[i]+11;
162  }
163  // reserved 4 0xf
164  // descriptors_length 12
166  {
167  return ((m_ptrs[TableCount()][0]<<8) |
168  (m_ptrs[TableCount()][1])) & 0xfff;
169  }
170 
171  const unsigned char* GlobalDescriptors() const
172  {
173  return m_ptrs[TableCount()]+2;
174  }
175  // for (I=0; I<N; I++) {
176  // descriptor()
177  // }
178  // CRC_32 32
179 
180  void Parse(void) const;
181  QString toString(void) const override; // PSIPTable
182  QString toStringXML(uint indent_level) const override; // PSIPTable
183  private:
184  mutable std::vector<unsigned char*> m_ptrs; // used to parse
185 };
186 
194 {
195  public:
197  {
199  Parse();
200  }
201  explicit VirtualChannelTable(const PSIPTable &table) : PSIPTable(table)
202  {
204  Parse();
205  }
206 
207  ~VirtualChannelTable() override { ; }
208 
209  // Name bits loc expected value
210  // table_id 8 0.0 0xC8/0xC9
211  // section_syntax_indicator 1 1.0 1
212  // private_indicator 1 1.1 1
213  // reserved 2 1.2 3
214  // table_id_extension 16 3.0 0x0000
215  // reserved 2 5.0 3
216  // current_next_indicator 1 5.7 1
217  // section_number 8 6.0 0x00
218  // last_section_number 8 7.0 0x00
219  // protocol_version 8 8.0 0x00 for now
220 
221  // transport_stream_id 16 3.0
223 
224  // num_channels_in_section 8 9.0
225  uint ChannelCount() const { return pesdata()[9]; }
226  uint ChannelCountRaw() const { return pesdata()[9]; }
227 
228  // for(i=0; i<num_channels_in_section; i++) {
229  // short_name 7*16 0.0 (7 UCS-2 chars padded by 0x0000)
230  QString ShortChannelName(uint i) const
231  {
232  if (i >= ChannelCount())
233  return {};
234 
235  QString str;
236  const auto* ustr = reinterpret_cast<const unsigned short*>(m_ptrs[i]);
237  for (int j=0; j<7; j++)
238  {
239  QChar c(qFromBigEndian(ustr[j]));
240  if (c != QChar('\0')) str.append(c);
241  }
242  return str.simplified();
243  }
244  // reserved 4 13.0 0xf
245 
246  // major_channel_number 10 13.4
247  // 14 RRRR JJJJ 15 jjjj jjmm 16 MMMM MMMM
248  // JJ JJjj jjjj mm MMMM MMMM
250  {
251  return (((m_ptrs[i][14])<<6)&0x3c0) | (m_ptrs[i][15]>>2);
252  }
253  // minor_channel_number 10 14.6
255  {
256  return (((m_ptrs[i][15])<<8)&0x300) | m_ptrs[i][16];
257  }
258  // modulation_mode 8 16.0
260  {
261  return m_ptrs[i][17];
262  }
263  QString ModulationModeString(uint i) const;
264  // carrier_frequency 32 17.0 deprecated
265  // channel_TSID 16 21.0
267  {
268  return ((m_ptrs[i][22]<<8) | m_ptrs[i][23]);
269  }
270  // program_number 16 23.0
272  {
273  return ((m_ptrs[i][24]<<8) | m_ptrs[i][25]);
274  }
275  // ETM_location 2 25.0
277  {
278  return (m_ptrs[i][26]>>6) & 0x03;
279  }
280  // access_controlled 1 25.2
281  bool IsAccessControlled(uint i) const
282  {
283  return ( m_ptrs[i][26] & 0x20 ) != 0;
284  }
285  // hidden 1 25.3
286  bool IsHidden(uint i) const
287  {
288  return ( m_ptrs[i][26] & 0x10 ) != 0;
289  }
290  // reserved 2 25.4 3
291  // hide_guide 1 25.6
292  bool IsHiddenInGuide(uint i) const
293  {
294  return ( m_ptrs[i][26] & 0x02 ) != 0;
295  }
296  // reserved 6 25.7 0x3f
297  // service_type 6 26.2
299  {
300  return m_ptrs[i][27] & 0x3f;
301  }
302  QString ServiceTypeString(uint i) const;
303  // source_id 16 27.0
304  uint SourceID(uint i) const
305  {
306  return ((m_ptrs[i][28]<<8) | m_ptrs[i][29]);
307  }
308  // reserved 6 29.0 0xfb
309  // descriptors_length 10 29.6
311  {
312  return ((m_ptrs[i][30]<<8) | m_ptrs[i][31]) & 0x03ff;
313  }
314  // for (i=0;i<N;i++) { descriptor() }
315  const unsigned char* Descriptors(uint i) const
316  {
317  return m_ptrs[i]+32;
318  }
319  // }
320  // reserved 6 0xfb
321  // additional_descriptors_length 10
323  {
324  uint i = ChannelCount();
325  return ((m_ptrs[i][0]<<8) | m_ptrs[i][1]) & 0x03ff;
326  }
327  // for (j=0; j<N; j++) { additional_descriptor() }
328  const unsigned char* GlobalDescriptors() const
329  {
330  return m_ptrs[ChannelCount()]+2;
331  }
332  // CRC_32 32
333  void Parse() const;
334  int Find(int major, int minor) const;
335  QString GetExtendedChannelName(uint idx) const;
336  QString toString(void) const override; // PSIPTable
337  virtual QString ChannelString(uint channel) const = 0;
338  QString toStringXML(uint indent_level) const override; // PSIPTable
339  virtual QString ChannelStringXML(uint indent_level, uint channel) const;
340  virtual QString XMLChannelValues(uint indent_level, uint channel) const;
341  protected:
342  mutable std::vector<unsigned char*> m_ptrs;
343 };
344 
351 {
352  public:
354  : VirtualChannelTable(table)
355  {
357  }
359  : VirtualChannelTable(table)
360  {
362  }
364 
365  // Name bits loc expected value
366  // table_id 8 0.0 0xC8
367  // section_syntax_indicator 1 1.0 1
368  // private_indicator 1 1.1 1
369  // reserved 2 1.2 3
370  // table_id_extension 16 3.0 0x0000
371  // reserved 2 5.0 3
372  // current_next_indicator 1 5.7 1
373  // section_number 8 6.0 0x00
374  // last_section_number 8 7.0 0x00
375  // protocol_version 8 8.0 0x00 for now
376 
377  // transport_stream_id 16 3.0
378  // num_channels_in_section 8 9.0
379 
380  // for (i=0; i<num_channels_in_section; i++)
381  // {
382  // short_name 7*16 0.0 (7 UTF-16 chars padded by 0x0000)
383  // reserved 4 14.0 0xf
384 
385  // major_channel_number 10 14.4
386  // 14 RRRR JJJJ 15 jjjj jjmm 16 MMMM MMMM
387  // JJ JJjj jjjj mm MMMM MMMM
388  // minor_channel_number 10 15.6
389  // modulation_mode 8 17.0
390  // carrier_frequency 32 18.0 deprecated
391  // channel_TSID 16 22.0
392  // program_number 16 24.0
393  // ETM_location 2 26.0
394  // access_controlled 1 26.2
395  // hidden 1 26.3
396  // reserved 2 26.4 3
397  // hide_guide 1 26.6
398  // reserved 6 26.7 0x3f
399  // service_type 6 27.2
400  // source_id 16 28.0
401  // reserved 6 30.0 0xfb
402  // descriptors_length 10 30.6-31
403  // for (i=0;i<N;i++) { descriptor() }
404  // }
405  // reserved 6 0xfb
406  // additional_descriptors_length 10
407  // for (j=0; j<N; j++) { additional_descriptor() }
408  // CRC_32 32
409  QString ChannelString(uint channel) const override; // VirtualChannelTable
410  QString XMLChannelValues(uint indent_level, uint channel) const override; // VirtualChannelTable
411 };
412 
413 
420 {
421  public:
423  : VirtualChannelTable(table)
424  {
426  }
427  explicit CableVirtualChannelTable(const PSIPTable &table)
428  : VirtualChannelTable(table)
429  {
431  }
432  ~CableVirtualChannelTable() override { ; }
433 
434  // Name bits loc expected value
435  // table_id 8 0.0 0xC9
436  // section_syntax_indicator 1 1.0 1
437  // private_indicator 1 1.1 1
438  // reserved 2 1.2 3
439  // table_id_extension 16 3.0 0x0000
440 
441  /* Each Map ID corresponds to one set of channel mappings. Each STB
442  * is expected to ignore any Map ID's other than the one corresponding
443  * to it's head-end.
444  *
445  * Note: This is only defined for SCTE streams,
446  * it is always 0 in ATSC streams.
447  */
448  uint SCTEMapId() const
449  {
450  return (pesdata()[3]<<8) | pesdata()[4];
451  }
452 
453  // reserved 2 5.0 3
454  // current_next_indicator 1 5.7 1
455  // section_number 8 6.0 0x00
456  // last_section_number 8 7.0 0x00
457  // protocol_version 8 8.0 0x00 for now
458 
459  // for (i=0; i<num_channels_in_section; i++)
460  // {
461  // short_name 7*16 0.0 (7 UTF-16 chars padded by 0x0000)
462  // reserved 4 14.0 0xf
463 
464  // major_channel_number 10 14.4
465  // 14 RRRR JJJJ 15 jjjj jjmm 16 MMMM MMMM
466  // JJ JJjj jjjj mm MMMM MMMM
467  // minor_channel_number 10 15.6
468 
470  {
471  return (MajorChannel(i) >> 4) == 0x3f;
472  }
474  {
475  return MajorChannel(i) < 1000;
476  }
477  // Note: In SCTE streams, the channel number is undefined if
478  // the two functions above return false. As of 2002 spec.
479 
481  {
482  if (SCTEIsChannelNumberOnePart(i))
483  return ((MajorChannel(i) & 0xf) << 10) | MinorChannel(i);
484  return 0;
485  }
486 
487  // modulation_mode 8 17.0
488  // carrier_frequency 32 18.0 deprecated
489  // channel_TSID 16 22.0
490  // program_number 16 24.0
491  // ETM_location 2 26.0
492  // access_controlled 1 26.2
493  // hidden 1 26.3
494  // path_select 1 26.4
495  bool IsPathSelect(uint i) const
496  {
497  return ( m_ptrs[i][26] & 0x08 ) != 0;
498  }
499  // out_of_band 1 26.5
500  bool IsOutOfBand(uint i) const
501  {
502  return ( m_ptrs[i][26] & 0x04 ) != 0;
503  }
504  // hide_guide 1 26.6
505  // reserved 3 26.7 7
506  // service_type 6 27.2
507  // source_id 16 28.0
508  // reserved 6 30.0 0xfb
509  // descriptors_length 10 30.6-31
510  // for (i=0;i<N;i++) { descriptor() }
511  // }
512  // reserved 6 0xfb
513  // additional_descriptors_length 10
514  // for (j=0; j<N; j++) { additional_descriptor() }
515  // CRC_32 32
516  QString ChannelString(uint channel) const override; // VirtualChannelTable
517  QString XMLChannelValues(uint indent_level, uint channel) const override; // VirtualChannelTable
518 };
519 
526 {
527  public:
529  : PSIPTable(table)
530  {
532  Parse();
533  }
534  explicit EventInformationTable(const PSIPTable &table) : PSIPTable(table)
535  {
537  Parse();
538  }
539  ~EventInformationTable() override { ; }
540 
541  // Name bits loc expected value
542  // table_id 8 0.0 0xCB
543  // section_syntax_indicator 1 1.0 1
544  // private_indicator 1 1.1 1
545  // reserved 2 1.2 3
546  // table_id_extension 16 3.0 0x0000
547  // reserved 2 5.0 3
548  // current_next_indicator 1 5.7 1
549  // section_number 8 6.0 0x00
550  // last_section_number 8 7.0 0x00
551  // protocol_version 8 8.0 0x00 for now
552 
553  // source_id 16 3.0 0x0000
554  uint SourceID() const { return TableIDExtension(); }
555 
556  // num_events_in_section 8 9.0
557  uint EventCount() const { return psipdata()[1]; }
558  uint EventCountRaw() const { return psipdata()[1]; }
559  // for (j = 0; j< num_events_in_section;j++)
560  // {
561  // reserved 2 0.0 3
562  // event_id 14 0.2
563  uint EventID(uint i) const
564  {
565  return ((m_ptrs[i][0]<<8) | m_ptrs[i][1])&0x3fff;
566  }
567  // start_time 32 2.0
569  {
570  return ((m_ptrs[i][2]<<24) | (m_ptrs[i][3]<<16) |
571  (m_ptrs[i][4]<<8) | (m_ptrs[i][5]));
572  }
573  QDateTime StartTimeGPS(uint i) const
574  {
575  // Time in GPS seconds since 00:00:00 on January 6th, 1980 UTC
576  return MythDate::fromSecsSinceEpoch(GPS_EPOCH + StartTimeRaw(i));
577  }
578  // reserved 2 6.0 3
579  // ETM_location 2 6.2
581  {
582  return (m_ptrs[i][6]>>4)&3;
583  }
584  // length_in_seconds 20 6.4
586  {
587  return ((m_ptrs[i][6]<<16) | (m_ptrs[i][7]<<8) |
588  (m_ptrs[i][8])) & 0xfffff;
589  }
590  // title_length 8 9.0
592  { return m_ptrs[i][9]; }
593  // title_text() var * 10.0
595  {
596  return MultipleStringStructure(m_ptrs[i]+10);
597  }
598  // reserved 4 0xf
599  // descriptors_length 12
601  {
602  unsigned char *desc=m_ptrs[i]+10+TitleLength(i);
603  return ((desc[0]<<8)|(desc[1]))&0xfff;
604  }
605  // for (i=0;i<N;i++)
606  // {
607  // descriptor()
608  const unsigned char* Descriptors(uint i) const
609  {
610  return m_ptrs[i]+12+TitleLength(i);
611  }
612  // }
613  // }
614  // CRC_32 32
615  void Parse() const;
616  QString toString() const override; // PSIPTable
617  private:
618  mutable std::vector<unsigned char*> m_ptrs;
619 };
620 
627 {
628  public:
630  {
632  }
633  explicit ExtendedTextTable(const PSIPTable &table) : PSIPTable(table)
634  {
636  }
637  ~ExtendedTextTable() override { ; }
638 
639  // Name bits loc expected value
640  // table_id 8 0.0 0xCC
641  // section_syntax_indicator 1 1.0 1
642  // private_indicator 1 1.1 1
643  // reserved 2 1.2 3
644  // section_length 12 1.4 0-4093
645  // ETT_table_id_extension 16 3.0 unique per pid
646  // reserved 2 5.0 3
647  // current_next_indicator 1 5.7 1
648  // section_number 8 6.0 0x00
649  // last_section_number 8 7.0 0x00
650  // protocol_version 8 8.0 0x00 for now
651 
654  { SetTableIDExtension(id); }
655 
656  // ETM_id 32 10.0
657  // 31..16 15..2 iff 1..0
658  // channel ETM_id source_id 0 00
659  // event ETM_id source_id event_id 10
660  bool IsChannelETM(void) const { return 0 == (psipdata()[4] & 3); }
661  bool IsEventETM(void) const { return 2 == (psipdata()[4] & 3); }
662  uint SourceID(void) const
663  { return (psipdata()[1] << 8) | psipdata()[2]; }
664  uint EventID(void) const
665  { return (psipdata()[3] << 6) | (psipdata()[4] >> 2); }
666 
667  // extended_text_message * 14.0 multiple string structure a/65b p81
669  {
670  return MultipleStringStructure(psipdata() + 5);
671  }
672 
673  QString toString() const override; // PSIPTable
674  // CRC_32 32
675 };
676 
685 {
686  public:
688  {
690  }
691  explicit SystemTimeTable(const PSIPTable &table) : PSIPTable(table)
692  {
694  }
695 
696  // Name bits loc expected value
697  // table_id 8 0.0 0xCD
698  // section_syntax_indicator 1 1.0 1
699  // private_indicator 1 1.1 1
700  // reserved 2 1.2 3
701  // section_length 12 1.4 0-4093
702  // table_id_extension 16 3.0 0
703  // reserved 2 5.0 3
704  // version_number 5 5.2 0
705  // current_next_indicator 1 5.7 1
706  // section_number 8 6.0 0x00
707  // last_section_number 8 7.0 0x00
708  // protocol_version 8 8.0 0x00 for now
709 
710  // system_time 32 9.0
711  uint32_t GPSRaw(void) const
712  {
713  return ((pesdata()[9] <<24) | (pesdata()[10]<<16) |
714  (pesdata()[11]<< 8) | pesdata()[12]);
715  }
716  QDateTime SystemTimeGPS(void) const
717  {
718  return MythDate::fromSecsSinceEpoch(GPS_EPOCH + GPSRaw());
719  }
720  time_t GPSUnix(void) const
721  { return GPS_EPOCH + GPSRaw(); }
722  time_t UTCUnix(void) const
723  { return GPSUnix() - GPSOffset(); }
724 
725  // GPS_UTC_offset 8 13.0
726  uint GPSOffset() const { return pesdata()[13]; }
727  // daylight_savings 16 14.0
728  // DS_status 1 14.0
729  // reserved 2 14.1 3
730  // DS_day_of_month 5 14.3
731  // DS_hour 8 15.0
732  bool InDaylightSavingsTime() const { return ( pesdata()[14]&0x80 ) != 0; }
733  uint DayDaylightSavingsStarts() const { return pesdata()[14]&0x1f; }
734  uint HourDaylightSavingsStarts() const { return pesdata()[15]; }
735  // for (I = 0;I< N;I++) { descriptor() }
736  // CRC_32 32
737 
738  QString toString(void) const override; // PSIPTable
739  QString toStringXML(uint indent_level) const override; // PSIPTable
740 };
741 
746 {
747  public:
749  {
751  }
752  explicit RatingRegionTable(const PSIPTable &table) : PSIPTable(table)
753  {
755  }
756 };
757 
762 {
763  public:
765  : PSIPTable(table)
766  {
768  }
769  explicit DirectedChannelChangeTable(const PSIPTable &table) : PSIPTable(table)
770  {
772  }
773 
774  // Name bits loc expected value
775  // table_id 8 0.0 0xD3
776  // section_syntax_indicator 1 1.0 1
777  // private_indicator 1 1.1 1
778  // reserved 2 1.2 3
779  // section_length 12 1.4 0-4093
780  // dcc_subtype 8 3.0
781  // dcc_id 8 4.0
782  // reserved 2 5.0 3
783  // version_number 5 5.2 0-31
784  // current_next_indicator 1 5.7 1
785  // section_number 8 6.0 0x00
786  // last_section_number 8 7.0 0x00
787  // protocol_version 8 8.0 0x00 for now
788 
789  // dcc_test_count 8 9.0
790  // for (i = 0; i < num_dcc_test_count; i++)
791  // {
792  // dcc_context 1 0.0
793  // reserved 3 0.1 7
794  // dcc_from_major_channel_number 10 0.4
795  // dcc_from_minor_channel_number 10 1.6
796  // reserved 4 3.0 15
797  // dcc_to_major_channel_number 10 3.4
798  // dcc_to_minor_channel_number 10 4.6
799  // dcc_start_time 32 5.0
800  // dcc_end_time 32 9.0
801  // dcc_term_count 8 10.0
802  // for (j=0; j< dcc_term_count; j++) {
803  // dcc_selection_type 8 0.0
804  // dcc_selection_id 64 1.0
805  // reserved 6 9.0
806  // dcc_term_descriptors_length 10 9.6
807  // for (k=0; k<N; k++) {
808  // dcc_term_descriptor()
809  // }
810  // }
811  // reserved 6
812  // dcc_test_descriptors_length 10
813  // for (j=0; j<N; j++) {
814  // dcc_test_descriptor()
815  // }
816  // Reserved 6
817  // dcc_additional_descriptors_length 10
818  // for (i=0; i<N; i++) {
819  // dcc_additional_descriptor()
820  // }
821  // CRC_32
822  // }
823 };
824 
829 {
830  public:
833  : PSIPTable(table)
834  {
836  }
838  : PSIPTable(table)
839  {
841  }
842 
843  // Name bits loc expected value
844  // table_id 8 0.0 0xD4
845  // section_syntax_indicator 1 1.0 1
846  // private_indicator 1 1.1 1
847  // reserved 2 1.2 3
848  // section_length 12 1.4 0-4093
849  // dccsct_type 16 3.0
850  // reserved 2 5.0 3
851  // version_number 5 5.2
852  // current_next_indicator 1 5.7 1
853  // section_number 8 6.0 0x00
854  // last_section_number 8 7.0 0x00
855  // protocol_version 8 8.0
856 
857  // updates_defined 8 9.0
858  // for (i=0; i< updates_defined; i++) {
859  // update_type 8 0.0
860  // update_data_length 8 1.0
861  // if (update_type == new_genre_category) {
862  // genre_category_code 8
863  // genre_category_name_text() var
864  // }
865  // if (update_type == new_state) {
866  // dcc_state_location_code 8
867  // dcc_state_location_code_text() var
868  // }
869  // if (update_type == new_county) {
870  // state_code 8 0.0
871  // reserved 6 1.0 31
872  // dcc_county_location_code 10 1.6
873  // dcc_county_location_code_text() var
874  // }
875  // reserved 6 31
876  // dccsct_descriptors_length 10
877  // for (j=0; j<N; j++) {
878  // dccsct_descriptors()
879  // }
880  // }
881  // reserved 6 31
882  // dccsct_additional_descriptors_length 10
883  // for (i=0; i<N; i++) {
884  // dccsct_additional_descriptors()
885  // }
886  // CRC_32 32
887 };
888 
891 {
892  public:
894  const AggregateEventInformationTable &table) : PSIPTable(table)
895  {
897  }
898  explicit AggregateEventInformationTable(const PSIPTable &table) : PSIPTable(table)
899  {
901  }
902 
903  QString toString(void) const override // PSIPTable
904  { return "AggregateEventInformationTable\n"; }
905  QString toStringXML(uint /*indent_level*/) const override // PSIPTable
906  { return "<AggregateEventInformationTable />"; }
907 
908  // Name bits loc expected value
909  // table_id 8 0.0 0xD6
910  // section_syntax_indicator 1 1.0 1
911  // private_indicator 1 1.1 1
912  // reserved 2 1.2 3
913  // section_length 12 1.4 0-4093
914  // AEIT_subtype 8 3.0 0x00
915  // MGT_tag 8 4.0 0-255
916  // reserved 2 5.0 3
917  // version_number 5 5.2 0-31
918  // current_next_indicator 1 5.7 1
919  // section_number 8 6.0 0x00
920  // last_section_number 8 7.0 0x00
921 
922  // if (AEIT_subtype == 0) {
923  // num_sources_in_section 8 8.0
924  // for (j = 0; j< num_sources_in_section;j++) {
925  // source_id 16 9.0
926  // num_events 8 11.0
927  // for (j = 0; j< num_events;j++) {
928  // off_air 1 0.0 T/F
929  // reserved 1 0.1 1
930  // event_id 14 0.2
931  // start_time 32 2.0
932  // reserved 4 6.0 15
933  // duration 20 6.4
934  // title_length 8 9.0
935  // title_text() var
936  // reserved 4 15
937  // descriptors_length 12
938  // for (i=0;i<N;i++) {
939  // descriptor()
940  // }
941  // }
942  // }
943  // else
944  // reserved
945  // CRC_32 32
946 };
947 
950 {
951  public:
953  const AggregateExtendedTextTable &table) : PSIPTable(table)
954  {
956  }
957  explicit AggregateExtendedTextTable(const PSIPTable &table) : PSIPTable(table)
958  {
960  }
961 
962  QString toString(void) const override // PSIPTable
963  { return "AggregateExtendedTextTable\n"; }
964  QString toStringXML(uint /*indent_level*/) const override // PSIPTable
965  { return "<AggregateExtendedTextTable />"; }
966  // Name bits loc expected value
967  // table_id 8 0.0 0xD7
968  // section_syntax_indicator 1 1.0 1
969  // private_indicator 1 1.1 1
970  // reserved 2 1.2 3
971  // section_length 12 1.4 0-4093
972  // AEIT_subtype 8 3.0 0x00
973  // MGT_tag 8 4.0 0-255
974  // reserved 2 5.0 3
975  // version_number 5 5.2 0-31
976  // current_next_indicator 1 5.7 1
977  // section_number 8 6.0 0x00
978  // last_section_number 8 7.0 0x00
979 
980  // if (AETT_subtype == 0) {
981  // num_blocks_in_section 8 8.0
982  // for (j = 0; j< num_blocks_in_section;j++) {
983  // ETM_id 32 0.0
984  // reserved 4 4.0 15
985  // extended_text_length 12 4.4
986  // extended_text_message() var
987  // }
988  // }
989  // else
990  // reserved
991  // CRC_32 32
992 
993 };
994 
995 #endif // ATSC_TABLES_H
VirtualChannelTable::ETMlocation
uint ETMlocation(uint i) const
Definition: atsctables.h:276
VirtualChannelTable::~VirtualChannelTable
~VirtualChannelTable() override
Definition: atsctables.h:207
TerrestrialVirtualChannelTable::TerrestrialVirtualChannelTable
TerrestrialVirtualChannelTable(const TerrestrialVirtualChannelTable &table)
Definition: atsctables.h:353
CableVirtualChannelTable::CableVirtualChannelTable
CableVirtualChannelTable(const CableVirtualChannelTable &table)
Definition: atsctables.h:422
TableClass::kTableTypes
kTableTypes
Definition: atsctables.h:59
VirtualChannelTable
This table contains information about the channels transmitted on this multiplex.
Definition: atsctables.h:193
TableID::AETT
@ AETT
Definition: mpegtables.h:378
EventInformationTable::LengthInSeconds
uint LengthInSeconds(uint i) const
Definition: atsctables.h:585
ExtendedTextTable::SourceID
uint SourceID(void) const
Definition: atsctables.h:662
TableID::AEIT
@ AEIT
Definition: mpegtables.h:377
DirectedChannelChangeTable::DirectedChannelChangeTable
DirectedChannelChangeTable(const DirectedChannelChangeTable &table)
Definition: atsctables.h:764
VirtualChannelTable::IsAccessControlled
bool IsAccessControlled(uint i) const
Definition: atsctables.h:281
AggregateExtendedTextTable::toStringXML
QString toStringXML(uint) const override
Definition: atsctables.h:964
RatingRegionTable::RatingRegionTable
RatingRegionTable(const PSIPTable &table)
Definition: atsctables.h:752
PSIPTable::SetTableIDExtension
void SetTableIDExtension(uint len)
Definition: mpegtables.h:570
DirectedChannelChangeTable
No one has had time to decode this table yet...
Definition: atsctables.h:761
EventInformationTable::EventInformationTable
EventInformationTable(const PSIPTable &table)
Definition: atsctables.h:534
EventInformationTable::TitleLength
uint TitleLength(uint i) const
Definition: atsctables.h:591
MasterGuideTable::SCTEMapId
uint SCTEMapId() const
Definition: atsctables.h:108
TableID::ETT
@ ETT
Definition: mpegtables.h:366
RatingRegionTable
No one has had time to decode this table yet...
Definition: atsctables.h:745
EventInformationTable::DescriptorsLength
uint DescriptorsLength(uint i) const
Definition: atsctables.h:600
VirtualChannelTable::VirtualChannelTable
VirtualChannelTable(const PSIPTable &table)
Definition: atsctables.h:201
ExtendedTextTable::ExtendedTextTableID
uint ExtendedTextTableID() const
Definition: atsctables.h:652
EventInformationTable::~EventInformationTable
~EventInformationTable() override
Definition: atsctables.h:539
mythtvexp.h
SystemTimeTable::SystemTimeTable
SystemTimeTable(const PSIPTable &table)
Definition: atsctables.h:691
MasterGuideTable::GlobalDescriptorsLength
uint GlobalDescriptorsLength() const
Definition: atsctables.h:165
PESPacket::pesdata
const unsigned char * pesdata() const
Definition: pespacket.h:166
CableVirtualChannelTable::SCTEIsChannelNumberOnePart
bool SCTEIsChannelNumberOnePart(uint i) const
Definition: atsctables.h:469
SystemTimeTable::DayDaylightSavingsStarts
uint DayDaylightSavingsStarts() const
Definition: atsctables.h:733
VirtualChannelTable::ShortChannelName
QString ShortChannelName(uint i) const
Definition: atsctables.h:230
TableClass
Definition: atsctables.h:56
VirtualChannelTable::SourceID
uint SourceID(uint i) const
Definition: atsctables.h:304
AggregateExtendedTextTable::toString
QString toString(void) const override
Definition: atsctables.h:962
AggregateExtendedTextTable::AggregateExtendedTextTable
AggregateExtendedTextTable(const AggregateExtendedTextTable &table)
Definition: atsctables.h:952
TableID::CVCT
@ CVCT
Definition: mpegtables.h:363
CableVirtualChannelTable::SCTEMapId
uint SCTEMapId() const
Definition: atsctables.h:448
EventInformationTable::EventCount
uint EventCount() const
Definition: atsctables.h:557
SystemTimeTable::SystemTimeGPS
QDateTime SystemTimeGPS(void) const
Definition: atsctables.h:716
DirectedChannelChangeSelectionCodeTable
No one has had time to decode this table yet...
Definition: atsctables.h:828
VirtualChannelTable::ProgramNumber
uint ProgramNumber(uint i) const
Definition: atsctables.h:271
MasterGuideTable::m_ptrs
std::vector< unsigned char * > m_ptrs
Definition: atsctables.h:184
MasterGuideTable::TableCount
uint TableCount() const
Definition: atsctables.h:120
CableVirtualChannelTable::~CableVirtualChannelTable
~CableVirtualChannelTable() override
Definition: atsctables.h:432
VirtualChannelTable::IsHiddenInGuide
bool IsHiddenInGuide(uint i) const
Definition: atsctables.h:292
AggregateEventInformationTable::toString
QString toString(void) const override
Definition: atsctables.h:903
VirtualChannelTable::Descriptors
const unsigned char * Descriptors(uint i) const
Definition: atsctables.h:315
atscdescriptors.h
VirtualChannelTable::IsHidden
bool IsHidden(uint i) const
Definition: atsctables.h:286
VirtualChannelTable::m_ptrs
std::vector< unsigned char * > m_ptrs
Definition: atsctables.h:342
TableID::RRT
@ RRT
Definition: mpegtables.h:364
Parse
Definition: rssparse.h:188
VirtualChannelTable::ChannelTransportStreamID
uint ChannelTransportStreamID(uint i) const
Definition: atsctables.h:266
PSIPTable
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:409
VirtualChannelTable::XMLChannelValues
virtual QString XMLChannelValues(uint indent_level, uint channel) const
Definition: atsctables.cpp:304
PSIPTable::toString
virtual QString toString(void) const
Definition: mpegtables.cpp:764
VirtualChannelTable::MajorChannel
uint MajorChannel(uint i) const
Definition: atsctables.h:249
SystemTimeTable::GPSOffset
uint GPSOffset() const
Definition: atsctables.h:726
mythdate.h
SystemTimeTable::HourDaylightSavingsStarts
uint HourDaylightSavingsStarts() const
Definition: atsctables.h:734
minor
#define minor(X)
Definition: compat.h:76
MythDate::fromSecsSinceEpoch
MBASE_PUBLIC QDateTime fromSecsSinceEpoch(int64_t seconds)
This function takes the number of seconds since the start of the epoch and returns a QDateTime with t...
Definition: mythdate.cpp:72
ExtendedTextTable::~ExtendedTextTable
~ExtendedTextTable() override
Definition: atsctables.h:637
VirtualChannelTable::VirtualChannelTable
VirtualChannelTable(const VirtualChannelTable &table)
Definition: atsctables.h:196
MasterGuideTable::TableCountRaw
uint TableCountRaw() const
Definition: atsctables.h:121
MasterGuideTable::TablePID
uint TablePID(uint i) const
Definition: atsctables.h:132
TerrestrialVirtualChannelTable::TerrestrialVirtualChannelTable
TerrestrialVirtualChannelTable(const PSIPTable &table)
Definition: atsctables.h:358
SystemTimeTable::SystemTimeTable
SystemTimeTable(const SystemTimeTable &table)
Definition: atsctables.h:687
MasterGuideTable::TableVersion
uint TableVersion(uint i) const
Definition: atsctables.h:138
AggregateExtendedTextTable
SCTE 65 & ATSC/81 0xD7.
Definition: atsctables.h:949
MasterGuideTable::TableDescriptorsBytes
uint TableDescriptorsBytes(uint i) const
Definition: atsctables.h:143
MasterGuideTable::MasterGuideTable
MasterGuideTable(const MasterGuideTable &table)
Definition: atsctables.h:82
VirtualChannelTable::ChannelCountRaw
uint ChannelCountRaw() const
Definition: atsctables.h:226
MasterGuideTable::MasterGuideTable
MasterGuideTable(const PSIPTable &table)
Definition: atsctables.h:87
VirtualChannelTable::ChannelString
virtual QString ChannelString(uint channel) const =0
PSIPTable::toStringXML
virtual QString toStringXML(uint indent_level) const
Definition: mpegtables.cpp:782
MultipleStringStructure
Definition: atscdescriptors.h:16
TableID::STT
@ STT
Definition: mpegtables.h:367
mpegtables.h
TableID::EIT
@ EIT
Definition: mpegtables.h:365
MasterGuideTable::TableDescriptorsLength
uint TableDescriptorsLength(uint i) const
Definition: atsctables.h:150
EventInformationTable
EventInformationTables contain program titles, start times, and channel information.
Definition: atsctables.h:525
EventInformationTable::StartTimeRaw
uint StartTimeRaw(uint i) const
Definition: atsctables.h:568
CableVirtualChannelTable::CableVirtualChannelTable
CableVirtualChannelTable(const PSIPTable &table)
Definition: atsctables.h:427
uint
unsigned int uint
Definition: compat.h:79
MasterGuideTable::~MasterGuideTable
~MasterGuideTable() override
Definition: atsctables.h:92
EventInformationTable::ETMLocation
uint ETMLocation(uint i) const
Definition: atsctables.h:580
VirtualChannelTable::GlobalDescriptors
const unsigned char * GlobalDescriptors() const
Definition: atsctables.h:328
SystemTimeTable::GPSUnix
time_t GPSUnix(void) const
Definition: atsctables.h:720
DirectedChannelChangeSelectionCodeTable::DirectedChannelChangeSelectionCodeTable
DirectedChannelChangeSelectionCodeTable(const PSIPTable &table)
Definition: atsctables.h:837
DirectedChannelChangeSelectionCodeTable::DirectedChannelChangeSelectionCodeTable
DirectedChannelChangeSelectionCodeTable(const DirectedChannelChangeSelectionCodeTable &table)
Definition: atsctables.h:831
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MasterGuideTable
This table tells the decoder on which PIDs to find other tables, and their sizes and each table's cur...
Definition: atsctables.h:79
VirtualChannelTable::DescriptorsLength
uint DescriptorsLength(uint i) const
Definition: atsctables.h:310
CableVirtualChannelTable::IsPathSelect
bool IsPathSelect(uint i) const
Definition: atsctables.h:495
ExtendedTextTable::SetExtendedTextTableID
void SetExtendedTextTableID(uint id)
Definition: atsctables.h:653
TableID::DCCSCT
@ DCCSCT
Definition: mpegtables.h:375
VirtualChannelTable::GlobalDescriptorsLength
uint GlobalDescriptorsLength() const
Definition: atsctables.h:322
TerrestrialVirtualChannelTable::~TerrestrialVirtualChannelTable
~TerrestrialVirtualChannelTable() override
Definition: atsctables.h:363
MasterGuideTable::TableDescriptors
const unsigned char * TableDescriptors(uint i) const
Definition: atsctables.h:159
AggregateEventInformationTable
SCTE 65 & ATSC/81 0xD6.
Definition: atsctables.h:890
assert
#define assert(x)
Definition: audiooutputalsa.cpp:16
DirectedChannelChangeTable::DirectedChannelChangeTable
DirectedChannelChangeTable(const PSIPTable &table)
Definition: atsctables.h:769
mythmiscutil.h
GPS_EPOCH
static constexpr qint64 GPS_EPOCH
Seconds between start of GPS time and the start of UNIX time.
Definition: mpegtables.h:31
ExtendedTextTable::ExtendedTextTable
ExtendedTextTable(const PSIPTable &table)
Definition: atsctables.h:633
VirtualChannelTable::ServiceType
uint ServiceType(uint i) const
Definition: atsctables.h:298
ExtendedTextTable::IsEventETM
bool IsEventETM(void) const
Definition: atsctables.h:661
ExtendedTextTable::ExtendedTextTable
ExtendedTextTable(const ExtendedTextTable &table)
Definition: atsctables.h:629
PSIPTable::TableID
uint TableID(void) const
Definition: mpegtables.h:515
PSIPTable::TableIDExtension
uint TableIDExtension(void) const
Definition: mpegtables.h:534
RatingRegionTable::RatingRegionTable
RatingRegionTable(const RatingRegionTable &table)
Definition: atsctables.h:748
CableVirtualChannelTable::SCTEIsChannelNumberTwoPart
bool SCTEIsChannelNumberTwoPart(uint i) const
Definition: atsctables.h:473
ExtendedTextTable::ExtendedTextMessage
MultipleStringStructure ExtendedTextMessage() const
Definition: atsctables.h:668
TerrestrialVirtualChannelTable
This table contains information about the terrestrial channels transmitted on this multiplex.
Definition: atsctables.h:350
SystemTimeTable::InDaylightSavingsTime
bool InDaylightSavingsTime() const
Definition: atsctables.h:732
MasterGuideTable::GlobalDescriptors
const unsigned char * GlobalDescriptors() const
Definition: atsctables.h:171
TableID::DCCT
@ DCCT
Definition: mpegtables.h:374
EventInformationTable::StartTimeGPS
QDateTime StartTimeGPS(uint i) const
Definition: atsctables.h:573
SystemTimeTable::GPSRaw
uint32_t GPSRaw(void) const
Definition: atsctables.h:711
TableID::TVCT
@ TVCT
Definition: mpegtables.h:362
EventInformationTable::Descriptors
const unsigned char * Descriptors(uint i) const
Definition: atsctables.h:608
CableVirtualChannelTable::SCTEOnePartChannel
uint SCTEOnePartChannel(uint i) const
Definition: atsctables.h:480
AggregateExtendedTextTable::AggregateExtendedTextTable
AggregateExtendedTextTable(const PSIPTable &table)
Definition: atsctables.h:957
CableVirtualChannelTable
This table contains information about the cable channels transmitted on this multiplex.
Definition: atsctables.h:419
EventInformationTable::EventID
uint EventID(uint i) const
Definition: atsctables.h:563
SystemTimeTable
This table contains the GPS time at the time of transmission.
Definition: atsctables.h:684
AggregateEventInformationTable::AggregateEventInformationTable
AggregateEventInformationTable(const PSIPTable &table)
Definition: atsctables.h:898
ExtendedTextTable
ExtendedTextTable contain additional text not contained in EventInformationTables.
Definition: atsctables.h:626
EventInformationTable::title
MultipleStringStructure title(int i) const
Definition: atsctables.h:594
AggregateEventInformationTable::toStringXML
QString toStringXML(uint) const override
Definition: atsctables.h:905
EventInformationTable::EventCountRaw
uint EventCountRaw() const
Definition: atsctables.h:558
ExtendedTextTable::IsChannelETM
bool IsChannelETM(void) const
Definition: atsctables.h:660
SystemTimeTable::UTCUnix
time_t UTCUnix(void) const
Definition: atsctables.h:722
VirtualChannelTable::ModulationMode
uint ModulationMode(uint i) const
Definition: atsctables.h:259
MasterGuideTable::TableType
uint TableType(uint i) const
Definition: atsctables.h:124
TableID::MGT
@ MGT
Definition: mpegtables.h:361
VirtualChannelTable::ChannelCount
uint ChannelCount() const
Definition: atsctables.h:225
VirtualChannelTable::TransportStreamID
uint TransportStreamID() const
Definition: atsctables.h:222
ExtendedTextTable::EventID
uint EventID(void) const
Definition: atsctables.h:664
EventInformationTable::EventInformationTable
EventInformationTable(const EventInformationTable &table)
Definition: atsctables.h:528
AggregateEventInformationTable::AggregateEventInformationTable
AggregateEventInformationTable(const AggregateEventInformationTable &table)
Definition: atsctables.h:893
EventInformationTable::m_ptrs
std::vector< unsigned char * > m_ptrs
Definition: atsctables.h:618
CableVirtualChannelTable::IsOutOfBand
bool IsOutOfBand(uint i) const
Definition: atsctables.h:500
VirtualChannelTable::MinorChannel
uint MinorChannel(uint i) const
Definition: atsctables.h:254
EventInformationTable::SourceID
uint SourceID() const
Definition: atsctables.h:554
PSIPTable::psipdata
const unsigned char * psipdata(void) const
Definition: mpegtables.h:560