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