libdvbv5: lib/include/libdvbv5/sdt.h Source File

libdvbv5 1.26.1 Library to work with Digital TV devices on Linux

sdt.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
21#ifndef _SDT_H
22#define _SDT_H
23
42#include <stdint.h>
43#include <unistd.h> /* ssize_t */
44
45#include <libdvbv5/header.h>
46
58#define DVB_TABLE_SDT 0x42
59#define DVB_TABLE_SDT2 0x46
60#define DVB_TABLE_SDT_PID 0x0011
61
87 struct dvb_table_sdt_service {
88 uint16_t service_id;
89 uint8_t EIT_present_following:1;
90 uint8_t EIT_schedule:1;
91 uint8_t reserved:6;
92 union {
93 uint16_t bitfield;
94 struct {
95 uint16_t desc_length:12;
96 uint16_t free_CA_mode:1;
97 uint16_t running_status:3;
98 } __attribute__((packed));
99 } __attribute__((packed));
100 struct dvb_desc *descriptor;
101 struct dvb_table_sdt_service *next;
102} __attribute__((packed));
103
123 struct dvb_table_sdt {
124 struct dvb_table_header header;
125 uint16_t network_id;
126 uint8_t reserved;
127 struct dvb_table_sdt_service *service;
128} __attribute__((packed));
129
137#define dvb_sdt_service_foreach(_service, _sdt) \
138 if (_sdt && _sdt->service) \
139 for (struct dvb_table_sdt_service *_service = _sdt->service; _service; _service = _service->next ) \
140
141struct dvb_v5_fe_parms;
142
143#ifdef __cplusplus
144extern "C" {
145#endif
146
163ssize_t dvb_table_sdt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
164 ssize_t buflen, struct dvb_table_sdt **table);
165
172 void dvb_table_sdt_free(struct dvb_table_sdt *table);
173
181 void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table);
182
183#ifdef __cplusplus
184}
185#endif
186
187#endif
dvb_table_sdt_free
void dvb_table_sdt_free(struct dvb_table_sdt *table)
Frees all data allocated by the SDT table parser.
dvb_table_sdt_init
ssize_t dvb_table_sdt_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_sdt **table)
Initializes and parses SDT table.
dvb_table_sdt_print
void dvb_table_sdt_print(struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table)
Prints the content of the SDT table.
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_header
Header of a MPEG-TS table.
Definition header.h:103
dvb_table_sdt_service
MPEG-TS SDT service table.
Definition sdt.h:87
dvb_table_sdt_service::reserved
uint8_t reserved
Definition sdt.h:91
dvb_table_sdt_service::running_status
uint16_t running_status
Definition sdt.h:97
dvb_table_sdt_service::service_id
uint16_t service_id
Definition sdt.h:88
dvb_table_sdt_service::free_CA_mode
uint16_t free_CA_mode
Definition sdt.h:96
dvb_table_sdt_service::EIT_schedule
uint8_t EIT_schedule
Definition sdt.h:90
dvb_table_sdt_service::EIT_present_following
uint8_t EIT_present_following
Definition sdt.h:89
dvb_table_sdt_service::desc_length
uint16_t desc_length
Definition sdt.h:95
dvb_table_sdt_service::descriptor
struct dvb_desc * descriptor
Definition sdt.h:100
dvb_table_sdt_service::bitfield
uint16_t bitfield
Definition sdt.h:93
dvb_table_sdt_service::next
struct dvb_table_sdt_service * next
Definition sdt.h:101
dvb_table_sdt
MPEG-TS SDT table.
Definition sdt.h:123
dvb_table_sdt::service
struct dvb_table_sdt_service * service
Definition sdt.h:127
dvb_table_sdt::reserved
uint8_t reserved
Definition sdt.h:126
dvb_table_sdt::header
struct dvb_table_header header
Definition sdt.h:124
dvb_table_sdt::network_id
uint16_t network_id
Definition sdt.h:125
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117