8 #include "TS/ts_packet.h"
13 using namespace TS::PSI;
14 using namespace TS::PSI::ARIB;
15 using namespace TS::Description::ARIB;
26 uint16_t transport_stream_id;
27 uint16_t original_network_id;
30 struct Less : public std::binary_function< SERVICE, SERVICE, bool> {
31 bool operator()( const SERVICE &a, const SERVICE &b) const {
32 if( a.original_network_id < b.original_network_id) {
35 else if( a.transport_stream_id < a.transport_stream_id) {
38 else if( a.service_id < b.service_id) {
50 std::string description;
59 typedef std::list< ITEM> ITEMS;
71 typedef std::vector< uint8_t> CATEGORYS;
89 struct Less : public std::binary_function< EVENT, EVENT, bool> {
90 bool operator()( const EVENT &a, const EVENT &b) const {
91 return (a.start_time < b.start_time);
97 typedef std::map< uint8_t , EIT*> EITS;
99 typedef std::map< SERVICE, std::string, SERVICE::Less> SERVICES;
100 // typedef std::set< EVENT, EVENT::Less> EVENTS;
101 typedef std::map< uint16_t, EVENT> EVENTS;
102 typedef std::map< SERVICE, EVENTS, SERVICE::Less> EPG_DATA;
104 static const int32_t EIT_PID_NUM = 3;
105 static const uint16_t SDT_PID = 0x0011;
106 static const uint16_t EIT_PID[ EIT_PID_NUM];
107 static const int32_t CONTENT_NUM = 16;
109 static const CONTENT contents[ CONTENT_NUM];
111 AribDescriptorParser descriptor_parser;
119 const std::string channel;
122 EPG( std::string ch);
125 bool append( TSPacket *ts);
126 bool write( const char *xml_file);
129 bool appendSDT( TSPacket *ts);
130 bool appendEIT( TSPacket *ts);
132 void appendEvnet( EIT *p);
134 const std::string createChannelID( const SERVICE *s);
136 void convertCharactor( std::string *str);
138 bool writeHeader( int fd);
139 bool writeChannel( int fd);
140 bool writeFooter( int fd);