libdvbpsi  2.0.0-git
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 
172 dvbpsi_bat_t *dvbpsi_bat_new(uint8_t i_table_id, uint16_t i_extension,
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
void dvbpsi_bat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a BAT decoder.
uint16_t i_ts_id
Definition: bat.h:64
void dvbpsi_bat_init(dvbpsi_bat_t *p_bat, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next)
Initialize a user-allocated dvbpsi_bat_t structure.
dvbpsi_descriptor_t * dvbpsi_bat_ts_descriptor_add(dvbpsi_bat_ts_t *p_bat, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the BAT TS descriptors.
bool b_current_next
Definition: sis.h:107
uint16_t i_orig_network_id
Definition: bat.h:65
dvbpsi_psi_section_t * dvbpsi_bat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t *p_bat)
BAT generator.
dvbpsi_bat_t * dvbpsi_bat_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next)
Allocate and initialize a new dvbpsi_bat_t structure.
void dvbpsi_bat_empty(dvbpsi_bat_t *p_bat)
Clean a dvbpsi_bat_t structure.
dvbpsi_descriptor_t * p_first_descriptor
Definition: bat.h:67
struct dvbpsi_bat_s dvbpsi_bat_t
dvbpsi_bat_t type definition.
BAT structure.
Definition: bat.h:89
void(* dvbpsi_bat_callback)(void *p_cb_data, dvbpsi_bat_t *p_new_bat)
Callback type definition.
Definition: bat.h:112
bool dvbpsi_bat_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_bat_callback pf_callback, void *p_cb_data)
Creation and initialization of a BAT decoder. It will be attached to p_dvbpsi.
uint8_t i_table_id
Definition: bat.h:91
BAT transport stream description structure.
Definition: bat.h:62
bool b_current_next
Definition: bat.h:95
PSI section structure.
Definition: psi.h:68
struct dvbpsi_bat_ts_s * p_next
Definition: bat.h:69
uint16_t i_ts_id
Definition: sis.h:103
dvbpsi_bat_ts_t * p_first_ts
Definition: bat.h:99
void dvbpsi_bat_delete(dvbpsi_bat_t *p_bat)
Clean and free a dvbpsi_bat_t structure.
uint8_t i_version
Definition: bat.h:94
dvbpsi_bat_ts_t * dvbpsi_bat_ts_add(dvbpsi_bat_t *p_bat, uint16_t i_ts_id, uint16_t i_orig_network_id)
Add a TS description at the end of the BAT.
dvbpsi_descriptor_t * dvbpsi_bat_bouquet_descriptor_add(dvbpsi_bat_t *p_bat, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the BAT.
uint16_t i_extension
Definition: bat.h:92
DVBPSI handle structure.
Definition: dvbpsi.h:142
Descriptor structure.
Definition: descriptor.h:82
struct dvbpsi_bat_ts_s dvbpsi_bat_ts_t
dvbpsi_bat_ts_t type definition.
dvbpsi_descriptor_t * p_first_descriptor
Definition: bat.h:97
uint8_t i_version
Definition: sis.h:104