libdvbpsi  1.3.0
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  *          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_SDT_H_
00035 #define _DVBPSI_SDT_H_
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 /*****************************************************************************
00042  * dvbpsi_sdt_service_t
00043  *****************************************************************************/
00055 typedef struct dvbpsi_sdt_service_s
00056 {
00057   uint16_t                  i_service_id;           
00058   bool                      b_eit_schedule;         
00059   bool                      b_eit_present;          
00061   uint8_t                   i_running_status;       
00062   bool                      b_free_ca;              
00063   uint16_t                  i_descriptors_length;   
00065   dvbpsi_descriptor_t *     p_first_descriptor;     
00068   struct dvbpsi_sdt_service_s * p_next;             
00071 } dvbpsi_sdt_service_t;
00072 
00073 /*****************************************************************************
00074  * dvbpsi_sdt_t
00075  *****************************************************************************/
00087 typedef struct dvbpsi_sdt_s
00088 {
00089     /* PSI table members */
00090     uint8_t                   i_table_id;         
00091     uint16_t                  i_extension;        
00093     /* Table specific */
00094     uint8_t                   i_version;          
00095     bool                      b_current_next;     
00096     uint16_t                  i_network_id;       
00098     dvbpsi_sdt_service_t *    p_first_service;    
00101 } dvbpsi_sdt_t;
00102 
00103 /*****************************************************************************
00104  * dvbpsi_sdt_callback
00105  *****************************************************************************/
00111 typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
00112 
00113 /*****************************************************************************
00114  * dvbpsi_sdt_attach
00115  *****************************************************************************/
00128 bool dvbpsi_sdt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
00129                       dvbpsi_sdt_callback pf_callback, void* p_cb_data);
00130 
00131 /*****************************************************************************
00132  * dvbpsi_sdt_detach
00133  *****************************************************************************/
00143 void dvbpsi_sdt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
00144 
00145 /*****************************************************************************
00146  * dvbpsi_sdt_init/dvbpsi_NewSDT
00147  *****************************************************************************/
00160 void dvbpsi_sdt_init(dvbpsi_sdt_t *p_sdt, uint8_t i_table_id, uint16_t i_extension,
00161                      uint8_t i_version, bool b_current_next, uint16_t i_network_id);
00162 
00174 dvbpsi_sdt_t *dvbpsi_sdt_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version,
00175                              bool b_current_next, uint16_t i_network_id);
00176 
00177 /*****************************************************************************
00178  * dvbpsi_sdt_empty/dvbpsi_sdt_delete
00179  *****************************************************************************/
00186 void dvbpsi_sdt_empty(dvbpsi_sdt_t *p_sdt);
00187 
00194 void dvbpsi_sdt_delete(dvbpsi_sdt_t *p_sdt);
00195 
00196 /*****************************************************************************
00197  * dvbpsi_sdt_service_add
00198  *****************************************************************************/
00215 dvbpsi_sdt_service_t *dvbpsi_sdt_service_add(dvbpsi_sdt_t* p_sdt,
00216     uint16_t i_service_id, bool b_eit_schedule, bool b_eit_present,
00217     uint8_t i_running_status, bool b_free_ca);
00218 
00219 /*****************************************************************************
00220  * dvbpsi_sdt_service_descriptor_add
00221  *****************************************************************************/
00234 dvbpsi_descriptor_t *dvbpsi_sdt_service_descriptor_add(
00235                                                dvbpsi_sdt_service_t *p_service,
00236                                                uint8_t i_tag, uint8_t i_length,
00237                                                uint8_t *p_data);
00238 
00239 /*****************************************************************************
00240  * dvbpsi_sdt_sections_generate
00241  *****************************************************************************
00242  * Generate SDT sections based on the dvbpsi_sdt_t structure.
00243  *****************************************************************************/
00254 dvbpsi_psi_section_t *dvbpsi_sdt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sdt_t * p_sdt);
00255 
00256 #ifdef __cplusplus
00257 };
00258 #endif
00259 
00260 #else
00261 #error "Multiple inclusions of sdt.h"
00262 #endif