atsc_eit.h
Go to the documentation of this file.
/*
* Copyright (c) 2013 - 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 _ATSC_EIT_H
#define _ATSC_EIT_H
#include <stdint.h>
#include <unistd.h> /* ssize_t */
#include <time.h>
#include <libdvbv5/atsc_header.h>
#define ATSC_TABLE_EIT 0xCB
struct atsc_table_eit_event {
union {
uint16_t bitfield;
struct {
uint16_t event_id:14;
uint16_t one:2;
} __attribute__((packed));
} __attribute__((packed));
uint32_t start_time;
union {
uint32_t bitfield2;
struct {
uint32_t title_length:8;
uint32_t duration:20;
uint32_t etm:2;
uint32_t one2:2;
uint32_t :2;
} __attribute__((packed));
} __attribute__((packed));
struct dvb_desc *descriptor;
struct atsc_table_eit_event *next;
struct tm start;
uint16_t source_id;
} __attribute__((packed));
union atsc_table_eit_desc_length {
uint16_t bitfield;
struct {
uint16_t desc_length:12;
uint16_t reserved:4;
} __attribute__((packed));
} __attribute__((packed));
struct atsc_table_eit {
struct dvb_table_header header;
uint8_t protocol_version;
uint8_t events;
struct atsc_table_eit_event *event;
} __attribute__((packed));
#define atsc_eit_event_foreach(_event, _eit) \
if (_eit && _eit->event) \
for( struct atsc_table_eit_event *_event = _eit->event; _event; _event = _event->next ) \
struct dvb_v5_fe_parms;
#ifdef __cplusplus
extern "C" {
#endif
ssize_t atsc_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
ssize_t buflen, struct atsc_table_eit **table);
void atsc_table_eit_free(struct atsc_table_eit *table);
void atsc_table_eit_print(struct dvb_v5_fe_parms *parms,
struct atsc_table_eit *table);
void atsc_time(const uint32_t start_time, struct tm *tm);
#ifdef __cplusplus
}
#endif
#endif
atsc_header.h
Provides some common ATSC stuff.
atsc_time
void atsc_time(const uint32_t start_time, struct tm *tm)
Converts an ATSC EIT formatted timestamp into struct tm.
atsc_table_eit_init
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.
atsc_table_eit_free
void atsc_table_eit_free(struct atsc_table_eit *table)
Frees all data allocated by the ATSC EIT table parser.
atsc_table_eit_print
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_table_eit_event
ATSC EIT event table.
Definition atsc_eit.h:81
atsc_table_eit_event::event_id
uint16_t event_id
Definition atsc_eit.h:85
atsc_table_eit_event::source_id
uint16_t source_id
Definition atsc_eit.h:103
atsc_table_eit_event::duration
uint32_t duration
Definition atsc_eit.h:94
atsc_table_eit_event::title_length
uint32_t title_length
Definition atsc_eit.h:93
atsc_table_eit_event::bitfield2
uint32_t bitfield2
Definition atsc_eit.h:91
atsc_table_eit_event::next
struct atsc_table_eit_event * next
Definition atsc_eit.h:101
atsc_table_eit_event::one2
uint32_t one2
Definition atsc_eit.h:96
atsc_table_eit_event::one
uint16_t one
Definition atsc_eit.h:86
atsc_table_eit_event::etm
uint32_t etm
Definition atsc_eit.h:95
atsc_table_eit_event::descriptor
struct dvb_desc * descriptor
Definition atsc_eit.h:100
atsc_table_eit_event::bitfield
uint16_t bitfield
Definition atsc_eit.h:83
atsc_table_eit_event::start_time
uint32_t start_time
Definition atsc_eit.h:89
atsc_table_eit_event::start
struct tm start
Definition atsc_eit.h:102
atsc_table_eit
ATSC EIT table.
Definition atsc_eit.h:146
atsc_table_eit::protocol_version
uint8_t protocol_version
Definition atsc_eit.h:148
atsc_table_eit::event
struct atsc_table_eit_event * event
Definition atsc_eit.h:150
atsc_table_eit::header
struct dvb_table_header header
Definition atsc_eit.h:147
atsc_table_eit::events
uint8_t events
Definition atsc_eit.h:149
dvb_desc
Linked list containing the several descriptors found on a MPEG-TS table.
Definition descriptors.h:117
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
atsc_table_eit_desc_length
ATSC EIT descriptor length.
Definition atsc_eit.h:121
atsc_table_eit_desc_length::desc_length
uint16_t desc_length
Definition atsc_eit.h:124
atsc_table_eit_desc_length::bitfield
uint16_t bitfield
Definition atsc_eit.h:122
atsc_table_eit_desc_length::reserved
uint16_t reserved
Definition atsc_eit.h:125