libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
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  * dvbpsi_pat_program_t
42  *****************************************************************************/
54 typedef struct dvbpsi_pat_program_s
55 {
56  uint16_t i_number;
57  uint16_t i_pid;
63 
64 
65 /*****************************************************************************
66  * dvbpsi_pat_t
67  *****************************************************************************/
79 typedef struct dvbpsi_pat_s
80 {
81  uint16_t i_ts_id;
82  uint8_t i_version;
88 
89 
90 /*****************************************************************************
91  * dvbpsi_pat_callback
92  *****************************************************************************/
98 typedef void (* dvbpsi_pat_callback)(void* p_priv, dvbpsi_pat_t* p_new_pat);
99 
100 /*****************************************************************************
101  * dvbpsi_pat_attach
102  *****************************************************************************/
114 bool dvbpsi_pat_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
115  dvbpsi_pat_callback pf_callback, void* p_priv);
116 
117 /*****************************************************************************
118  * dvbpsi_pat_detach
119  *****************************************************************************/
130 void dvbpsi_pat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
131 
132 /*****************************************************************************
133  * dvbpsi_pat_init/dvbpsi_pat_new
134  *****************************************************************************/
145 void dvbpsi_pat_init(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
146  bool b_current_next);
147 
157 dvbpsi_pat_t *dvbpsi_pat_new(uint16_t i_ts_id, uint8_t i_version, bool b_current_next);
158 
159 /*****************************************************************************
160  * dvbpsi_pat_empty/dvbpsi_pat_delete
161  *****************************************************************************/
169 
177 
178 /*****************************************************************************
179  * dvbpsi_pat_program_add
180  *****************************************************************************/
192  uint16_t i_number, uint16_t i_pid);
193 
194 /*****************************************************************************
195  * dvbpsi_pat_sections_generate
196  *****************************************************************************/
209 dvbpsi_psi_section_t* dvbpsi_pat_sections_generate(dvbpsi_t *p_dvbpsi,
210  dvbpsi_pat_t* p_pat, int i_max_pps);
211 
212 #ifdef __cplusplus
213 };
214 #endif
215 
216 #else
217 #error "Multiple inclusions of pat.h"
218 #endif
struct dvbpsi_pat_s dvbpsi_pat_t
dvbpsi_pat_t type definition.
struct dvbpsi_pat_program_s dvbpsi_pat_program_t
dvbpsi_pat_program_t type definition.
void dvbpsi_pat_empty(dvbpsi_pat_t *p_pat)
Clean a dvbpsi_pat_t structure.
dvbpsi_pat_program_t * dvbpsi_pat_program_add(dvbpsi_pat_t *p_pat, uint16_t i_number, uint16_t i_pid)
Add a program at the end of the PAT.
void dvbpsi_pat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a PAT decoder.
void dvbpsi_pat_delete(dvbpsi_pat_t *p_pat)
Clean and free a dvbpsi_pat_t structure.
dvbpsi_pat_t * dvbpsi_pat_new(uint16_t i_ts_id, uint8_t i_version, bool b_current_next)
Allocate and initialize a new dvbpsi_pat_t structure.
void dvbpsi_pat_init(dvbpsi_pat_t *p_pat, uint16_t i_ts_id, uint8_t i_version, bool b_current_next)
Initialize a user-allocated dvbpsi_pat_t structure.
void(* dvbpsi_pat_callback)(void *p_priv, dvbpsi_pat_t *p_new_pat)
Callback type definition.
Definition: pat.h:98
uint16_t i_ts_id
Definition: sis.h:4
PAT program structure.
Definition: pat.h:55
uint16_t i_number
Definition: pat.h:56
struct dvbpsi_pat_program_s * p_next
Definition: pat.h:59
uint16_t i_pid
Definition: pat.h:57
PAT structure.
Definition: pat.h:80
bool b_current_next
Definition: pat.h:83
uint16_t i_ts_id
Definition: pat.h:81
uint8_t i_version
Definition: pat.h:82
dvbpsi_pat_program_t * p_first_program
Definition: pat.h:85
PSI section structure.
Definition: psi.h:69
DVBPSI handle structure.
Definition: dvbpsi.h:143