libdvbpsi  0.2.2
pmt.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * pmt.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_PMT_H_
34 #define _DVBPSI_PMT_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /*****************************************************************************
42  * dvbpsi_pmt_es_t
43  *****************************************************************************/
55 typedef struct dvbpsi_pmt_es_s
56 {
57  uint8_t i_type;
58  uint16_t i_pid;
66 
67 
68 /*****************************************************************************
69  * dvbpsi_pmt_t
70  *****************************************************************************/
82 typedef struct dvbpsi_pmt_s
83 {
84  uint16_t i_program_number;
85  uint8_t i_version;
88  uint16_t i_pcr_pid;
94 } dvbpsi_pmt_t;
95 
96 
97 /*****************************************************************************
98  * dvbpsi_pmt_callback
99  *****************************************************************************/
105 typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
106 
107 
108 /*****************************************************************************
109  * dvbpsi_AttachPMT
110  *****************************************************************************/
121 __attribute__((deprecated))
122 dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number,
123  dvbpsi_pmt_callback pf_callback,
124  void* p_cb_data);
125 
126 
127 /*****************************************************************************
128  * dvbpsi_DetachPMT
129  *****************************************************************************/
138 __attribute__((deprecated))
139 void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi);
140 
141 
142 /*****************************************************************************
143  * dvbpsi_InitPMT/dvbpsi_NewPMT
144  *****************************************************************************/
157 __attribute__((deprecated))
158 void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
159  uint8_t i_version, int b_current_next, uint16_t i_pcr_pid);
160 
172 #define dvbpsi_NewPMT(p_pmt, i_program_number, \
173  i_version, b_current_next, i_pcr_pid) \
174 do { \
175  p_pmt = (dvbpsi_pmt_t*)malloc(sizeof(dvbpsi_pmt_t)); \
176  if(p_pmt != NULL) \
177  dvbpsi_InitPMT(p_pmt, i_program_number, i_version, b_current_next, \
178  i_pcr_pid); \
179 } while(0);
180 
181 
182 /*****************************************************************************
183  * dvbpsi_EmptyPMT/dvbpsi_DeletePMT
184  *****************************************************************************/
191 __attribute__((deprecated))
192 void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt);
193 
200 #define dvbpsi_DeletePMT(p_pmt) \
201 do { \
202  dvbpsi_EmptyPMT(p_pmt); \
203  free(p_pmt); \
204 } while(0);
205 
206 
207 /*****************************************************************************
208  * dvbpsi_PMTAddDescriptor
209  *****************************************************************************/
222 __attribute__((deprecated))
224  uint8_t i_tag, uint8_t i_length,
225  uint8_t* p_data);
226 
227 
228 /*****************************************************************************
229  * dvbpsi_PMTAddES
230  *****************************************************************************/
240 __attribute__((deprecated))
242  uint8_t i_type, uint16_t i_pid);
243 
244 
245 /*****************************************************************************
246  * dvbpsi_PMTESAddDescriptor
247  *****************************************************************************/
260 __attribute__((deprecated))
262  uint8_t i_tag, uint8_t i_length,
263  uint8_t* p_data);
264 
265 
266 /*****************************************************************************
267  * dvbpsi_GenPMTSections
268  *****************************************************************************/
277 __attribute__((deprecated))
279 
280 
281 #ifdef __cplusplus
282 };
283 #endif
284 
285 #else
286 #error "Multiple inclusions of pmt.h"
287 #endif
288 
void dvbpsi_InitPMT(dvbpsi_pmt_t *p_pmt, uint16_t i_program_number, uint8_t i_version, int b_current_next, uint16_t i_pcr_pid)
Initialize a user-allocated dvbpsi_pmt_t structure.
dvbpsi_psi_section_t * dvbpsi_GenPMTSections(dvbpsi_pmt_t *p_pmt)
PMT generator.
void(* dvbpsi_pmt_callback)(void *p_cb_data, dvbpsi_pmt_t *p_new_pmt)
Callback type definition.
Definition: pmt.h:105
dvbpsi_descriptor_t * dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t *p_es, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the PMT ES.
dvbpsi_pmt_es_t * p_first_es
Definition: pmt.h:92
uint16_t i_pcr_pid
Definition: pmt.h:88
dvbpsi_pmt_es_t * dvbpsi_PMTAddES(dvbpsi_pmt_t *p_pmt, uint8_t i_type, uint16_t i_pid)
Add an ES in the PMT.
int b_current_next
Definition: pmt.h:86
PSI section structure.
Definition: psi.h:69
struct dvbpsi_pmt_s dvbpsi_pmt_t
dvbpsi_pmt_t type definition.
uint16_t i_pid
Definition: pmt.h:58
uint8_t i_type
Definition: pmt.h:57
void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi)
Destroy a PMT decoder.
dvbpsi_descriptor_t * dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t *p_pmt, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the PMT.
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:60
struct dvbpsi_pmt_es_s * p_next
Definition: pmt.h:62
uint8_t i_version
Definition: pmt.h:85
PMT structure.
Definition: pmt.h:82
Descriptor structure.
Definition: descriptor.h:54
dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number, dvbpsi_pmt_callback pf_callback, void *p_cb_data)
Creation and initialization of a PMT decoder.
void dvbpsi_EmptyPMT(dvbpsi_pmt_t *p_pmt)
Clean a dvbpsi_pmt_t structure.
PMT ES structure.
Definition: pmt.h:55
struct dvbpsi_pmt_es_s dvbpsi_pmt_es_t
dvbpsi_pmt_es_t type definition.
uint16_t i_program_number
Definition: pmt.h:84
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:90