libdvbv5  1.6.0
Library to work with Digital TV devices on Linux
atsc_eit.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation version 2
7  * of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18  *
19  */
20 
40 #ifndef _ATSC_EIT_H
41 #define _ATSC_EIT_H
42 
43 #include <stdint.h>
44 #include <unistd.h> /* ssize_t */
45 #include <time.h>
46 
47 #include <libdvbv5/atsc_header.h>
48 
54 #define ATSC_TABLE_EIT 0xCB
55 
83  union {
84  uint16_t bitfield;
85  struct {
86  uint16_t event_id:14;
87  uint16_t one:2;
88  } __attribute__((packed));
89  } __attribute__((packed));
90  uint32_t start_time;
91  union {
92  uint32_t bitfield2;
93  struct {
94  uint32_t title_length:8;
95  uint32_t duration:20;
96  uint32_t etm:2;
97  uint32_t one2:2;
98  uint32_t :2;
99  } __attribute__((packed));
100  } __attribute__((packed));
103  struct tm start;
104  uint16_t source_id;
105 } __attribute__((packed));
106 
123  uint16_t bitfield;
124  struct {
125  uint16_t desc_length:12;
126  uint16_t reserved:4;
127  } __attribute__((packed));
128 } __attribute__((packed));
129 
150  uint8_t events;
152 } __attribute__((packed));
153 
161 #define atsc_eit_event_foreach(_event, _eit) \
162  for( struct atsc_table_eit_event *_event = _eit->event; _event; _event = _event->next ) \
163 
164 struct dvb_v5_fe_parms;
165 
166 #ifdef __cplusplus
167 extern "C" {
168 #endif
169 
186 ssize_t atsc_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
187  ssize_t buflen, struct atsc_table_eit **table);
188 
195 void atsc_table_eit_free(struct atsc_table_eit *table);
196 
204 void atsc_table_eit_print(struct dvb_v5_fe_parms *parms,
205  struct atsc_table_eit *table);
206 
215 void atsc_time(const uint32_t start_time, struct tm *tm);
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif
Header of a MPEG-TS table.
Definition: header.h:93
struct atsc_table_eit_event * next
Definition: atsc_eit.h:102
struct dvb_desc * descriptor
Definition: atsc_eit.h:101
uint16_t bitfield
Definition: atsc_eit.h:84
void atsc_time(const uint32_t start_time, struct tm *tm)
Converts an ATSC EIT formatted timestamp into struct tm.
uint16_t event_id
Definition: atsc_eit.h:86
ATSC EIT descriptor length.
Definition: atsc_eit.h:122
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:118
struct atsc_table_eit_event * event
Definition: atsc_eit.h:151
void atsc_table_eit_print(struct dvb_v5_fe_parms *parms, struct atsc_table_eit *table)
Prints the content of the ATSC EIT table.
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:118
uint32_t title_length
Definition: atsc_eit.h:94
uint32_t start_time
Definition: atsc_eit.h:90
ATSC EIT event table.
Definition: atsc_eit.h:82
uint32_t bitfield2
Definition: atsc_eit.h:92
uint8_t events
Definition: atsc_eit.h:150
struct dvb_table_header header
Definition: atsc_eit.h:148
ssize_t atsc_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_eit **table)
Initializes and parses ATSC EIT table.
void atsc_table_eit_free(struct atsc_table_eit *table)
Frees all data allocated by the ATSC EIT table parser.
uint8_t protocol_version
Definition: atsc_eit.h:149
uint16_t source_id
Definition: atsc_eit.h:104
ATSC EIT table.
Definition: atsc_eit.h:147
uint32_t duration
Definition: atsc_eit.h:95
Provides some common ATSC stuff.