libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
nit.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * nit.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Johann Hanne
7  * heavily based on pmt.c which was written by
8  * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
9  * Jean-Paul Saman <jpsaman@videolan.org>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24  *
25  *****************************************************************************/
26 
36 #ifndef _DVBPSI_NIT_H_
37 #define _DVBPSI_NIT_H_
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*****************************************************************************
44  * dvbpsi_nit_ts_t
45  *****************************************************************************/
57 typedef struct dvbpsi_nit_ts_s
58 {
59  uint16_t i_ts_id;
60  uint16_t i_orig_network_id;
68 
69 /*****************************************************************************
70  * dvbpsi_nit_t
71  *****************************************************************************/
83 typedef struct dvbpsi_nit_s
84 {
85  uint8_t i_table_id;
86  uint16_t i_extension;
88  uint16_t i_network_id;
89  uint8_t i_version;
97 
98 /*****************************************************************************
99  * dvbpsi_nit_callback
100  *****************************************************************************/
106 typedef void (* dvbpsi_nit_callback)(void* p_priv, dvbpsi_nit_t* p_new_nit);
107 
108 /*****************************************************************************
109  * dvbpsi_nit_attach
110  *****************************************************************************/
122 bool dvbpsi_nit_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
123  dvbpsi_nit_callback pf_callback, void* p_priv);
124 
125 /*****************************************************************************
126  * dvbpsi_nit_detach
127  *****************************************************************************/
137 void dvbpsi_nit_detach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
138  uint16_t i_extension);
139 
140 /*****************************************************************************
141  * dvbpsi_nit_init/dvbpsi_nit_new
142  *****************************************************************************/
155 void dvbpsi_nit_init(dvbpsi_nit_t* p_nit, uint8_t i_table_id, uint16_t i_extension,
156  uint16_t i_network_id, uint8_t i_version, bool b_current_next);
157 
170 dvbpsi_nit_t *dvbpsi_nit_new(uint8_t i_table_id, uint16_t i_extension,
171  uint16_t i_network_id, uint8_t i_version,
172  bool b_current_next);
173 
174 /*****************************************************************************
175  * dvbpsi_nit_empty/dvbpsi_nit_delete
176  *****************************************************************************/
184 
192 
193 /*****************************************************************************
194  * dvbpsi_nit_descriptor_add
195  *****************************************************************************/
209  uint8_t i_tag, uint8_t i_length,
210  uint8_t *p_data);
211 
212 /*****************************************************************************
213  * dvbpsi_nit_ts_add
214  *****************************************************************************/
225  uint16_t i_ts_id, uint16_t i_orig_network_id);
226 
227 /*****************************************************************************
228  * dvbpsi_nit_ts_descriptor_add
229  *****************************************************************************/
243  uint8_t i_tag, uint8_t i_length,
244  uint8_t* p_data);
245 
246 /*****************************************************************************
247  * dvbpsi_nit_sections_generate
248  *****************************************************************************/
260 dvbpsi_psi_section_t* dvbpsi_nit_sections_generate(dvbpsi_t* p_dvbpsi, dvbpsi_nit_t* p_nit,
261  uint8_t i_table_id);
262 
263 #ifdef __cplusplus
264 };
265 #endif
266 
267 #else
268 #error "Multiple inclusions of nit.h"
269 #endif
270 
struct dvbpsi_nit_s dvbpsi_nit_t
dvbpsi_nit_t type definition.
void dvbpsi_nit_delete(dvbpsi_nit_t *p_nit)
Clean and free a dvbpsi_nit_t structure.
void dvbpsi_nit_init(dvbpsi_nit_t *p_nit, uint8_t i_table_id, uint16_t i_extension, uint16_t i_network_id, uint8_t i_version, bool b_current_next)
Initialize a user-allocated dvbpsi_nit_t structure.
dvbpsi_nit_ts_t * dvbpsi_nit_ts_add(dvbpsi_nit_t *p_nit, uint16_t i_ts_id, uint16_t i_orig_network_id)
Add an TS in the NIT.
dvbpsi_descriptor_t * dvbpsi_nit_descriptor_add(dvbpsi_nit_t *p_nit, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the NIT.
void dvbpsi_nit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a NIT decoder.
struct dvbpsi_nit_ts_s dvbpsi_nit_ts_t
dvbpsi_nit_ts_t type definition.
void dvbpsi_nit_empty(dvbpsi_nit_t *p_nit)
Clean a dvbpsi_nit_t structure.
void(* dvbpsi_nit_callback)(void *p_priv, dvbpsi_nit_t *p_new_nit)
Callback type definition.
Definition: nit.h:106
dvbpsi_descriptor_t * dvbpsi_nit_ts_descriptor_add(dvbpsi_nit_ts_t *p_ts, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the NIT TS.
bool dvbpsi_nit_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_nit_callback pf_callback, void *p_priv)
Creation and initialization of a NIT decoder. It is attached to p_dvbpsi.
dvbpsi_nit_t * dvbpsi_nit_new(uint8_t i_table_id, uint16_t i_extension, uint16_t i_network_id, uint8_t i_version, bool b_current_next)
Allocate and initialize a new dvbpsi_nit_t structure.
uint16_t i_ts_id
Definition: sis.h:4
Descriptor structure.
Definition: descriptor.h:83
NIT structure.
Definition: nit.h:84
uint8_t i_table_id
Definition: nit.h:85
uint16_t i_network_id
Definition: nit.h:88
uint16_t i_extension
Definition: nit.h:86
dvbpsi_nit_ts_t * p_first_ts
Definition: nit.h:94
bool b_current_next
Definition: nit.h:90
dvbpsi_descriptor_t * p_first_descriptor
Definition: nit.h:92
uint8_t i_version
Definition: nit.h:89
NIT TS structure.
Definition: nit.h:58
uint16_t i_orig_network_id
Definition: nit.h:60
struct dvbpsi_nit_ts_s * p_next
Definition: nit.h:64
dvbpsi_descriptor_t * p_first_descriptor
Definition: nit.h:62
uint16_t i_ts_id
Definition: nit.h:59
PSI section structure.
Definition: psi.h:69
DVBPSI handle structure.
Definition: dvbpsi.h:143