libdvbv5 1.26.1
Library to work with Digital TV devices on Linux
eit.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
3 * Copyright (c) 2012 - Andre Roth <neolynx@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation version 2.1 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 Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser 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 _EIT_H
41#define _EIT_H
42
43#include <stdint.h>
44#include <unistd.h> /* ssize_t */
45#include <time.h>
46
47#include <libdvbv5/header.h>
48
68#define DVB_TABLE_EIT 0x4E
69#define DVB_TABLE_EIT_OTHER 0x4F
70#define DVB_TABLE_EIT_PID 0x12
71
72#define DVB_TABLE_EIT_SCHEDULE 0x50
73#define DVB_TABLE_EIT_SCHEDULE_OTHER 0x60
74
106 uint16_t event_id;
107 union {
108 uint16_t bitfield1; /* first 2 bytes are MJD, they need to be bswapped */
109 uint8_t dvbstart[5];
110 } __attribute__((packed));
111 uint8_t dvbduration[3];
112 union {
113 uint16_t bitfield2;
114 struct {
115 uint16_t desc_length:12;
116 uint16_t free_CA_mode:1;
117 uint16_t running_status:3;
118 } __attribute__((packed));
119 } __attribute__((packed));
122 struct tm start;
123 uint32_t duration;
124 uint16_t service_id;
125} __attribute__((packed));
126
148 uint16_t transport_id;
149 uint16_t network_id;
153} __attribute__((packed));
154
162#define dvb_eit_event_foreach(_event, _eit) \
163 if (_eit && _eit->event) \
164 for( struct dvb_table_eit_event *_event = _eit->event; _event; _event = _event->next ) \
165
166struct dvb_v5_fe_parms;
167
169extern const char *dvb_eit_running_status_name[8];
170
171#ifdef __cplusplus
172extern "C" {
173#endif
174
191ssize_t dvb_table_eit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
192 ssize_t buflen, struct dvb_table_eit **table);
193
201
210 struct dvb_table_eit *table);
211
220void dvb_time(const uint8_t data[5], struct tm *tm);
221
222#ifdef __cplusplus
223}
224#endif
225
226#endif
const char * dvb_eit_running_status_name[8]
Converts a running_status field into string.
ssize_t dvb_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_eit **table)
Initializes and parses EIT table.
void dvb_table_eit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_eit *table)
Prints the content of the DVB EIT table.
void dvb_table_eit_free(struct dvb_table_eit *table)
Frees all data allocated by the DVB EIT table parser.
void dvb_time(const uint8_t data[5], struct tm *tm)
Converts a DVB EIT formatted timestamp into struct tm.
Provides the MPEG TS table headers.
Linked list containing the several descriptors found on a MPEG-TS table.
DVB EIT event table.
Definition eit.h:105
uint16_t bitfield1
Definition eit.h:108
uint16_t free_CA_mode
Definition eit.h:116
uint32_t duration
Definition eit.h:123
uint8_t dvbstart[5]
Definition eit.h:109
uint8_t dvbduration[3]
Definition eit.h:111
uint16_t running_status
Definition eit.h:117
struct dvb_desc * descriptor
Definition eit.h:120
uint16_t event_id
Definition eit.h:106
struct tm start
Definition eit.h:122
uint16_t service_id
Definition eit.h:124
struct dvb_table_eit_event * next
Definition eit.h:121
uint16_t bitfield2
Definition eit.h:113
uint16_t desc_length
Definition eit.h:115
DVB EIT table.
Definition eit.h:146
uint8_t last_table_id
Definition eit.h:151
uint16_t transport_id
Definition eit.h:148
struct dvb_table_header header
Definition eit.h:147
uint16_t network_id
Definition eit.h:149
uint8_t last_segment
Definition eit.h:150
struct dvb_table_eit_event * event
Definition eit.h:152
Header of a MPEG-TS table.
Definition header.h:103
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117