libdvbpsi  2.0.0-git
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
void dvbpsi_sdt_init(dvbpsi_sdt_t *p_sdt, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint16_t i_network_id)
Initialize a user-allocated dvbpsi_sdt_t structure.
uint8_t i_table_id
Definition: sdt.h:90
dvbpsi_descriptor_t * p_first_descriptor
Definition: sdt.h:65
bool b_eit_schedule
Definition: sdt.h:58
uint16_t i_extension
Definition: sis.h:101
bool b_current_next
Definition: sis.h:107
dvbpsi_psi_section_t * dvbpsi_sdt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sdt_t *p_sdt)
SDT generator.
struct dvbpsi_sdt_s dvbpsi_sdt_t
dvbpsi_sdt_t type definition.
uint8_t i_table_id
Definition: sis.h:100
dvbpsi_sdt_t * dvbpsi_sdt_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint16_t i_network_id)
Allocate and initialize a new dvbpsi_sdt_t structure.
uint8_t i_running_status
Definition: sdt.h:61
bool b_current_next
Definition: sdt.h:95
dvbpsi_sdt_service_t * p_first_service
Definition: sdt.h:98
bool b_eit_present
Definition: sdt.h:59
void dvbpsi_sdt_delete(dvbpsi_sdt_t *p_sdt)
Clean and free a dvbpsi_sdt_t structure.
dvbpsi_sdt_service_t * dvbpsi_sdt_service_add(dvbpsi_sdt_t *p_sdt, uint16_t i_service_id, bool b_eit_schedule, bool b_eit_present, uint8_t i_running_status, bool b_free_ca)
Add a service at the end of the SDT.
uint16_t i_extension
Definition: sdt.h:91
void dvbpsi_sdt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a SDT decoder.
bool b_free_ca
Definition: sdt.h:62
PSI section structure.
Definition: psi.h:68
uint16_t i_descriptors_length
Definition: sdt.h:63
uint16_t i_network_id
Definition: sdt.h:96
struct dvbpsi_sdt_service_s * p_next
Definition: sdt.h:68
SDT service description structure.
Definition: sdt.h:55
struct dvbpsi_sdt_service_s dvbpsi_sdt_service_t
dvbpsi_sdt_service_t type definition.
void dvbpsi_sdt_empty(dvbpsi_sdt_t *p_sdt)
Clean a dvbpsi_sdt_t structure.
bool dvbpsi_sdt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_sdt_callback pf_callback, void *p_cb_data)
Creation and initialization of a SDT decoder. It is attached to p_dvbpsi.
SDT structure.
Definition: sdt.h:87
DVBPSI handle structure.
Definition: dvbpsi.h:142
dvbpsi_descriptor_t * dvbpsi_sdt_service_descriptor_add(dvbpsi_sdt_service_t *p_service, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the SDT service.
Descriptor structure.
Definition: descriptor.h:82
void(* dvbpsi_sdt_callback)(void *p_cb_data, dvbpsi_sdt_t *p_new_sdt)
Callback type definition.
Definition: sdt.h:111
uint16_t i_service_id
Definition: sdt.h:57
uint8_t i_version
Definition: sdt.h:94
uint8_t i_version
Definition: sis.h:104