libdvbpsi  0.2.2
pat.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * pat.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  *****************************************************************************/
23 
33 #ifndef _DVBPSI_PAT_H_
34 #define _DVBPSI_PAT_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /*****************************************************************************
42  * dvbpsi_pat_program_t
43  *****************************************************************************/
55 typedef struct dvbpsi_pat_program_s
56 {
57  uint16_t i_number;
58  uint16_t i_pid;
64 
65 
66 /*****************************************************************************
67  * dvbpsi_pat_t
68  *****************************************************************************/
80 typedef struct dvbpsi_pat_s
81 {
82  uint16_t i_ts_id;
83  uint8_t i_version;
88 } dvbpsi_pat_t;
89 
90 
91 /*****************************************************************************
92  * dvbpsi_pat_callback
93  *****************************************************************************/
99 typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat);
100 
101 
102 /*****************************************************************************
103  * dvbpsi_AttachPAT
104  *****************************************************************************/
113 __attribute__((deprecated))
114 dvbpsi_handle dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback,
115  void* p_cb_data);
116 
117 
118 /*****************************************************************************
119  * dvbpsi_DetachPAT
120  *****************************************************************************/
129 __attribute__((deprecated))
130 void dvbpsi_DetachPAT(dvbpsi_handle h_dvbpsi);
131 
132 
133 /*****************************************************************************
134  * dvbpsi_InitPAT/dvbpsi_NewPAT
135  *****************************************************************************/
146 __attribute__((deprecated))
147 void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
148  int b_current_next);
149 
159 #define dvbpsi_NewPAT(p_pat, i_ts_id, i_version, b_current_next) \
160 do { \
161  p_pat = (dvbpsi_pat_t*)malloc(sizeof(dvbpsi_pat_t)); \
162  if(p_pat != NULL) \
163  dvbpsi_InitPAT(p_pat, i_ts_id, i_version, b_current_next); \
164 } while(0);
165 
166 
167 /*****************************************************************************
168  * dvbpsi_EmptyPAT/dvbpsi_DeletePAT
169  *****************************************************************************/
176 __attribute__((deprecated))
177 void dvbpsi_EmptyPAT(dvbpsi_pat_t* p_pat);
178 
185 #define dvbpsi_DeletePAT(p_pat) \
186 do { \
187  dvbpsi_EmptyPAT(p_pat); \
188  free(p_pat); \
189 } while(0);
190 
191 
192 /*****************************************************************************
193  * dvbpsi_PATAddProgram
194  *****************************************************************************/
205 __attribute__((deprecated))
206 dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
207  uint16_t i_number, uint16_t i_pid);
208 
209 /*****************************************************************************
210  * dvbpsi_GenPATSections
211  *****************************************************************************/
223 __attribute__((deprecated))
224 dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_pat_t* p_pat,
225  int i_max_pps);
226 
227 
228 #ifdef __cplusplus
229 };
230 #endif
231 
232 #else
233 #error "Multiple inclusions of pat.h"
234 #endif
235