libdvbpsi  2.0.0-git
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;
93 } dvbpsi_pmt_t;
94 
95 /*****************************************************************************
96  * dvbpsi_pmt_callback
97  *****************************************************************************/
103 typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
104 
105 /*****************************************************************************
106  * dvbpsi_pmt_attach
107  *****************************************************************************/
121 bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
122  dvbpsi_pmt_callback pf_callback, void* p_cb_data);
123 
124 /*****************************************************************************
125  * dvbpsi_pmt_detach
126  *****************************************************************************/
135 void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi);
136 
137 /*****************************************************************************
138  * dvbpsi_pmt_init/dvbpsi_pmt_new
139  *****************************************************************************/
152 void dvbpsi_pmt_init(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
153  uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid);
154 
166 dvbpsi_pmt_t* dvbpsi_pmt_new(uint16_t i_program_number, uint8_t i_version,
167  bool b_current_next, uint16_t i_pcr_pid);
168 
169 /*****************************************************************************
170  * dvbpsi_pmt_empty/dvbpsi_pmt_delete
171  *****************************************************************************/
178 void dvbpsi_pmt_empty(dvbpsi_pmt_t* p_pmt);
179 
186 void dvbpsi_pmt_delete(dvbpsi_pmt_t* p_pmt);
187 
188 /*****************************************************************************
189  * dvbpsi_pmt_descriptor_add
190  *****************************************************************************/
204  uint8_t i_tag, uint8_t i_length,
205  uint8_t* p_data);
206 
207 /*****************************************************************************
208  * dvbpsi_pmt_es_add
209  *****************************************************************************/
220  uint8_t i_type, uint16_t i_pid);
221 
222 /*****************************************************************************
223  * dvbpsi_pmt_es_descriptor_add
224  *****************************************************************************/
238  uint8_t i_tag, uint8_t i_length,
239  uint8_t* p_data);
240 
241 /*****************************************************************************
242  * dvbpsi_pmt_sections_generate
243  *****************************************************************************/
255 
256 #ifdef __cplusplus
257 };
258 #endif
259 
260 #else
261 #error "Multiple inclusions of pmt.h"
262 #endif
void dvbpsi_pmt_delete(dvbpsi_pmt_t *p_pmt)
Clean and free a dvbpsi_pmt_t structure.
bool b_current_next
Definition: sis.h:107
void(* dvbpsi_pmt_callback)(void *p_cb_data, dvbpsi_pmt_t *p_new_pmt)
Callback type definition.
Definition: pmt.h:103
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_es_t * p_first_es
Definition: pmt.h:91
void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi)
Destroy a PMT decoder.
uint16_t i_pcr_pid
Definition: pmt.h:87
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.
bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint16_t i_program_number, dvbpsi_pmt_callback pf_callback, void *p_cb_data)
Creates and initialization of a PMT decoder and attaches it to dvbpsi_t handle.
PSI section structure.
Definition: psi.h:68
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.
struct dvbpsi_pmt_s dvbpsi_pmt_t
dvbpsi_pmt_t type definition.
void dvbpsi_pmt_empty(dvbpsi_pmt_t *p_pmt)
Clean a dvbpsi_pmt_t structure.
uint16_t i_pid
Definition: pmt.h:58
uint8_t i_type
Definition: pmt.h:57
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.
bool b_current_next
Definition: pmt.h:85
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:60
struct dvbpsi_pmt_es_s * p_next
Definition: pmt.h:62
dvbpsi_psi_section_t * dvbpsi_pmt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t *p_pmt)
PMT generator.
uint8_t i_version
Definition: pmt.h:84
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.
DVBPSI handle structure.
Definition: dvbpsi.h:142
PMT structure.
Definition: pmt.h:81
Descriptor structure.
Definition: descriptor.h:82
uint8_t i_version
Definition: sis.h:104
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:83
dvbpsi_descriptor_t * p_first_descriptor
Definition: pmt.h:89