libdvbpsi 0.2.0
|
00001 /***************************************************************************** 00002 * pat.h 00003 * Copyright (C) 2001-2011 VideoLAN 00004 * $Id$ 00005 * 00006 * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> 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_PAT_H_ 00034 #define _DVBPSI_PAT_H_ 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 00041 /***************************************************************************** 00042 * dvbpsi_pat_program_t 00043 *****************************************************************************/ 00055 typedef struct dvbpsi_pat_program_s 00056 { 00057 uint16_t i_number; 00058 uint16_t i_pid; 00060 struct dvbpsi_pat_program_s * p_next; 00063 } dvbpsi_pat_program_t; 00064 00065 00066 /***************************************************************************** 00067 * dvbpsi_pat_t 00068 *****************************************************************************/ 00080 typedef struct dvbpsi_pat_s 00081 { 00082 uint16_t i_ts_id; 00083 uint8_t i_version; 00084 int b_current_next; 00086 dvbpsi_pat_program_t * p_first_program; 00088 } dvbpsi_pat_t; 00089 00090 00091 /***************************************************************************** 00092 * dvbpsi_pat_callback 00093 *****************************************************************************/ 00099 typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat); 00100 00101 00102 /***************************************************************************** 00103 * dvbpsi_AttachPAT 00104 *****************************************************************************/ 00113 __attribute__((deprecated)) 00114 dvbpsi_handle dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback, 00115 void* p_cb_data); 00116 00117 00118 /***************************************************************************** 00119 * dvbpsi_DetachPAT 00120 *****************************************************************************/ 00129 __attribute__((deprecated)) 00130 void dvbpsi_DetachPAT(dvbpsi_handle h_dvbpsi); 00131 00132 00133 /***************************************************************************** 00134 * dvbpsi_InitPAT/dvbpsi_NewPAT 00135 *****************************************************************************/ 00146 __attribute__((deprecated)) 00147 void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version, 00148 int b_current_next); 00149 00159 #define dvbpsi_NewPAT(p_pat, i_ts_id, i_version, b_current_next) \ 00160 do { \ 00161 p_pat = (dvbpsi_pat_t*)malloc(sizeof(dvbpsi_pat_t)); \ 00162 if(p_pat != NULL) \ 00163 dvbpsi_InitPAT(p_pat, i_ts_id, i_version, b_current_next); \ 00164 } while(0); 00165 00166 00167 /***************************************************************************** 00168 * dvbpsi_EmptyPAT/dvbpsi_DeletePAT 00169 *****************************************************************************/ 00176 __attribute__((deprecated)) 00177 void dvbpsi_EmptyPAT(dvbpsi_pat_t* p_pat); 00178 00185 #define dvbpsi_DeletePAT(p_pat) \ 00186 do { \ 00187 dvbpsi_EmptyPAT(p_pat); \ 00188 free(p_pat); \ 00189 } while(0); 00190 00191 00192 /***************************************************************************** 00193 * dvbpsi_PATAddProgram 00194 *****************************************************************************/ 00205 __attribute__((deprecated)) 00206 dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat, 00207 uint16_t i_number, uint16_t i_pid); 00208 00209 /***************************************************************************** 00210 * dvbpsi_GenPATSections 00211 *****************************************************************************/ 00223 __attribute__((deprecated)) 00224 dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_pat_t* p_pat, 00225 int i_max_pps); 00226 00227 00228 #ifdef __cplusplus 00229 }; 00230 #endif 00231 00232 #else 00233 #error "Multiple inclusions of pat.h" 00234 #endif 00235