libdvbpsi  2.0.0-git
demux.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * demux.h
3  *
4  * Copyright (C) 2001-2011 VideoLAN
5  * $Id$
6  *
7  * Authors: Johan Bilien <jobi@via.ecp.fr>
8  * Jean-Paul Saman <jpsaman@videolan.org>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  *****************************************************************************/
25 
34 #ifndef _DVBPSI_DEMUX_H_
35 #define _DVBPSI_DEMUX_H_
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /*****************************************************************************
42  * dvbpsi_demux_new_cb_t
43  *****************************************************************************/
51 typedef void (*dvbpsi_demux_new_cb_t) (dvbpsi_t *p_dvbpsi,
52  uint8_t i_table_id,
53  uint16_t i_extension,
54  void * p_cb_data);
62 typedef void (*dvbpsi_demux_gather_cb_t) (dvbpsi_t *p_dvbpsi,
63  dvbpsi_decoder_t *p_decoder,
64  dvbpsi_psi_section_t *p_section);
72 typedef void (*dvbpsi_demux_detach_cb_t) (dvbpsi_t *p_dvbpsi,
73  uint8_t i_table_id,
74  uint16_t i_extension);
76 /*****************************************************************************
77  * dvbpsi_demux_subdec_t
78  *****************************************************************************/
90 typedef struct dvbpsi_demux_subdec_s
91 {
92  uint32_t i_id;
101 
102 
103 /*****************************************************************************
104  * dvbpsi_demux_s
105  *****************************************************************************/
118 
120 {
122 
125  /* New subtable callback */
127  void * p_new_cb_data;
129 };
130 
131 /*****************************************************************************
132  * dvbpsi_AttachDemux
133  *****************************************************************************/
142 bool dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
143  dvbpsi_demux_new_cb_t pf_new_cb,
144  void * p_new_cb_data);
145 
146 /*****************************************************************************
147  * dvbpsi_DetachDemux
148  *****************************************************************************/
155 void dvbpsi_DetachDemux(dvbpsi_t *p_dvbpsi);
156 
157 /*****************************************************************************
158  * dvbpsi_demuxGetSubDec
159  *****************************************************************************/
170  uint8_t i_table_id,
171  uint16_t i_extension);
172 
173 /*****************************************************************************
174  * dvbpsi_Demux
175  *****************************************************************************/
183 void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section);
184 
185 /*****************************************************************************
186  * dvbpsi_NewDemuxSubDecoder
187  *****************************************************************************/
202 dvbpsi_demux_subdec_t *dvbpsi_NewDemuxSubDecoder(const uint8_t i_table_id,
203  const uint16_t i_extension,
204  dvbpsi_demux_detach_cb_t pf_detach,
205  dvbpsi_demux_gather_cb_t pf_gather,
206  dvbpsi_decoder_t *p_decoder);
207 
208 /*****************************************************************************
209  * dvbpsi_DeleteDemuxSubDecoder
210  *****************************************************************************/
219 
220 /*****************************************************************************
221  * dvbpsi_AttachDemuxSubDecoder
222  *****************************************************************************/
231 
232 /*****************************************************************************
233  * dvbpsi_DetachDemuxSubDecoder
234  *****************************************************************************/
243 
244 #ifdef __cplusplus
245 };
246 #endif
247 
248 #else
249 #error "Multiple inclusions of demux.h"
250 #endif
#define DVBPSI_DECODER_COMMON
Common members for all dvbpsi table decoders. These should be the first members of a table decoder st...
Definition: dvbpsi.h:231
uint16_t i_extension
Definition: sis.h:101
DVBPSI_DECODER_COMMON dvbpsi_demux_subdec_t * p_first_subdec
Definition: demux.h:123
void(* dvbpsi_demux_new_cb_t)(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, void *p_cb_data)
Callback used in case of a new subtable detected.
Definition: demux.h:51
uint8_t i_table_id
Definition: sis.h:100
void dvbpsi_DeleteDemuxSubDecoder(dvbpsi_demux_subdec_t *p_subdec)
Releases memory allocated with.
void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)
Sends the PSI sections to the right subtable decoder according to their table ID and extension...
dvbpsi_decoder_t * p_decoder
Definition: demux.h:95
dvbpsi_demux_subdec_t * dvbpsi_NewDemuxSubDecoder(const uint8_t i_table_id, const uint16_t i_extension, dvbpsi_demux_detach_cb_t pf_detach, dvbpsi_demux_gather_cb_t pf_gather, dvbpsi_decoder_t *p_decoder)
Allocates a new demux sub table decoder and initializes it.
void(* dvbpsi_demux_detach_cb_t)(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Callback used for detaching subtable decoder from demuxer.
Definition: demux.h:72
void * p_new_cb_data
Definition: demux.h:127
PSI decoder structure.
Definition: dvbpsi.h:260
PSI section structure.
Definition: psi.h:68
subtable demultiplexor structure
Definition: demux.h:119
void dvbpsi_DetachDemux(dvbpsi_t *p_dvbpsi)
Destroys a demux structure.
dvbpsi_demux_detach_cb_t pf_detach
Definition: demux.h:97
bool dvbpsi_AttachDemux(dvbpsi_t *p_dvbpsi, dvbpsi_demux_new_cb_t pf_new_cb, void *p_new_cb_data)
Attaches a new demux structure on dvbpsi_t* handle.
uint32_t i_id
Definition: demux.h:92
dvbpsi_demux_subdec_t * dvbpsi_demuxGetSubDec(dvbpsi_demux_t *p_demux, uint8_t i_table_id, uint16_t i_extension)
Looks for a subtable decoder, given the subtable ID.
dvbpsi_demux_new_cb_t pf_new_callback
Definition: demux.h:126
void dvbpsi_DetachDemuxSubDecoder(dvbpsi_demux_t *p_demux, dvbpsi_demux_subdec_t *p_subdec)
Detach a subtable decoder from the given demux pointer.
struct dvbpsi_demux_subdec_s dvbpsi_demux_subdec_t
dvbpsi_demux_subdec_t type definition.
Subtable decoder structure.
Definition: demux.h:90
DVBPSI handle structure.
Definition: dvbpsi.h:142
struct dvbpsi_demux_subdec_s * p_next
Definition: demux.h:99
void(* dvbpsi_demux_gather_cb_t)(dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_decoder, dvbpsi_psi_section_t *p_section)
Callback used for gathering psi sections on behalf of subtable decoders.
Definition: demux.h:62
dvbpsi_demux_gather_cb_t pf_gather
Definition: demux.h:94
void dvbpsi_AttachDemuxSubDecoder(dvbpsi_demux_t *p_demux, dvbpsi_demux_subdec_t *p_subdec)
Attach a subtable decoder to the given demux handle.