00001 /***************************************************************************** 00002 * tot.h 00003 * Copyright (C) 2001-2011 VideoLAN 00004 * $Id$ 00005 * 00006 * Authors: Johann Hanne 00007 * heavily based on pmt.c which was written by 00008 * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> 00009 * Jean-Paul Saman <jpsaman@videolan.org> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Lesser General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2.1 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00024 * 00025 *****************************************************************************/ 00026 00037 #ifndef _DVBPSI_TOT_H_ 00038 #define _DVBPSI_TOT_H_ 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 /***************************************************************************** 00045 * dvbpsi_tot_t 00046 *****************************************************************************/ 00058 typedef struct dvbpsi_tot_s 00059 { 00060 uint8_t i_table_id; 00061 uint16_t i_extension; 00063 /* Subtable specific */ 00064 uint8_t i_version; 00065 bool b_current_next; 00067 uint64_t i_utc_time; 00069 dvbpsi_descriptor_t * p_first_descriptor; 00071 } __attribute__((packed)) dvbpsi_tot_t; 00072 00073 /***************************************************************************** 00074 * dvbpsi_tot_callback 00075 *****************************************************************************/ 00081 typedef void (* dvbpsi_tot_callback)(void* p_cb_data, dvbpsi_tot_t* p_new_tot); 00082 00083 /***************************************************************************** 00084 * dvbpsi_tot_attach 00085 *****************************************************************************/ 00097 bool dvbpsi_tot_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, 00098 dvbpsi_tot_callback pf_callback, void* p_cb_data); 00099 00100 /***************************************************************************** 00101 * dvbpsi_tot_detach 00102 *****************************************************************************/ 00111 void dvbpsi_tot_detach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, 00112 uint16_t i_extension); 00113 00114 /***************************************************************************** 00115 * dvbpsi_tot_init/dvbpsi_tot_new 00116 *****************************************************************************/ 00129 void dvbpsi_tot_init(dvbpsi_tot_t* p_tot, uint8_t i_table_id, uint16_t i_extension, 00130 uint8_t i_version, bool b_current_next, uint64_t i_utc_time); 00131 00143 dvbpsi_tot_t *dvbpsi_tot_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, 00144 bool b_current_next, uint64_t i_utc_time); 00145 00146 /***************************************************************************** 00147 * dvbpsi_tot_empty/dvbpsi_tot_delete 00148 *****************************************************************************/ 00155 void dvbpsi_tot_empty(dvbpsi_tot_t* p_tot); 00156 00163 void dvbpsi_tot_delete(dvbpsi_tot_t* p_tot); 00164 00165 /***************************************************************************** 00166 * dvbpsi_tot_descriptor_add 00167 *****************************************************************************/ 00180 dvbpsi_descriptor_t* dvbpsi_tot_descriptor_add(dvbpsi_tot_t* p_tot, 00181 uint8_t i_tag, uint8_t i_length, 00182 uint8_t* p_data); 00183 00184 /***************************************************************************** 00185 * dvbpsi_tot_sections_generate 00186 *****************************************************************************/ 00196 dvbpsi_psi_section_t* dvbpsi_tot_sections_generate(dvbpsi_t* p_dvbpsi, dvbpsi_tot_t* p_tot); 00197 00198 #ifdef __cplusplus 00199 }; 00200 #endif 00201 00202 #else 00203 #error "Multiple inclusions of tot.h" 00204 #endif