libdvbpsi  0.2.2
eit.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * eit.h
3  * Copyright (C) 2004-2011 VideoLAN
4  * $Id: eit.h 88 2004-02-24 14:31:18Z sam $
5  *
6  * Authors: Christophe Massiot <massiot@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_EIT_H_
34 #define _DVBPSI_EIT_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /*****************************************************************************
42  * dvbpsi_eit_event_t
43  *****************************************************************************/
55 typedef struct dvbpsi_eit_event_s
56 {
57  uint16_t i_event_id;
58  uint64_t i_start_time;
59  uint32_t i_duration;
60  uint8_t i_running_status;
61  int b_free_ca;
72 
73 
74 /*****************************************************************************
75  * dvbpsi_eit_t
76  *****************************************************************************/
88 typedef struct dvbpsi_eit_s
89 {
90  uint16_t i_service_id;
91  uint8_t i_version;
93  uint16_t i_ts_id;
94  uint16_t i_network_id;
96  uint8_t i_last_table_id;
100 } dvbpsi_eit_t;
101 
102 
103 /*****************************************************************************
104  * dvbpsi_eit_callback
105  *****************************************************************************/
111 typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
112 
113 
114 /*****************************************************************************
115  * dvbpsi_AttachEIT
116  *****************************************************************************/
129 __attribute__((deprecated))
130 int dvbpsi_AttachEIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
131  uint16_t i_extension, dvbpsi_eit_callback pf_callback,
132  void* p_cb_data);
133 
134 
135 /*****************************************************************************
136  * dvbpsi_DetachEIT
137  *****************************************************************************/
147 __attribute__((deprecated))
148 void dvbpsi_DetachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
149  uint16_t i_extension);
150 
151 
152 /*****************************************************************************
153  * dvbpsi_InitEIT/dvbpsi_NewEIT
154  *****************************************************************************/
171 __attribute__((deprecated))
172 void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_version,
173  int b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
174  uint8_t i_segment_last_section_number,
175  uint8_t i_last_table_id);
176 
187 #define dvbpsi_NewEIT(p_eit, i_service_id, i_version, b_current_next, i_ts_id, i_network_id, i_segment_last_section_number, i_last_table_id) \
188 do { \
189  p_eit = (dvbpsi_eit_t*)malloc(sizeof(dvbpsi_eit_t)); \
190  if(p_eit != NULL) \
191  dvbpsi_InitEIT(p_eit, i_service_id, i_version, b_current_next, i_ts_id, i_network_id, i_segment_last_section_number, i_last_table_id); \
192 } while(0);
193 
194 
195 /*****************************************************************************
196  * dvbpsi_EmptyEIT/dvbpsi_DeleteEIT
197  *****************************************************************************/
204 __attribute__((deprecated))
205 void dvbpsi_EmptyEIT(dvbpsi_eit_t* p_eit);
206 
213 #define dvbpsi_DeleteEIT(p_eit) \
214 do { \
215  dvbpsi_EmptyEIT(p_eit); \
216  free(p_eit); \
217 } while(0);
218 
219 
220 /*****************************************************************************
221  * dvbpsi_EITAddEvent
222  *****************************************************************************/
240  uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
241  uint8_t i_running_status, int b_free_ca);
242 
243 /*****************************************************************************
244  * dvbpsi_EITEventAddDescriptor
245  *****************************************************************************/
258 __attribute__((deprecated))
259 dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
260  dvbpsi_eit_event_t* p_event,
261  uint8_t i_tag, uint8_t i_length,
262  uint8_t* p_data);
263 
264 #ifdef __cplusplus
265 };
266 #endif
267 
268 #else
269 #error "Multiple inclusions of eit.h"
270 #endif
271