libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
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  * 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_EIT_H_
35 #define _DVBPSI_EIT_H_
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
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  bool b_free_ca;
62  bool b_nvod;
72 
73 /*****************************************************************************
74  * dvbpsi_eit_t
75  *****************************************************************************/
87 typedef struct dvbpsi_eit_s
88 {
89  uint8_t i_table_id;
90  uint16_t i_extension;
92  uint8_t i_version;
94  uint16_t i_ts_id;
95  uint16_t i_network_id;
97  uint8_t i_last_table_id;
102 
103 /*****************************************************************************
104  * dvbpsi_eit_callback
105  *****************************************************************************/
110 typedef void (* dvbpsi_eit_callback)(void* p_priv, dvbpsi_eit_t* p_new_eit);
111 
112 /*****************************************************************************
113  * dvbpsi_AttachEIT
114  *****************************************************************************/
127 bool dvbpsi_eit_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
128  dvbpsi_eit_callback pf_callback, void* p_priv);
129 
130 /*****************************************************************************
131  * dvbpsi_eit_detach
132  *****************************************************************************/
143 void dvbpsi_eit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
144 
145 /*****************************************************************************
146  * dvbpsi_eit_init/dvbpsi_eit_new
147  *****************************************************************************/
166 void dvbpsi_eit_init(dvbpsi_eit_t* p_eit, uint8_t i_table_id,
167  uint16_t i_extension, uint8_t i_version,
168  bool b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
169  uint8_t i_segment_last_section_number,
170  uint8_t i_last_table_id);
171 
188 dvbpsi_eit_t* dvbpsi_eit_new(uint8_t i_table_id, uint16_t i_extension,
189  uint8_t i_version, bool b_current_next,
190  uint16_t i_ts_id, uint16_t i_network_id,
191  uint8_t i_segment_last_section_number,
192  uint8_t i_last_table_id);
193 
194 /*****************************************************************************
195  * dvbpsi_eit_empty/dvbpsi_eit_delete
196  *****************************************************************************/
204 
212 
213 /*****************************************************************************
214  * dvbpsi_eit_event_add
215  *****************************************************************************/
236  uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
237  uint8_t i_running_status, bool b_free_ca,
238  uint16_t i_event_descriptor_length);
239 
240 /*****************************************************************************
241  * dvbpsi_eit_nvod_event_add
242  *****************************************************************************/
259  uint16_t i_event_id, uint32_t i_duration, bool b_free_ca,
260  uint16_t i_event_descriptor_length);
261 
262 /*****************************************************************************
263  * dvbpsi_eit_event_descriptor_add
264  *****************************************************************************/
278  dvbpsi_eit_event_t* p_event,
279  uint8_t i_tag, uint8_t i_length,
280  uint8_t* p_data);
281 
282 /*****************************************************************************
283  * dvbpsi_eit_sections_generate
284  *****************************************************************************
285  * Generate EIT sections based on the dvbpsi_eit_t structure.
286  *****************************************************************************/
297  uint8_t i_table_id);
298 
299 #ifdef __cplusplus
300 };
301 #endif
302 
303 #else
304 #error "Multiple inclusions of eit.h"
305 #endif
306 
void dvbpsi_eit_init(dvbpsi_eit_t *p_eit, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint16_t i_ts_id, uint16_t i_network_id, uint8_t i_segment_last_section_number, uint8_t i_last_table_id)
Initialize a user-allocated dvbpsi_eit_t structure.
dvbpsi_eit_event_t * dvbpsi_eit_nvod_event_add(dvbpsi_eit_t *p_eit, uint16_t i_event_id, uint32_t i_duration, bool b_free_ca, uint16_t i_event_descriptor_length)
Add a NVOD service description at the end of the EIT.
dvbpsi_descriptor_t * dvbpsi_eit_event_descriptor_add(dvbpsi_eit_event_t *p_event, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor to the EIT event.
struct dvbpsi_eit_s dvbpsi_eit_t
dvbpsi_eit_t type definition.
dvbpsi_psi_section_t * dvbpsi_eit_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit, uint8_t i_table_id)
Generate a EIT section based on the information provided in p_eit.
void dvbpsi_eit_empty(dvbpsi_eit_t *p_eit)
Clean a dvbpsi_eit_t structure.
void dvbpsi_eit_delete(dvbpsi_eit_t *p_eit)
Clean and free a dvbpsi_eit_t structure.
dvbpsi_eit_t * dvbpsi_eit_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint16_t i_ts_id, uint16_t i_network_id, uint8_t i_segment_last_section_number, uint8_t i_last_table_id)
Allocate and initialize a new dvbpsi_eit_t structure.
struct dvbpsi_eit_event_s dvbpsi_eit_event_t
dvbpsi_eit_event_t type definition.
dvbpsi_eit_event_t * dvbpsi_eit_event_add(dvbpsi_eit_t *p_eit, uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration, uint8_t i_running_status, bool b_free_ca, uint16_t i_event_descriptor_length)
Add a service description at the end of the EIT.
void dvbpsi_eit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a EIT decoder.
void(* dvbpsi_eit_callback)(void *p_priv, dvbpsi_eit_t *p_new_eit)
Callback type definition.
Definition: eit.h:110
uint16_t i_ts_id
Definition: sis.h:4
Descriptor structure.
Definition: descriptor.h:83
EIT service description structure.
Definition: eit.h:56
uint64_t i_start_time
Definition: eit.h:58
uint16_t i_event_id
Definition: eit.h:57
uint32_t i_duration
Definition: eit.h:59
bool b_free_ca
Definition: eit.h:61
struct dvbpsi_eit_event_s * p_next
Definition: eit.h:68
uint16_t i_descriptors_length
Definition: eit.h:63
bool b_nvod
Definition: eit.h:62
dvbpsi_descriptor_t * p_first_descriptor
Definition: eit.h:65
uint8_t i_running_status
Definition: eit.h:60
EIT structure.
Definition: eit.h:88
bool b_current_next
Definition: eit.h:93
uint16_t i_network_id
Definition: eit.h:95
uint8_t i_table_id
Definition: eit.h:89
dvbpsi_eit_event_t * p_first_event
Definition: eit.h:99
uint16_t i_ts_id
Definition: eit.h:94
uint8_t i_segment_last_section_number
Definition: eit.h:96
uint16_t i_extension
Definition: eit.h:90
uint8_t i_version
Definition: eit.h:92
uint8_t i_last_table_id
Definition: eit.h:97
PSI section structure.
Definition: psi.h:69
DVBPSI handle structure.
Definition: dvbpsi.h:143