libdvbpsi 0.2.0
pmt.h
Go to the documentation of this file.
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  *
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_PMT_H_
00034 #define _DVBPSI_PMT_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
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 /*****************************************************************************
00069  * dvbpsi_pmt_t
00070  *****************************************************************************/
00082 typedef struct dvbpsi_pmt_s
00083 {
00084   uint16_t                  i_program_number;   
00085   uint8_t                   i_version;          
00086   int                       b_current_next;     
00088   uint16_t                  i_pcr_pid;          
00090   dvbpsi_descriptor_t *     p_first_descriptor; 
00092   dvbpsi_pmt_es_t *         p_first_es;         
00094 } dvbpsi_pmt_t;
00095 
00096 
00097 /*****************************************************************************
00098  * dvbpsi_pmt_callback
00099  *****************************************************************************/
00105 typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
00106 
00107 
00108 /*****************************************************************************
00109  * dvbpsi_AttachPMT
00110  *****************************************************************************/
00121 __attribute__((deprecated))
00122 dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number,
00123                                dvbpsi_pmt_callback pf_callback,
00124                                void* p_cb_data);
00125 
00126 
00127 /*****************************************************************************
00128  * dvbpsi_DetachPMT
00129  *****************************************************************************/
00138 __attribute__((deprecated))
00139 void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi);
00140 
00141 
00142 /*****************************************************************************
00143  * dvbpsi_InitPMT/dvbpsi_NewPMT
00144  *****************************************************************************/
00157 __attribute__((deprecated))
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 do {                                                                    \
00175   p_pmt = (dvbpsi_pmt_t*)malloc(sizeof(dvbpsi_pmt_t));                  \
00176   if(p_pmt != NULL)                                                     \
00177     dvbpsi_InitPMT(p_pmt, i_program_number, i_version, b_current_next,  \
00178                    i_pcr_pid);                                          \
00179 } while(0);
00180 
00181 
00182 /*****************************************************************************
00183  * dvbpsi_EmptyPMT/dvbpsi_DeletePMT
00184  *****************************************************************************/
00191 __attribute__((deprecated))
00192 void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt);
00193 
00200 #define dvbpsi_DeletePMT(p_pmt)                                         \
00201 do {                                                                    \
00202   dvbpsi_EmptyPMT(p_pmt);                                               \
00203   free(p_pmt);                                                          \
00204 } while(0);
00205 
00206 
00207 /*****************************************************************************
00208  * dvbpsi_PMTAddDescriptor
00209  *****************************************************************************/
00222 __attribute__((deprecated))
00223 dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
00224                                              uint8_t i_tag, uint8_t i_length,
00225                                              uint8_t* p_data);
00226 
00227 
00228 /*****************************************************************************
00229  * dvbpsi_PMTAddES
00230  *****************************************************************************/
00240 __attribute__((deprecated))
00241 dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
00242                                  uint8_t i_type, uint16_t i_pid);
00243 
00244 
00245 /*****************************************************************************
00246  * dvbpsi_PMTESAddDescriptor
00247  *****************************************************************************/
00260 __attribute__((deprecated))
00261 dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
00262                                                uint8_t i_tag, uint8_t i_length,
00263                                                uint8_t* p_data);
00264 
00265 
00266 /*****************************************************************************
00267  * dvbpsi_GenPMTSections
00268  *****************************************************************************/
00277 __attribute__((deprecated))
00278 dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt);
00279 
00280 
00281 #ifdef __cplusplus
00282 };
00283 #endif
00284 
00285 #else
00286 #error "Multiple inclusions of pmt.h"
00287 #endif
00288