libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
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  * Jean-Paul Saman <jpsaman@videolan.org>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  *****************************************************************************/
24 
34 #ifndef _DVBPSI_PMT_H_
35 #define _DVBPSI_PMT_H_
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
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  * dvbpsi_pmt_t
69  *****************************************************************************/
81 typedef struct dvbpsi_pmt_s
82 {
83  uint16_t i_program_number;
84  uint8_t i_version;
87  uint16_t i_pcr_pid;
94 
95 /*****************************************************************************
96  * dvbpsi_pmt_callback
97  *****************************************************************************/
103 typedef void (* dvbpsi_pmt_callback)(void* p_priv, dvbpsi_pmt_t* p_new_pmt);
104 
105 /*****************************************************************************
106  * dvbpsi_pmt_attach
107  *****************************************************************************/
124 bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
125  dvbpsi_pmt_callback pf_callback, void* p_priv);
126 
127 /*****************************************************************************
128  * dvbpsi_pmt_detach
129  *****************************************************************************/
141 void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
142 
143 /*****************************************************************************
144  * dvbpsi_pmt_init/dvbpsi_pmt_new
145  *****************************************************************************/
158 void dvbpsi_pmt_init(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
159  uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid);
160 
172 dvbpsi_pmt_t* dvbpsi_pmt_new(uint16_t i_program_number, uint8_t i_version,
173  bool b_current_next, uint16_t i_pcr_pid);
174 
175 /*****************************************************************************
176  * dvbpsi_pmt_empty/dvbpsi_pmt_delete
177  *****************************************************************************/
185 
193 
194 /*****************************************************************************
195  * dvbpsi_pmt_descriptor_add
196  *****************************************************************************/
210  uint8_t i_tag, uint8_t i_length,
211  uint8_t* p_data);
212 
213 /*****************************************************************************
214  * dvbpsi_pmt_es_add
215  *****************************************************************************/
226  uint8_t i_type, uint16_t i_pid);
227 
228 /*****************************************************************************
229  * dvbpsi_pmt_es_descriptor_add
230  *****************************************************************************/
244  uint8_t i_tag, uint8_t i_length,
245  uint8_t* p_data);
246 
247 /*****************************************************************************
248  * dvbpsi_pmt_sections_generate
249  *****************************************************************************/
260 dvbpsi_psi_section_t* dvbpsi_pmt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t* p_pmt);
261 
262 #ifdef __cplusplus
263 };
264 #endif
265 
266 #else
267 #error "Multiple inclusions of pmt.h"
268 #endif
void dvbpsi_pmt_init(dvbpsi_pmt_t *p_pmt, uint16_t i_program_number, uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid)
Initialize a user-allocated dvbpsi_pmt_t structure.
dvbpsi_descriptor_t * dvbpsi_pmt_descriptor_add(dvbpsi_pmt_t *p_pmt, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the PMT.
void dvbpsi_pmt_empty(dvbpsi_pmt_t *p_pmt)
Clean a dvbpsi_pmt_t structure.
struct dvbpsi_pmt_es_s dvbpsi_pmt_es_t
dvbpsi_pmt_es_t type definition.
dvbpsi_pmt_es_t * dvbpsi_pmt_es_add(dvbpsi_pmt_t *p_pmt, uint8_t i_type, uint16_t i_pid)
Add an ES in the PMT.
void(* dvbpsi_pmt_callback)(void *p_priv, dvbpsi_pmt_t *p_new_pmt)
Callback type definition.
Definition: pmt.h:103
void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a PMT decoder.
struct dvbpsi_pmt_s dvbpsi_pmt_t
dvbpsi_pmt_t type definition.
dvbpsi_descriptor_t * dvbpsi_pmt_es_descriptor_add(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_t * dvbpsi_pmt_new(uint16_t i_program_number, uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid)
Allocate and initialize a new dvbpsi_pmt_t structure.
void dvbpsi_pmt_delete(dvbpsi_pmt_t *p_pmt)
Clean and free a dvbpsi_pmt_t structure.
Descriptor structure.
Definition: descriptor.h:83
PMT ES structure.
Definition: pmt.h:56
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:60
uint8_t i_type
Definition: pmt.h:57
struct dvbpsi_pmt_es_s * p_next
Definition: pmt.h:62
uint16_t i_pid
Definition: pmt.h:58
PMT structure.
Definition: pmt.h:82
uint8_t i_version
Definition: pmt.h:84
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:89
dvbpsi_pmt_es_t * p_first_es
Definition: pmt.h:91
bool b_current_next
Definition: pmt.h:85
uint16_t i_program_number
Definition: pmt.h:83
uint16_t i_pcr_pid
Definition: pmt.h:87
PSI section structure.
Definition: psi.h:69
DVBPSI handle structure.
Definition: dvbpsi.h:143