libdvbpsi  0.2.2
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  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  *****************************************************************************/
25 
35 #ifndef _DVBPSI_NIT_H_
36 #define _DVBPSI_NIT_H_
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
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 /*****************************************************************************
71  * dvbpsi_nit_t
72  *****************************************************************************/
84 typedef struct dvbpsi_nit_s
85 {
86  uint16_t i_network_id;
87  uint8_t i_version;
94 } dvbpsi_nit_t;
95 
96 
97 /*****************************************************************************
98  * dvbpsi_nit_callback
99  *****************************************************************************/
105 typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
106 
107 
108 /*****************************************************************************
109  * dvbpsi_AttachNIT
110  *****************************************************************************/
123 __attribute__((deprecated))
124 int dvbpsi_AttachNIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
125  uint16_t i_extension, dvbpsi_nit_callback pf_callback,
126  void* p_cb_data);
127 
128 
129 /*****************************************************************************
130  * dvbpsi_DetachNIT
131  *****************************************************************************/
141 __attribute__((deprecated))
142 void dvbpsi_DetachNIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
143  uint16_t i_extension);
144 
145 
146 /*****************************************************************************
147  * dvbpsi_InitNIT/dvbpsi_NewNIT
148  *****************************************************************************/
159 __attribute__((deprecated))
160 void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
161  uint8_t i_version, int b_current_next);
162 
174 #define dvbpsi_NewNIT(p_nit, i_network_id, \
175  i_version, b_current_next) \
176 do { \
177  p_nit = (dvbpsi_nit_t*)malloc(sizeof(dvbpsi_nit_t)); \
178  if(p_nit != NULL) \
179  dvbpsi_InitNIT(p_nit, i_network_id, i_version, b_current_next); \
180 } while(0);
181 
182 
183 /*****************************************************************************
184  * dvbpsi_EmptyNIT/dvbpsi_DeleteNIT
185  *****************************************************************************/
192 __attribute__((deprecated))
193 void dvbpsi_EmptyNIT(dvbpsi_nit_t* p_nit);
194 
201 #define dvbpsi_DeleteNIT(p_nit) \
202 do { \
203  dvbpsi_EmptyNIT(p_nit); \
204  free(p_nit); \
205 } while(0);
206 
207 
208 /*****************************************************************************
209  * dvbpsi_NITAddDescriptor
210  *****************************************************************************/
223 __attribute__((deprecated))
224 dvbpsi_descriptor_t* dvbpsi_NITAddDescriptor(dvbpsi_nit_t* p_nit,
225  uint8_t i_tag, uint8_t i_length,
226  uint8_t* p_data);
227 
228 
229 /*****************************************************************************
230  * dvbpsi_NITAddTS
231  *****************************************************************************/
241 __attribute__((deprecated))
242 dvbpsi_nit_ts_t* dvbpsi_NITAddTS(dvbpsi_nit_t* p_nit,
243  uint16_t i_ts_id, uint16_t i_orig_network_id);
244 
245 
246 /*****************************************************************************
247  * dvbpsi_NITTSAddDescriptor
248  *****************************************************************************/
261 __attribute__((deprecated))
262 dvbpsi_descriptor_t* dvbpsi_NITTSAddDescriptor(dvbpsi_nit_ts_t* p_ts,
263  uint8_t i_tag, uint8_t i_length,
264  uint8_t* p_data);
265 
266 
267 /*****************************************************************************
268  * dvbpsi_GenNITSections
269  *****************************************************************************/
280 __attribute__((deprecated))
281 dvbpsi_psi_section_t* dvbpsi_GenNITSections(dvbpsi_nit_t* p_nit,
282  uint8_t i_table_id);
283 
284 
285 #ifdef __cplusplus
286 };
287 #endif
288 
289 #else
290 #error "Multiple inclusions of nit.h"
291 #endif
292