libdvbpsi  0.2.2
bat.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * bat.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id: bat.h $
5  *
6  * Authors: Zhu zhenglu <zhuzlu@gmail.com>
7  * heavily based on nit.h which was written by
8  * Johann Hanne
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  *****************************************************************************/
26 
40 #ifndef _DVBPSI_BAT_H_
41 #define _DVBPSI_BAT_H_
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /*****************************************************************************
48  * dvbpsi_bat_ts_t
49  *****************************************************************************/
61 typedef struct dvbpsi_bat_ts_s
62 {
63  uint16_t i_ts_id;
64  uint16_t i_orig_network_id;
73 
74 
75 /*****************************************************************************
76  * dvbpsi_bat_t
77  *****************************************************************************/
89 typedef struct dvbpsi_bat_s
90 {
91  uint16_t i_bouquet_id;
92  uint8_t i_version;
100 } dvbpsi_bat_t;
101 
102 
103 /*****************************************************************************
104  * dvbpsi_bat_callback
105  *****************************************************************************/
111 typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
112 
113 
114 /*****************************************************************************
115  * dvbpsi_AttachBAT
116  *****************************************************************************/
129 __attribute__((deprecated))
130 int dvbpsi_AttachBAT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
131  uint16_t i_extension, dvbpsi_bat_callback pf_callback,
132  void* p_cb_data);
133 
134 
135 /*****************************************************************************
136  * dvbpsi_DetachBAT
137  *****************************************************************************/
147 __attribute__((deprecated))
148 void dvbpsi_DetachBAT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
149  uint16_t i_extension);
150 
151 
152 /*****************************************************************************
153  * dvbpsi_InitBAT/dvbpsi_NewBAT
154  *****************************************************************************/
166 __attribute__((deprecated))
167 void dvbpsi_InitBAT(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
168  int b_current_next);
169 
180 #define dvbpsi_NewBAT(p_bat, i_bouquet_id, i_version, b_current_next) \
181 do { \
182  p_bat = (dvbpsi_bat_t*)malloc(sizeof(dvbpsi_bat_t)); \
183  if(p_bat != NULL) \
184  dvbpsi_InitBAT(p_bat, i_bouquet_id, i_version, b_current_next); \
185 } while(0);
186 
187 
188 /*****************************************************************************
189  * dvbpsi_EmptyBAT/dvbpsi_DeleteBAT
190  *****************************************************************************/
197 __attribute__((deprecated))
198 void dvbpsi_EmptyBAT(dvbpsi_bat_t *p_bat);
199 
206 #define dvbpsi_DeleteBAT(p_bat) \
207 do { \
208  dvbpsi_EmptyBAT(p_bat); \
209  free(p_bat); \
210 } while(0);
211 
212 /*****************************************************************************
213  * dvbpsi_GenBATSections
214  *****************************************************************************
223 __attribute__((deprecated))
224 dvbpsi_psi_section_t *dvbpsi_GenBATSections(dvbpsi_bat_t * p_bat);
225 
226 
227 #ifdef __cplusplus
228 };
229 #endif
230 
231 #else
232 #error "Multiple inclusions of bat.h"
233 #endif
234