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