libdvbpsi 0.2.0
|
00001 /***************************************************************************** 00002 * sis.h 00003 * Copyright (c) 2010-2011 VideoLAN 00004 * $Id$ 00005 * 00006 * Authors: Jean-Paul Saman <jpsaman@videolan.org> 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_SIS_H_ 00034 #define _DVBPSI_SIS_H_ 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 /***************************************************************************** 00041 * dvbpsi_sis_t 00042 *****************************************************************************/ 00054 typedef struct dvbpsi_sis_s 00055 { 00056 /* section */ 00057 uint8_t i_protocol_version; 00060 /* encryption */ 00061 int b_encrypted_packet; 00063 uint8_t i_encryption_algorithm; 00066 uint64_t i_pts_adjustment; 00067 uint8_t cw_index; 00069 /* splice command */ 00070 uint16_t i_splice_command_length; 00071 uint8_t i_splice_command_type; 00073 /* FIXME: splice_info_section comes here 00074 * splice_command_type splice_info_section 00075 * 0x00 splice_null() 00076 * 0x01 reserved 00077 * 0x02 reserved 00078 * 0x03 reserved 00079 * 0x04 splice_schedule() 00080 * 0x05 splice_insert() 00081 * 0x06 time_signal() 00082 * 0x07 bandwidth_reservation() 00083 * 0x08 - 0xff reserved 00084 */ 00085 00086 /* descriptors */ 00087 uint16_t i_descriptors_length; 00089 dvbpsi_descriptor_t * p_first_descriptor; 00092 /* FIXME: alignment stuffing */ 00093 00094 uint32_t i_ecrc; 00096 } dvbpsi_sis_t; 00097 00098 /***************************************************************************** 00099 * dvbpsi_sis_callback 00100 *****************************************************************************/ 00106 typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis); 00107 00108 00109 /***************************************************************************** 00110 * dvbpsi_AttachSIS 00111 *****************************************************************************/ 00124 __attribute__((deprecated)) 00125 int dvbpsi_AttachSIS(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id, 00126 uint16_t i_extension, dvbpsi_sis_callback pf_callback, 00127 void* p_cb_data); 00128 00129 00130 /***************************************************************************** 00131 * dvbpsi_DetachSIS 00132 *****************************************************************************/ 00142 __attribute__((deprecated)) 00143 void dvbpsi_DetachSIS(dvbpsi_demux_t * p_demux, uint8_t i_table_id, 00144 uint16_t i_extension); 00145 00146 00147 /***************************************************************************** 00148 * dvbpsi_InitSIS/dvbpsi_NewSIS 00149 *****************************************************************************/ 00158 __attribute__((deprecated)) 00159 void dvbpsi_InitSIS(dvbpsi_sis_t *p_sis, uint8_t i_protocol_version); 00160 00168 #define dvbpsi_NewSIS(p_sis, i_protocol_version) \ 00169 do { \ 00170 p_sis = (dvbpsi_sis_t*)malloc(sizeof(dvbpsi_sis_t)); \ 00171 if(p_sis != NULL) \ 00172 dvbpsi_InitSIS(p_sis, i_protocol_version); \ 00173 } while(0); 00174 00175 /***************************************************************************** 00176 * dvbpsi_EmptySIS/dvbpsi_DeleteSIS 00177 *****************************************************************************/ 00184 __attribute__((deprecated)) 00185 void dvbpsi_EmptySIS(dvbpsi_sis_t *p_sis); 00186 00193 #define dvbpsi_DeleteSIS(p_sis) \ 00194 do { \ 00195 dvbpsi_EmptySIS(p_sis); \ 00196 free(p_sis); \ 00197 } while(0); 00198 00199 /***************************************************************************** 00200 * dvbpsi_SISAddDescriptor 00201 *****************************************************************************/ 00213 __attribute__((deprecated)) 00214 dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor( dvbpsi_sis_t *p_sis, 00215 uint8_t i_tag, uint8_t i_length, 00216 uint8_t *p_data); 00217 00218 /***************************************************************************** 00219 * dvbpsi_GenSISSections 00220 ***************************************************************************** 00221 * Generate SIS sections based on the dvbpsi_sis_t structure. 00222 *****************************************************************************/ 00223 __attribute__((deprecated)) 00224 dvbpsi_psi_section_t *dvbpsi_GenSISSections(dvbpsi_sis_t * p_sis); 00225 00226 #ifdef __cplusplus 00227 }; 00228 #endif 00229 00230 #else 00231 #error "Multiple inclusions of sis.h" 00232 #endif 00233