libdvbpsi  1.2.0
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  * 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  *****************************************************************************/
27 
41 #ifndef _DVBPSI_BAT_H_
42 #define _DVBPSI_BAT_H_
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /*****************************************************************************
49  * dvbpsi_bat_ts_t
50  *****************************************************************************/
62 typedef struct dvbpsi_bat_ts_s
63 {
64  uint16_t i_ts_id;
65  uint16_t i_orig_network_id;
73 
74 
75 /*****************************************************************************
76  * dvbpsi_bat_t
77  *****************************************************************************/
89 typedef struct dvbpsi_bat_s
90 {
91  uint8_t i_table_id;
92  uint16_t i_extension;
94  uint8_t i_version;
102 } dvbpsi_bat_t;
103 
104 /*****************************************************************************
105  * dvbpsi_bat_callback
106  *****************************************************************************/
112 typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
113 
114 /*****************************************************************************
115  * dvbpsi_bat_attach
116  *****************************************************************************/
128 bool dvbpsi_bat_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
129  dvbpsi_bat_callback pf_callback, void* p_cb_data);
130 
131 /*****************************************************************************
132  * dvbpsi_bat_detach
133  *****************************************************************************/
143 void dvbpsi_bat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
144 
145 /*****************************************************************************
146  * dvbpsi_bat_init/dvbpsi_bat_new
147  *****************************************************************************/
159 void dvbpsi_bat_init(dvbpsi_bat_t *p_bat, uint8_t i_table_id, uint16_t i_extension,
160  uint8_t i_version, bool b_current_next);
161 
173  uint8_t i_version, bool b_current_next);
174 
175 /*****************************************************************************
176  * dvbpsi_bat_empty/dvbpsi_bat_delete
177  *****************************************************************************/
184 void dvbpsi_bat_empty(dvbpsi_bat_t *p_bat);
185 
192 void dvbpsi_bat_delete(dvbpsi_bat_t *p_bat);
193 
194 /*****************************************************************************
195  * dvbpsi_bat_descriptor_add
196  *****************************************************************************/
210  uint8_t i_tag, uint8_t i_length,
211  uint8_t* p_data);
212 
213 /*****************************************************************************
214  * dvbpsi_bat_ts_add
215  *****************************************************************************/
228  uint16_t i_ts_id, uint16_t i_orig_network_id);
229 
230 /*****************************************************************************
231  * dvbpsi_bat_ts_descriptor_add
232  *****************************************************************************/
246  uint8_t i_tag, uint8_t i_length,
247  uint8_t *p_data);
248 
249 /*****************************************************************************
250  * dvbpsi_bat_sections_generate
251  *****************************************************************************/
262 
263 #ifdef __cplusplus
264 };
265 #endif
266 
267 #else
268 #error "Multiple inclusions of bat.h"
269 #endif