00001 /***************************************************************************** 00002 * pmt.h 00003 * (c)2001-2002 VideoLAN 00004 * $Id: pmt.h,v 1.5 2002/03/27 20:02:43 bozo Exp $ 00005 * 00006 * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * This program 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 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 * 00022 *****************************************************************************/ 00023 00036 #ifndef _DVBPSI_PMT_H_ 00037 #define _DVBPSI_PMT_H_ 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00043 00044 /***************************************************************************** 00045 * dvbpsi_pmt_es_t 00046 *****************************************************************************/ 00058 typedef struct dvbpsi_pmt_es_s 00059 { 00060 uint8_t i_type; 00061 uint16_t i_pid; 00063 dvbpsi_descriptor_t * p_first_descriptor; 00065 struct dvbpsi_pmt_es_s * p_next; 00068 } dvbpsi_pmt_es_t; 00069 00070 00071 /***************************************************************************** 00072 * dvbpsi_pmt_t 00073 *****************************************************************************/ 00085 typedef struct dvbpsi_pmt_s 00086 { 00087 uint16_t i_program_number; 00088 uint8_t i_version; 00089 int b_current_next; 00091 uint16_t i_pcr_pid; 00093 dvbpsi_descriptor_t * p_first_descriptor; 00095 dvbpsi_pmt_es_t * p_first_es; 00097 } dvbpsi_pmt_t; 00098 00099 00100 /***************************************************************************** 00101 * dvbpsi_pmt_callback 00102 *****************************************************************************/ 00108 typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt); 00109 00110 00111 /***************************************************************************** 00112 * dvbpsi_AttachPMT 00113 *****************************************************************************/ 00124 dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number, 00125 dvbpsi_pmt_callback pf_callback, 00126 void* p_cb_data); 00127 00128 00129 /***************************************************************************** 00130 * dvbpsi_DetachPMT 00131 *****************************************************************************/ 00140 void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi); 00141 00142 00143 /***************************************************************************** 00144 * dvbpsi_InitPMT/dvbpsi_NewPMT 00145 *****************************************************************************/ 00158 void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number, 00159 uint8_t i_version, int b_current_next, uint16_t i_pcr_pid); 00160 00172 #define dvbpsi_NewPMT(p_pmt, i_program_number, \ 00173 i_version, b_current_next, i_pcr_pid) \ 00174 p_pmt = (dvbpsi_pmt_t*)malloc(sizeof(dvbpsi_pmt_t)); \ 00175 if(p_pmt != NULL) \ 00176 dvbpsi_InitPMT(p_pmt, i_program_number, i_version, b_current_next, \ 00177 i_pcr_pid); 00178 00179 00180 /***************************************************************************** 00181 * dvbpsi_EmptyPMT/dvbpsi_DeletePMT 00182 *****************************************************************************/ 00189 void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt); 00190 00197 #define dvbpsi_DeletePMT(p_pmt) \ 00198 dvbpsi_EmptyPMT(p_pmt); \ 00199 free(p_pmt); 00200 00201 00202 /***************************************************************************** 00203 * dvbpsi_PMTAddDescriptor 00204 *****************************************************************************/ 00217 dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt, 00218 uint8_t i_tag, uint8_t i_length, 00219 uint8_t* p_data); 00220 00221 00222 /***************************************************************************** 00223 * dvbpsi_PMTAddES 00224 *****************************************************************************/ 00234 dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt, 00235 uint8_t i_type, uint16_t i_pid); 00236 00237 00238 /***************************************************************************** 00239 * dvbpsi_PMTESAddDescriptor 00240 *****************************************************************************/ 00253 dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es, 00254 uint8_t i_tag, uint8_t i_length, 00255 uint8_t* p_data); 00256 00257 00258 /***************************************************************************** 00259 * dvbpsi_GenPMTSections 00260 *****************************************************************************/ 00269 dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt); 00270 00271 00272 #ifdef __cplusplus 00273 }; 00274 #endif 00275 00276 #else 00277 #error "Multiple inclusions of pmt.h" 00278 #endif 00279
1.3.3