This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheit_processor.hpp
61 lines (52 loc) · 1.78 KB
/
eit_processor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef __EIT_PROCESSOR_HPP__
#define __EIT_PROCESSOR_HPP__
#include "section_buffer.hpp"
#include "Event.hpp"
#include <stdint.h>
#include <map>
#include <list>
struct channel_id {
uint16_t original_network_id;
uint16_t transport_stream_id;
uint16_t service_id;
bool operator< (const struct channel_id &that) const {
if( this->original_network_id != that.original_network_id )
return this->original_network_id < that.original_network_id;
if( this->transport_stream_id != that.transport_stream_id )
return this->transport_stream_id < that.transport_stream_id;
return this->service_id < that.service_id;
}
};
class EIT_processor_channel; // declaration
class EIT_processor_channel_table {
public:
EIT_processor_channel *m_parent;
uint8_t m_version;
uint8_t m_waiting_for_section;
bool m_waiting_for_section_gap_allowed;
std::list< Event* > m_events;
EIT_processor_channel_table(EIT_processor_channel *parent, uint8_t ver = 0);
~EIT_processor_channel_table();
void parse_table(const unsigned char *table, size_t ntable);
};
class EIT_processor; // declaration
class EIT_processor_channel {
public:
EIT_processor *m_parent;
struct channel_id m_chan;
uint8_t m_last_table_id;
std::map< uint8_t, EIT_processor_channel_table* > m_tables;
std::map< uint8_t, EIT_processor_channel_table* > m_tables_processing;
EIT_processor_channel(EIT_processor *parent);
~EIT_processor_channel();
void parse_table(const unsigned char *table, size_t ntable);
void table_done(uint8_t table_id);
};
class EIT_processor: public Section_Processor {
public:
std::map< struct channel_id, EIT_processor_channel > m_channels;
time_t m_current_datetime;
virtual void process_sections(const unsigned char *sections, size_t nsections);
void channel_done(struct channel_id chan);
};
#endif // __EIT_PROCESSOR_HPP__