eit.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2012 - Mauro Carvalho Chehab
* Copyright (c) 2012 - Andre Roth <neolynx@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation version 2.1 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
*/
#ifndef _EIT_H
#define _EIT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <time.h>
#include <libdvbv5/header.h>
#define DVB_TABLE_EIT 0x4E
#define DVB_TABLE_EIT_OTHER 0x4F
#define DVB_TABLE_EIT_PID 0x12
#define DVB_TABLE_EIT_SCHEDULE 0x50
#define DVB_TABLE_EIT_SCHEDULE_OTHER 0x60
struct dvb_table_eit_event {
uint16_t event_id;
union {
uint16_t bitfield1; /* first 2 bytes are MJD, they need to be bswapped */
uint8_t dvbstart[5];
} __attribute__((packed));
uint8_t dvbduration[3];
union {
uint16_t bitfield2;
struct {
uint16_t desc_length:12;
uint16_t free_CA_mode:1;
uint16_t running_status:3;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_desc *descriptor;
struct dvb_table_eit_event *next;
struct tm start;
uint32_t duration;
uint16_t service_id;
} __attribute__((packed));
struct dvb_table_eit {
struct dvb_table_header header;
uint16_t transport_id;
uint16_t network_id;
uint8_t last_segment;
uint8_t last_table_id;
struct dvb_table_eit_event *event;
} __attribute__((packed));
#define dvb_eit_event_foreach(_event, _eit) \
if (_eit && _eit->event) \
for( struct dvb_table_eit_event *_event = _eit->event; _event; _event = _event->next ) \
struct dvb_v5_fe_parms;
extern const char *dvb_eit_running_status_name[8];
#ifdef __cplusplus
extern "C" {
#endif
ssize_t dvb_table_eit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct dvb_table_eit **table);
void dvb_table_eit_free(struct dvb_table_eit *table);
void dvb_table_eit_print(struct dvb_v5_fe_parms *parms,
struct dvb_table_eit *table);
void dvb_time(const uint8_t data[5], struct tm *tm);
#ifdef __cplusplus
}
#endif
#endif
dvb_eit_running_status_name
const char * dvb_eit_running_status_name[8]
Converts a running_status field into string.
dvb_table_eit_init
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.
dvb_table_eit_print
void dvb_table_eit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_eit *table)
Prints the content of the DVB EIT table.
dvb_table_eit_free
void dvb_table_eit_free(struct dvb_table_eit *table)
Frees all data allocated by the DVB EIT table parser.
dvb_time
void dvb_time(const uint8_t data[5], struct tm *tm)
Converts a DVB EIT formatted timestamp into struct tm.
header.h
Provides the MPEG TS table headers.
dvb_desc
Linked list containing the several descriptors found on a MPEG-TS table.
Definition descriptors.h:117
dvb_table_eit_event
DVB EIT event table.
Definition eit.h:105
dvb_table_eit_event::bitfield1
uint16_t bitfield1
Definition eit.h:108
dvb_table_eit_event::free_CA_mode
uint16_t free_CA_mode
Definition eit.h:116
dvb_table_eit_event::duration
uint32_t duration
Definition eit.h:123
dvb_table_eit_event::dvbstart
uint8_t dvbstart[5]
Definition eit.h:109
dvb_table_eit_event::dvbduration
uint8_t dvbduration[3]
Definition eit.h:111
dvb_table_eit_event::running_status
uint16_t running_status
Definition eit.h:117
dvb_table_eit_event::descriptor
struct dvb_desc * descriptor
Definition eit.h:120
dvb_table_eit_event::event_id
uint16_t event_id
Definition eit.h:106
dvb_table_eit_event::start
struct tm start
Definition eit.h:122
dvb_table_eit_event::service_id
uint16_t service_id
Definition eit.h:124
dvb_table_eit_event::next
struct dvb_table_eit_event * next
Definition eit.h:121
dvb_table_eit_event::bitfield2
uint16_t bitfield2
Definition eit.h:113
dvb_table_eit_event::desc_length
uint16_t desc_length
Definition eit.h:115
dvb_table_eit
DVB EIT table.
Definition eit.h:146
dvb_table_eit::last_table_id
uint8_t last_table_id
Definition eit.h:151
dvb_table_eit::transport_id
uint16_t transport_id
Definition eit.h:148
dvb_table_eit::header
struct dvb_table_header header
Definition eit.h:147
dvb_table_eit::network_id
uint16_t network_id
Definition eit.h:149
dvb_table_eit::last_segment
uint8_t last_segment
Definition eit.h:150
dvb_table_eit::event
struct dvb_table_eit_event * event
Definition eit.h:152
dvb_table_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117