libdvbpsi  0.2.2
sdt.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * sdt.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Johan Bilien <jobi@via.ecp.fr>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  *****************************************************************************/
23 
33 #ifndef _DVBPSI_SDT_H_
34 #define _DVBPSI_SDT_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /*****************************************************************************
42  * dvbpsi_sdt_service_t
43  *****************************************************************************/
55 typedef struct dvbpsi_sdt_service_s
56 {
57  uint16_t i_service_id;
61  uint8_t i_running_status;
62  int b_free_ca;
73 
74 
75 /*****************************************************************************
76  * dvbpsi_sdt_t
77  *****************************************************************************/
89 typedef struct dvbpsi_sdt_s
90 {
91  uint16_t i_ts_id;
92  uint8_t i_version;
94  uint16_t i_network_id;
99 } dvbpsi_sdt_t;
100 
101 
102 /*****************************************************************************
103  * dvbpsi_sdt_callback
104  *****************************************************************************/
110 typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
111 
112 
113 /*****************************************************************************
114  * dvbpsi_AttachSDT
115  *****************************************************************************/
128 __attribute__((deprecated))
129 int dvbpsi_AttachSDT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
130  uint16_t i_extension, dvbpsi_sdt_callback pf_callback,
131  void* p_cb_data);
132 
133 
134 /*****************************************************************************
135  * dvbpsi_DetachSDT
136  *****************************************************************************/
146 __attribute__((deprecated))
147 void dvbpsi_DetachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
148  uint16_t i_extension);
149 
150 
151 /*****************************************************************************
152  * dvbpsi_InitSDT/dvbpsi_NewSDT
153  *****************************************************************************/
165 __attribute__((deprecated))
166 void dvbpsi_InitSDT(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
167  int b_current_next, uint16_t i_network_id);
168 
179 #define dvbpsi_NewSDT(p_sdt, i_ts_id, i_version, b_current_next,i_network_id) \
180 do { \
181  p_sdt = (dvbpsi_sdt_t*)malloc(sizeof(dvbpsi_sdt_t)); \
182  if(p_sdt != NULL) \
183  dvbpsi_InitSDT(p_sdt, i_ts_id, i_version, b_current_next, i_network_id); \
184 } while(0);
185 
186 
187 /*****************************************************************************
188  * dvbpsi_EmptySDT/dvbpsi_DeleteSDT
189  *****************************************************************************/
196 __attribute__((deprecated))
197 void dvbpsi_EmptySDT(dvbpsi_sdt_t *p_sdt);
198 
205 #define dvbpsi_DeleteSDT(p_sdt) \
206 do { \
207  dvbpsi_EmptySDT(p_sdt); \
208  free(p_sdt); \
209 } while(0);
210 
211 
212 /*****************************************************************************
213  * dvbpsi_SDTAddService
214  *****************************************************************************/
231 __attribute__((deprecated))
232 dvbpsi_sdt_service_t *dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
233  uint16_t i_service_id, int b_eit_schedule, int b_eit_present,
234  uint8_t i_running_status,int b_free_ca);
235 
236 
237 /*****************************************************************************
238  * dvbpsi_SDTServiceAddDescriptor
239  *****************************************************************************/
252 __attribute__((deprecated))
253 dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
254  dvbpsi_sdt_service_t *p_service,
255  uint8_t i_tag, uint8_t i_length,
256  uint8_t *p_data);
257 
258 
259 /*****************************************************************************
260  * dvbpsi_GenSDTSections
261  *****************************************************************************
262  * Generate SDT sections based on the dvbpsi_sdt_t structure.
263  *****************************************************************************/
264 dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_sdt_t * p_sdt);
265 
266 #ifdef __cplusplus
267 };
268 #endif
269 
270 #else
271 #error "Multiple inclusions of sdt.h"
272 #endif
273