libdvbv5  1.10.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
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation version 2
8  * of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  *
20  */
21 
22 #ifndef _NIT_H
23 #define _NIT_H
24 
25 #include <stdint.h>
26 #include <unistd.h> /* ssize_t */
27 
28 #include <libdvbv5/header.h>
29 #include <libdvbv5/descriptors.h>
30 
62 #define DVB_TABLE_NIT 0x40
63 #define DVB_TABLE_NIT2 0x41
64 #define DVB_TABLE_NIT_PID 0x10
65 
81  uint16_t bitfield;
82  struct {
83  uint16_t transport_length:12;
84  uint16_t reserved:4;
85  } __attribute__((packed));
86 } __attribute__((packed));
87 
111  uint16_t transport_id;
112  uint16_t network_id;
113  union {
114  uint16_t bitfield;
115  struct {
116  uint16_t desc_length:12;
117  uint16_t reserved:4;
118  } __attribute__((packed));
119  } __attribute__((packed));
122 } __attribute__((packed));
123 
145  struct dvb_table_header header;
146  union {
147  uint16_t bitfield;
148  struct {
149  uint16_t desc_length:12;
150  uint16_t reserved:4;
151  } __attribute__((packed));
152  } __attribute__((packed));
155 } __attribute__((packed));
156 
165 typedef void nit_handler_callback_t(struct dvb_table_nit *nit,
166  struct dvb_desc *desc,
167  void *priv);
168 
179  struct dvb_table_nit_transport *tran,
180  struct dvb_desc *desc,
181  void *priv);
182 
190 #define dvb_nit_transport_foreach( _tran, _nit ) \
191  for (struct dvb_table_nit_transport *_tran = _nit->transport; _tran; _tran = _tran->next) \
192 
193 struct dvb_v5_fe_parms;
194 
195 #ifdef __cplusplus
196 extern "C" {
197 #endif
198 
215 ssize_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 
224 void dvb_table_nit_free(struct dvb_table_nit *table);
225 
233 void 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,
269  nit_tran_handler_callback_t *call_tran,
270  void *priv);
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif
Header of a MPEG-TS table.
Definition: header.h:93
Provides the MPEG TS table headers.
MPEG-TS NIT transport table.
Definition: nit.h:110
uint16_t network_id
Definition: nit.h:112
uint16_t bitfield
Definition: nit.h:147
MPEG-TS NIT transport header.
Definition: nit.h:80
struct dvb_table_nit_transport * next
Definition: nit.h:121
struct dvb_desc * descriptor
Definition: nit.h:153
MPEG-TS NIT table.
Definition: nit.h:144
descriptors
List containing all descriptors used by Digital TV MPEG-TS.
Definition: descriptors.h:591
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:118
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:165
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:111
uint16_t bitfield
Definition: nit.h:114
Linked list containing the several descriptors found on a MPEG-TS table.
Definition: descriptors.h:118
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:178
struct dvb_table_nit_transport * transport
Definition: nit.h:154
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.
struct dvb_desc * descriptor
Definition: nit.h:120