libdvbpsi  0.2.2
sis.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * sis.h
3  * Copyright (c) 2010-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Jean-Paul Saman <jpsaman@videolan.org>
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_SIS_H_
34 #define _DVBPSI_SIS_H_
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*****************************************************************************
41  * dvbpsi_sis_t
42  *****************************************************************************/
54 typedef struct dvbpsi_sis_s
55 {
56  /* section */
60  /* encryption */
66  uint64_t i_pts_adjustment;
67  uint8_t cw_index;
69  /* splice command */
73  /* FIXME: splice_info_section comes here
74  * splice_command_type splice_info_section
75  * 0x00 splice_null()
76  * 0x01 reserved
77  * 0x02 reserved
78  * 0x03 reserved
79  * 0x04 splice_schedule()
80  * 0x05 splice_insert()
81  * 0x06 time_signal()
82  * 0x07 bandwidth_reservation()
83  * 0x08 - 0xff reserved
84  */
85 
86  /* descriptors */
92  /* FIXME: alignment stuffing */
93 
94  uint32_t i_ecrc;
96 } dvbpsi_sis_t;
97 
98 /*****************************************************************************
99  * dvbpsi_sis_callback
100  *****************************************************************************/
106 typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
107 
108 
109 /*****************************************************************************
110  * dvbpsi_AttachSIS
111  *****************************************************************************/
124 __attribute__((deprecated))
125 int dvbpsi_AttachSIS(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
126  uint16_t i_extension, dvbpsi_sis_callback pf_callback,
127  void* p_cb_data);
128 
129 
130 /*****************************************************************************
131  * dvbpsi_DetachSIS
132  *****************************************************************************/
142 __attribute__((deprecated))
143 void dvbpsi_DetachSIS(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
144  uint16_t i_extension);
145 
146 
147 /*****************************************************************************
148  * dvbpsi_InitSIS/dvbpsi_NewSIS
149  *****************************************************************************/
158 __attribute__((deprecated))
159 void dvbpsi_InitSIS(dvbpsi_sis_t *p_sis, uint8_t i_protocol_version);
160 
168 #define dvbpsi_NewSIS(p_sis, i_protocol_version) \
169 do { \
170  p_sis = (dvbpsi_sis_t*)malloc(sizeof(dvbpsi_sis_t)); \
171  if(p_sis != NULL) \
172  dvbpsi_InitSIS(p_sis, i_protocol_version); \
173 } while(0);
174 
175 /*****************************************************************************
176  * dvbpsi_EmptySIS/dvbpsi_DeleteSIS
177  *****************************************************************************/
184 __attribute__((deprecated))
185 void dvbpsi_EmptySIS(dvbpsi_sis_t *p_sis);
186 
193 #define dvbpsi_DeleteSIS(p_sis) \
194 do { \
195  dvbpsi_EmptySIS(p_sis); \
196  free(p_sis); \
197 } while(0);
198 
199 /*****************************************************************************
200  * dvbpsi_SISAddDescriptor
201  *****************************************************************************/
213 __attribute__((deprecated))
214 dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor( dvbpsi_sis_t *p_sis,
215  uint8_t i_tag, uint8_t i_length,
216  uint8_t *p_data);
217 
218 /*****************************************************************************
219  * dvbpsi_GenSISSections
220  *****************************************************************************
221  * Generate SIS sections based on the dvbpsi_sis_t structure.
222  *****************************************************************************/
223 __attribute__((deprecated))
224 dvbpsi_psi_section_t *dvbpsi_GenSISSections(dvbpsi_sis_t * p_sis);
225 
226 #ifdef __cplusplus
227 };
228 #endif
229 
230 #else
231 #error "Multiple inclusions of sis.h"
232 #endif
233