libdvbv5 1.26.1
Library to work with Digital TV devices on Linux
nit.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 _NIT_H
22#define _NIT_H
23
24#include <stdint.h>
25#include <unistd.h> /* ssize_t */
26
27#include <libdvbv5/header.h>
29
61#define DVB_TABLE_NIT 0x40
62#define DVB_TABLE_NIT2 0x41
63#define DVB_TABLE_NIT_PID 0x10
64
80 uint16_t bitfield;
81 struct {
82 uint16_t transport_length:12;
83 uint16_t reserved:4;
84 } __attribute__((packed));
85} __attribute__((packed));
86
110 uint16_t transport_id;
111 uint16_t network_id;
112 union {
113 uint16_t bitfield;
114 struct {
115 uint16_t desc_length:12;
116 uint16_t reserved:4;
117 } __attribute__((packed));
118 } __attribute__((packed));
121} __attribute__((packed));
122
145 union {
146 uint16_t bitfield;
147 struct {
148 uint16_t desc_length:12;
149 uint16_t reserved:4;
150 } __attribute__((packed));
151 } __attribute__((packed));
154} __attribute__((packed));
155
164typedef void nit_handler_callback_t(struct dvb_table_nit *nit,
165 struct dvb_desc *desc,
166 void *priv);
167
178 struct dvb_table_nit_transport *tran,
179 struct dvb_desc *desc,
180 void *priv);
181
189#define dvb_nit_transport_foreach( _tran, _nit ) \
190 if (_nit && _nit->transport) \
191 for (struct dvb_table_nit_transport *_tran = _nit->transport; _tran; _tran = _tran->next) \
192
193struct dvb_v5_fe_parms;
194
195#ifdef __cplusplus
196extern "C" {
197#endif
198
215ssize_t dvb_table_nit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
216 ssize_t buflen, struct dvb_table_nit **table);
217
225
233void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table);
234
265 struct dvb_v5_fe_parms *parms,
266 struct dvb_table_nit *table,
267 enum descriptors descriptor,
268 nit_handler_callback_t *call_nit,
270 void *priv);
271
272#ifdef __cplusplus
273}
274#endif
275
276#endif
Provides a way to handle MPEG-TS descriptors found on Digital TV streams.
descriptors
void nit_handler_callback_t(struct dvb_table_nit *nit, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT table entry is found
Definition nit.h:164
void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table)
Prints the content of the NIT table.
void dvb_table_nit_descriptor_handler(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table, enum descriptors descriptor, nit_handler_callback_t *call_nit, nit_tran_handler_callback_t *call_tran, void *priv)
For each entry at NIT and NIT transport tables, call a callback.
ssize_t dvb_table_nit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_nit **table)
Initializes and parses NIT table.
void dvb_table_nit_free(struct dvb_table_nit *table)
Frees all data allocated by the NIT table parser.
void nit_tran_handler_callback_t(struct dvb_table_nit *nit, struct dvb_table_nit_transport *tran, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT transport table entry is found
Definition nit.h:177
Provides the MPEG TS table headers.
Linked list containing the several descriptors found on a MPEG-TS table.
Header of a MPEG-TS table.
Definition header.h:103
MPEG-TS NIT transport table.
Definition nit.h:109
uint16_t network_id
Definition nit.h:111
uint16_t reserved
Definition nit.h:116
struct dvb_desc * descriptor
Definition nit.h:119
uint16_t desc_length
Definition nit.h:115
uint16_t transport_id
Definition nit.h:110
uint16_t bitfield
Definition nit.h:113
struct dvb_table_nit_transport * next
Definition nit.h:120
MPEG-TS NIT table.
Definition nit.h:143
struct dvb_desc * descriptor
Definition nit.h:152
uint16_t desc_length
Definition nit.h:148
struct dvb_table_nit_transport * transport
Definition nit.h:153
uint16_t bitfield
Definition nit.h:146
uint16_t reserved
Definition nit.h:149
struct dvb_table_header header
Definition nit.h:144
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117
MPEG-TS NIT transport header.
Definition nit.h:79