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