libdvbpsi  0.2.2
sdt.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * sdt.h
00003  * Copyright (C) 2001-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Johan Bilien <jobi@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_SDT_H_
00034 #define _DVBPSI_SDT_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 
00041 /*****************************************************************************
00042  * dvbpsi_sdt_service_t
00043  *****************************************************************************/
00055 typedef struct dvbpsi_sdt_service_s
00056 {
00057   uint16_t                  i_service_id;           
00058   int                       b_eit_schedule;         
00059   int                       b_eit_present;          
00061   uint8_t                   i_running_status;       
00062   int                       b_free_ca;              
00063   uint16_t                  i_descriptors_length;   
00065   dvbpsi_descriptor_t *     p_first_descriptor;     
00069   struct dvbpsi_sdt_service_s * p_next;             
00072 } dvbpsi_sdt_service_t;
00073 
00074 
00075 /*****************************************************************************
00076  * dvbpsi_sdt_t
00077  *****************************************************************************/
00089 typedef struct dvbpsi_sdt_s
00090 {
00091   uint16_t                  i_ts_id;            
00092   uint8_t                   i_version;          
00093   int                       b_current_next;     
00094   uint16_t                  i_network_id;       
00096   dvbpsi_sdt_service_t *    p_first_service;    
00099 } dvbpsi_sdt_t;
00100 
00101 
00102 /*****************************************************************************
00103  * dvbpsi_sdt_callback
00104  *****************************************************************************/
00110 typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
00111 
00112 
00113 /*****************************************************************************
00114  * dvbpsi_AttachSDT
00115  *****************************************************************************/
00128 __attribute__((deprecated))
00129 int dvbpsi_AttachSDT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
00130           uint16_t i_extension, dvbpsi_sdt_callback pf_callback,
00131                                void* p_cb_data);
00132 
00133 
00134 /*****************************************************************************
00135  * dvbpsi_DetachSDT
00136  *****************************************************************************/
00146 __attribute__((deprecated))
00147 void dvbpsi_DetachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
00148           uint16_t i_extension);
00149 
00150 
00151 /*****************************************************************************
00152  * dvbpsi_InitSDT/dvbpsi_NewSDT
00153  *****************************************************************************/
00165 __attribute__((deprecated))
00166 void dvbpsi_InitSDT(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
00167                     int b_current_next, uint16_t i_network_id);
00168 
00179 #define dvbpsi_NewSDT(p_sdt, i_ts_id, i_version, b_current_next,i_network_id) \
00180 do {                                                                    \
00181   p_sdt = (dvbpsi_sdt_t*)malloc(sizeof(dvbpsi_sdt_t));                  \
00182   if(p_sdt != NULL)                                                     \
00183     dvbpsi_InitSDT(p_sdt, i_ts_id, i_version, b_current_next, i_network_id); \
00184 } while(0);
00185 
00186 
00187 /*****************************************************************************
00188  * dvbpsi_EmptySDT/dvbpsi_DeleteSDT
00189  *****************************************************************************/
00196 __attribute__((deprecated))
00197 void dvbpsi_EmptySDT(dvbpsi_sdt_t *p_sdt);
00198 
00205 #define dvbpsi_DeleteSDT(p_sdt)                                         \
00206 do {                                                                    \
00207   dvbpsi_EmptySDT(p_sdt);                                               \
00208   free(p_sdt);                                                          \
00209 } while(0);
00210 
00211 
00212 /*****************************************************************************
00213  * dvbpsi_SDTAddService
00214  *****************************************************************************/
00231 __attribute__((deprecated))
00232 dvbpsi_sdt_service_t *dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
00233     uint16_t i_service_id, int b_eit_schedule, int b_eit_present,
00234     uint8_t i_running_status,int b_free_ca);
00235 
00236 
00237 /*****************************************************************************
00238  * dvbpsi_SDTServiceAddDescriptor
00239  *****************************************************************************/
00252 __attribute__((deprecated))
00253 dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
00254                                                dvbpsi_sdt_service_t *p_service,
00255                                                uint8_t i_tag, uint8_t i_length,
00256                                                uint8_t *p_data);
00257 
00258 
00259 /*****************************************************************************
00260  * dvbpsi_GenSDTSections
00261  *****************************************************************************
00262  * Generate SDT sections based on the dvbpsi_sdt_t structure.
00263  *****************************************************************************/
00264 dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_sdt_t * p_sdt);
00265 
00266 #ifdef __cplusplus
00267 };
00268 #endif
00269 
00270 #else
00271 #error "Multiple inclusions of sdt.h"
00272 #endif
00273