libdvbpsi  1.2.0
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