00001 /***************************************************************************** 00002 * pmt.h 00003 * Copyright (C) 2001-2011 VideoLAN 00004 * $Id$ 00005 * 00006 * Authors: Arnaud de Bossoreille de Ribou <bozo@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_PMT_H_ 00035 #define _DVBPSI_PMT_H_ 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00041 /***************************************************************************** 00042 * dvbpsi_pmt_es_t 00043 *****************************************************************************/ 00055 typedef struct dvbpsi_pmt_es_s 00056 { 00057 uint8_t i_type; 00058 uint16_t i_pid; 00060 dvbpsi_descriptor_t * p_first_descriptor; 00062 struct dvbpsi_pmt_es_s * p_next; 00065 } dvbpsi_pmt_es_t; 00066 00067 /***************************************************************************** 00068 * dvbpsi_pmt_t 00069 *****************************************************************************/ 00081 typedef struct dvbpsi_pmt_s 00082 { 00083 uint16_t i_program_number; 00084 uint8_t i_version; 00085 bool b_current_next; 00087 uint16_t i_pcr_pid; 00089 dvbpsi_descriptor_t * p_first_descriptor; 00091 dvbpsi_pmt_es_t * p_first_es; 00093 } dvbpsi_pmt_t; 00094 00095 /***************************************************************************** 00096 * dvbpsi_pmt_callback 00097 *****************************************************************************/ 00103 typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt); 00104 00105 /***************************************************************************** 00106 * dvbpsi_pmt_attach 00107 *****************************************************************************/ 00121 bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint16_t i_program_number, 00122 dvbpsi_pmt_callback pf_callback, void* p_cb_data); 00123 00124 /***************************************************************************** 00125 * dvbpsi_pmt_detach 00126 *****************************************************************************/ 00135 void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi); 00136 00137 /***************************************************************************** 00138 * dvbpsi_pmt_init/dvbpsi_pmt_new 00139 *****************************************************************************/ 00152 void dvbpsi_pmt_init(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number, 00153 uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid); 00154 00166 dvbpsi_pmt_t* dvbpsi_pmt_new(uint16_t i_program_number, uint8_t i_version, 00167 bool b_current_next, uint16_t i_pcr_pid); 00168 00169 /***************************************************************************** 00170 * dvbpsi_pmt_empty/dvbpsi_pmt_delete 00171 *****************************************************************************/ 00178 void dvbpsi_pmt_empty(dvbpsi_pmt_t* p_pmt); 00179 00186 void dvbpsi_pmt_delete(dvbpsi_pmt_t* p_pmt); 00187 00188 /***************************************************************************** 00189 * dvbpsi_pmt_descriptor_add 00190 *****************************************************************************/ 00203 dvbpsi_descriptor_t* dvbpsi_pmt_descriptor_add(dvbpsi_pmt_t* p_pmt, 00204 uint8_t i_tag, uint8_t i_length, 00205 uint8_t* p_data); 00206 00207 /***************************************************************************** 00208 * dvbpsi_pmt_es_add 00209 *****************************************************************************/ 00219 dvbpsi_pmt_es_t* dvbpsi_pmt_es_add(dvbpsi_pmt_t* p_pmt, 00220 uint8_t i_type, uint16_t i_pid); 00221 00222 /***************************************************************************** 00223 * dvbpsi_pmt_es_descriptor_add 00224 *****************************************************************************/ 00237 dvbpsi_descriptor_t* dvbpsi_pmt_es_descriptor_add(dvbpsi_pmt_es_t* p_es, 00238 uint8_t i_tag, uint8_t i_length, 00239 uint8_t* p_data); 00240 00241 /***************************************************************************** 00242 * dvbpsi_pmt_sections_generate 00243 *****************************************************************************/ 00254 dvbpsi_psi_section_t* dvbpsi_pmt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t* p_pmt); 00255 00256 #ifdef __cplusplus 00257 }; 00258 #endif 00259 00260 #else 00261 #error "Multiple inclusions of pmt.h" 00262 #endif