libdvbpsi  1.3.0
eit.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * eit.h
00003  * Copyright (C) 2004-2011 VideoLAN
00004  * $Id: eit.h 88 2004-02-24 14:31:18Z sam $
00005  *
00006  * Authors: Christophe Massiot <massiot@via.ecp.fr>
00007  *          Jean-Paul Saman <jpsaman@videolan.org>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  *****************************************************************************/
00024 
00034 #ifndef _DVBPSI_EIT_H_
00035 #define _DVBPSI_EIT_H_
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 /*****************************************************************************
00042  * dvbpsi_eit_event_t
00043  *****************************************************************************/
00055 typedef struct dvbpsi_eit_event_s
00056 {
00057   uint16_t                  i_event_id;             
00058   uint64_t                  i_start_time;           
00059   uint32_t                  i_duration;             
00060   uint8_t                   i_running_status;       
00061   bool                      b_free_ca;              
00062   bool                      b_nvod;                 
00063   uint16_t                  i_descriptors_length;   
00065   dvbpsi_descriptor_t *     p_first_descriptor;     
00068   struct dvbpsi_eit_event_s * p_next;               
00071 } dvbpsi_eit_event_t;
00072 
00073 /*****************************************************************************
00074  * dvbpsi_eit_t
00075  *****************************************************************************/
00087 typedef struct dvbpsi_eit_s
00088 {
00089     uint8_t             i_table_id;         
00090     uint16_t            i_extension;        
00092     uint8_t             i_version;          
00093     bool                b_current_next;     
00094     uint16_t            i_ts_id;            
00095     uint16_t            i_network_id;       
00096     uint8_t             i_segment_last_section_number; 
00097     uint8_t             i_last_table_id;    
00099     dvbpsi_eit_event_t *p_first_event;      
00101 } dvbpsi_eit_t;
00102 
00103 /*****************************************************************************
00104  * dvbpsi_eit_callback
00105  *****************************************************************************/
00110 typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
00111 
00112 /*****************************************************************************
00113  * dvbpsi_AttachEIT
00114  *****************************************************************************/
00127 bool dvbpsi_eit_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
00128                        dvbpsi_eit_callback pf_callback, void* p_cb_data);
00129 
00130 /*****************************************************************************
00131  * dvbpsi_eit_detach
00132  *****************************************************************************/
00143 void dvbpsi_eit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
00144 
00145 /*****************************************************************************
00146  * dvbpsi_eit_init/dvbpsi_eit_new
00147  *****************************************************************************/
00166 void dvbpsi_eit_init(dvbpsi_eit_t* p_eit, uint8_t i_table_id,
00167                      uint16_t i_extension, uint8_t i_version,
00168                      bool b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
00169                      uint8_t i_segment_last_section_number,
00170                      uint8_t i_last_table_id);
00171 
00188 dvbpsi_eit_t* dvbpsi_eit_new(uint8_t i_table_id, uint16_t i_extension,
00189                              uint8_t i_version, bool b_current_next,
00190                              uint16_t i_ts_id, uint16_t i_network_id,
00191                              uint8_t i_segment_last_section_number,
00192                              uint8_t i_last_table_id);
00193 
00194 /*****************************************************************************
00195  * dvbpsi_eit_empty/dvbpsi_eit_delete
00196  *****************************************************************************/
00203 void dvbpsi_eit_empty(dvbpsi_eit_t* p_eit);
00204 
00211 void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit);
00212 
00213 /*****************************************************************************
00214  * dvbpsi_eit_event_add
00215  *****************************************************************************/
00235 dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
00236     uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
00237     uint8_t i_running_status, bool b_free_ca,
00238     uint16_t i_event_descriptor_length);
00239 
00240 /*****************************************************************************
00241  * dvbpsi_eit_nvod_event_add
00242  *****************************************************************************/
00258 dvbpsi_eit_event_t* dvbpsi_eit_nvod_event_add(dvbpsi_eit_t* p_eit,
00259     uint16_t i_event_id, uint32_t i_duration, bool b_free_ca,
00260     uint16_t i_event_descriptor_length);
00261 
00262 /*****************************************************************************
00263  * dvbpsi_eit_event_descriptor_add
00264  *****************************************************************************/
00277 dvbpsi_descriptor_t* dvbpsi_eit_event_descriptor_add(
00278                                                dvbpsi_eit_event_t* p_event,
00279                                                uint8_t i_tag, uint8_t i_length,
00280                                                uint8_t* p_data);
00281 
00282 /*****************************************************************************
00283  * dvbpsi_eit_sections_generate
00284  *****************************************************************************
00285  * Generate EIT sections based on the dvbpsi_eit_t structure.
00286  *****************************************************************************/
00296 dvbpsi_psi_section_t *dvbpsi_eit_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
00297                                             uint8_t i_table_id);
00298 
00299 #ifdef __cplusplus
00300 };
00301 #endif
00302 
00303 #else
00304 #error "Multiple inclusions of eit.h"
00305 #endif
00306