libdvbv5  1.11.0
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>
28 #include <libdvbv5/descriptors.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 
164 typedef 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  for (struct dvb_table_nit_transport *_tran = _nit->transport; _tran; _tran = _tran->next) \
191 
192 struct dvb_v5_fe_parms;
193 
194 #ifdef __cplusplus
195 extern "C" {
196 #endif
197 
214 ssize_t dvb_table_nit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf,
215  ssize_t buflen, struct dvb_table_nit **table);
216 
223 void dvb_table_nit_free(struct dvb_table_nit *table);
224 
232 void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table);
233 
264  struct dvb_v5_fe_parms *parms,
265  struct dvb_table_nit *table,
266  enum descriptors descriptor,
267  nit_handler_callback_t *call_nit,
268  nit_tran_handler_callback_t *call_tran,
269  void *priv);
270 
271 #ifdef __cplusplus
272 }
273 #endif
274 
275 #endif
struct dvb_table_header header
Definition: nit.h:144
Header of a MPEG-TS table.
Definition: header.h:92
Provides the MPEG TS table headers.
MPEG-TS NIT transport table.
Definition: nit.h:109
uint16_t network_id
Definition: nit.h:111
uint16_t bitfield
Definition: nit.h:146
MPEG-TS NIT transport header.
Definition: nit.h:79
struct dvb_table_nit_transport * next
Definition: nit.h:120
struct dvb_desc * descriptor
Definition: nit.h:152
MPEG-TS NIT table.
Definition: nit.h:143
descriptors
List containing all descriptors used by Digital TV MPEG-TS.
Definition: descriptors.h:590
void dvb_table_nit_free(struct dvb_table_nit *table)
Frees all data allocated by the NIT table parser.
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
uint16_t desc_length
Definition: nit.h:148
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
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.
uint16_t transport_id
Definition: nit.h:110
uint16_t bitfield
Definition: nit.h:113
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:117
uint16_t desc_length
Definition: nit.h:115
uint16_t reserved
Definition: nit.h:116
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
struct dvb_table_nit_transport * transport
Definition: nit.h:153
void dvb_table_nit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table)
Prints the content of the NIT table.
Provides a way to handle MPEG-TS descriptors found on Digital TV streams.
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.
uint16_t reserved
Definition: nit.h:149
struct dvb_desc * descriptor
Definition: nit.h:119