libdvbpsi  1.2.0
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  * Jean-Paul Saman <jpsaman@videolan.org>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  *****************************************************************************/
24 
34 #ifndef _DVBPSI_SDT_H_
35 #define _DVBPSI_SDT_H_
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
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  bool b_free_ca;
72 
73 /*****************************************************************************
74  * dvbpsi_sdt_t
75  *****************************************************************************/
87 typedef struct dvbpsi_sdt_s
88 {
89  /* PSI table members */
90  uint8_t i_table_id;
91  uint16_t i_extension;
93  /* Table specific */
94  uint8_t i_version;
96  uint16_t i_network_id;
101 } dvbpsi_sdt_t;
102 
103 /*****************************************************************************
104  * dvbpsi_sdt_callback
105  *****************************************************************************/
111 typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
112 
113 /*****************************************************************************
114  * dvbpsi_sdt_attach
115  *****************************************************************************/
128 bool dvbpsi_sdt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
129  dvbpsi_sdt_callback pf_callback, void* p_cb_data);
130 
131 /*****************************************************************************
132  * dvbpsi_sdt_detach
133  *****************************************************************************/
143 void dvbpsi_sdt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
144 
145 /*****************************************************************************
146  * dvbpsi_sdt_init/dvbpsi_NewSDT
147  *****************************************************************************/
160 void dvbpsi_sdt_init(dvbpsi_sdt_t *p_sdt, uint8_t i_table_id, uint16_t i_extension,
161  uint8_t i_version, bool b_current_next, uint16_t i_network_id);
162 
174 dvbpsi_sdt_t *dvbpsi_sdt_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version,
175  bool b_current_next, uint16_t i_network_id);
176 
177 /*****************************************************************************
178  * dvbpsi_sdt_empty/dvbpsi_sdt_delete
179  *****************************************************************************/
186 void dvbpsi_sdt_empty(dvbpsi_sdt_t *p_sdt);
187 
194 void dvbpsi_sdt_delete(dvbpsi_sdt_t *p_sdt);
195 
196 /*****************************************************************************
197  * dvbpsi_sdt_service_add
198  *****************************************************************************/
216  uint16_t i_service_id, bool b_eit_schedule, bool b_eit_present,
217  uint8_t i_running_status, bool b_free_ca);
218 
219 /*****************************************************************************
220  * dvbpsi_sdt_service_descriptor_add
221  *****************************************************************************/
235  dvbpsi_sdt_service_t *p_service,
236  uint8_t i_tag, uint8_t i_length,
237  uint8_t *p_data);
238 
239 /*****************************************************************************
240  * dvbpsi_sdt_sections_generate
241  *****************************************************************************
242  * Generate SDT sections based on the dvbpsi_sdt_t structure.
243  *****************************************************************************/
255 
256 #ifdef __cplusplus
257 };
258 #endif
259 
260 #else
261 #error "Multiple inclusions of sdt.h"
262 #endif