libdvbpsi  0.2.2
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  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  *
00022  *****************************************************************************/
00023 
00033 #ifndef _DVBPSI_EIT_H_
00034 #define _DVBPSI_EIT_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
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   int                       b_free_ca;              
00062   uint16_t                  i_descriptors_length;   
00064   dvbpsi_descriptor_t *     p_first_descriptor;     
00068   struct dvbpsi_eit_event_s * p_next;               
00071 } dvbpsi_eit_event_t;
00072 
00073 
00074 /*****************************************************************************
00075  * dvbpsi_eit_t
00076  *****************************************************************************/
00088 typedef struct dvbpsi_eit_s
00089 {
00090   uint16_t                  i_service_id;       
00091   uint8_t                   i_version;          
00092   int                       b_current_next;     
00093   uint16_t                  i_ts_id;            
00094   uint16_t                  i_network_id;       
00095   uint8_t                   i_segment_last_section_number; 
00096   uint8_t                   i_last_table_id;    
00098   dvbpsi_eit_event_t *      p_first_event;      
00100 } dvbpsi_eit_t;
00101 
00102 
00103 /*****************************************************************************
00104  * dvbpsi_eit_callback
00105  *****************************************************************************/
00111 typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
00112 
00113 
00114 /*****************************************************************************
00115  * dvbpsi_AttachEIT
00116  *****************************************************************************/
00129 __attribute__((deprecated))
00130 int dvbpsi_AttachEIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
00131           uint16_t i_extension, dvbpsi_eit_callback pf_callback,
00132                                void* p_cb_data);
00133 
00134 
00135 /*****************************************************************************
00136  * dvbpsi_DetachEIT
00137  *****************************************************************************/
00147 __attribute__((deprecated))
00148 void dvbpsi_DetachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
00149           uint16_t i_extension);
00150 
00151 
00152 /*****************************************************************************
00153  * dvbpsi_InitEIT/dvbpsi_NewEIT
00154  *****************************************************************************/
00171 __attribute__((deprecated))
00172 void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_version,
00173                     int b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
00174                     uint8_t i_segment_last_section_number,
00175                     uint8_t i_last_table_id);
00176 
00187 #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) \
00188 do {                                                                    \
00189   p_eit = (dvbpsi_eit_t*)malloc(sizeof(dvbpsi_eit_t));                  \
00190   if(p_eit != NULL)                                                     \
00191     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); \
00192 } while(0);
00193 
00194 
00195 /*****************************************************************************
00196  * dvbpsi_EmptyEIT/dvbpsi_DeleteEIT
00197  *****************************************************************************/
00204 __attribute__((deprecated))
00205 void dvbpsi_EmptyEIT(dvbpsi_eit_t* p_eit);
00206 
00213 #define dvbpsi_DeleteEIT(p_eit)                                         \
00214 do {                                                                    \
00215   dvbpsi_EmptyEIT(p_eit);                                               \
00216   free(p_eit);                                                          \
00217 } while(0);
00218 
00219 
00220 /*****************************************************************************
00221  * dvbpsi_EITAddEvent
00222  *****************************************************************************/
00239 dvbpsi_eit_event_t* dvbpsi_EITAddEvent(dvbpsi_eit_t* p_eit,
00240     uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
00241     uint8_t i_running_status, int b_free_ca);
00242 
00243 /*****************************************************************************
00244  * dvbpsi_EITEventAddDescriptor
00245  *****************************************************************************/
00258 __attribute__((deprecated))
00259 dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
00260                                                dvbpsi_eit_event_t* p_event,
00261                                                uint8_t i_tag, uint8_t i_length,
00262                                                uint8_t* p_data);
00263 
00264 #ifdef __cplusplus
00265 };
00266 #endif
00267 
00268 #else
00269 #error "Multiple inclusions of eit.h"
00270 #endif
00271