6 #include "../TS/utils.h"
7 #include "descriptor.h"
14 class ServiceInformation : public TS::PSI::Section
17 static const uint32_t SI_PARSE_SIZE = 5;
21 uint16_t network_id; // NIT, TLV-NIT
22 uint16_t bouquet_id; // BAT
23 uint16_t transport_stream_id; // SDT
24 uint16_t service_id; // EIT, PCAT
25 uint16_t original_network_id; // BIT, NBIT
26 uint16_t original_service_id; // LDT
27 uint16_t table_id_extension; // AMT
30 uint8_t reserved_2; // 2bit
31 uint8_t version_number; // 5bit
32 uint8_t current_next_indicator; // 1bit
33 uint8_t section_number; // 8bit
34 uint8_t last_section_number; // 8bit
36 ServiceInformation( int32_t id = -1, TS::Description::DescriptorParser *des_parser = NULL);
37 virtual ~ServiceInformation();
40 STATUS parse( SectionBuffer &sec);
41 virtual STATUS parseSection( SectionBuffer &sec);
44 class NIT : public ServiceInformation
47 static const uint32_t STREAM_HEADER_SIZE = 6;
51 uint16_t transport_stream_id; // 16bit
52 uint16_t original_network_id; // 16bit
53 uint8_t reserved_future_use; // 4bit
54 uint16_t transport_descriptors_length; // 12bit
55 DESCRIPTORS descriptors;
57 typedef std::list< STREAM> STREAMS;
59 uint8_t reserved_future_use1; // 4bit
60 uint16_t network_descriptors_length; // 12bit
62 uint8_t reserved_future_use2; // 4bit
63 uint16_t transport_stream_loop_length; // 12bit
67 NIT( TS::Description::DescriptorParser *des_parser = NULL);
73 STATUS parseSection( SectionBuffer &sec);
74 bool checkID( uint8_t id);
81 class SDT : public ServiceInformation
84 static const uint32_t SD_PARSE_SIZE = 3;
85 static const uint32_t SERVICE_HEADER_SIZE = 5;
89 uint16_t service_id; // 16bit
90 uint8_t reserved_future_use; // 3bit
91 uint8_t EIT_user_defined_flags; // 3bit
92 uint8_t EIT_schedule_flag; // 1bit
93 uint8_t EIT_present_following_flag; // 1bit
94 uint8_t running_status; // 3bit
95 uint8_t free_CA_mode; // 1bit
96 uint16_t descriptors_loop_length; // 12bit
97 DESCRIPTORS descriptors;
99 typedef std::list< SERVICE> SERVICES;
101 uint16_t original_network_id; // 16bit
102 uint8_t reserved_future_use; // 8bit
106 SDT( TS::Description::DescriptorParser *des_parser = NULL);
112 STATUS parseSection( SectionBuffer &sec);
113 bool checkID( uint8_t id);
120 class EIT : public ServiceInformation
123 static const uint32_t EI_PARSE_SIZE = 6;
124 static const uint32_t EVENT_HEADER_SIZE = 12;
129 uint16_t event_id; // 16bit
130 time_t start_time; // 40bit
131 int32_t duration; // 24bit sec
132 uint8_t running_status; // 3bit
133 uint8_t free_CA_mode; // 1bit
134 uint16_t descriptors_loop_length; // 12bit
135 DESCRIPTORS descriptors;
137 typedef std::list< EVENT> EVENTS;
139 uint16_t transport_stream_id; // 16bit
140 uint16_t original_network_id; // 16bit
141 uint8_t segment_last_section_number; // 8bit
142 uint8_t last_table_id; // 8bit
146 EIT( TS::Description::DescriptorParser *des_parser = NULL);
152 STATUS parseSection( SectionBuffer &sec);
153 bool checkID( uint8_t id);
163 network_information_section(){
164 reserved_future_use 4 bslbf
165 network_descriptors_length 12 uimsbf
167 bouquet_association_section(){
168 reserved_future_use 4 bslbf
169 bouquet_descriptors_length 12 uimsbf
171 service description section(){
172 original_network_id 16 uimsbf
173 reserved_future_use 8 bslbf
175 event_information_section(){
176 transport_stream_id 16 uimsbf
177 original_network_id 16 uimsbf
178 segment_last_section_number 8 uimsbf
179 last_table_id 8 uimsbf
181 partial_content_announcement_section(){
182 transport_stream_id 16 uimsbf
183 original_network_id 16 uimsbf
185 num_of_content_version 8 uimsbf
187 broadcaster_information _section(){
188 reserved_future_use 3 bslbf
189 broadcast_view_propriety 1 bslbf
190 first_descriptors_length 12 uimsbf
192 network_board_information_section()
194 linked_description_section(){
195 transport_stream_id 16 uimsbf
196 original_network_id 16 uimsbf
198 TLV_network_information_table( ){
199 reserved_future_use 4 bslbf
200 network_descriptors_length 12 bslbf
202 address_map_table() {
203 num_of_service_id 10 uimsbf
204 reserved_future_use 6 bslbf