libdvbpsi  1.1.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 */
57  uint8_t i_table_id;
58  uint16_t i_extension;
60  uint16_t i_ts_id;
61  uint8_t i_version;
66  /* encryption */
72  uint64_t i_pts_adjustment;
73  uint8_t cw_index;
75  /* splice command */
79  /* Splice Command:
80  * splice_command_type splice_info_section
81  * 0x00 splice_null()
82  * 0x01 reserved
83  * 0x02 reserved
84  * 0x03 reserved
85  * 0x04 splice_schedule()
86  * 0x05 splice_insert()
87  * 0x06 time_signal()
88  * 0x07 bandwidth_reservation()
89  * 0x08 - 0xff reserved
90  */
94  /* descriptors */
100  /* FIXME: alignment stuffing */
101  uint32_t i_ecrc;
103 } __attribute__((packed)) dvbpsi_sis_t;
104 
105 /*****************************************************************************
106  * Splice Commands
107  *****************************************************************************/
121 {
122  /* nothing */
134 {
139  uint64_t i_duration;
144 
155 {
156  uint8_t component_tag;
159  uint32_t i_utc_splice_time;
166 };
167 
178 {
179  uint32_t i_splice_event_id;
182  /* if (!b_splice_event_cancel_indicator) */
186  /* if (b_program_splice_flag) */
187  uint32_t i_utc_splice_time;
192  /* if (!b_program_splice_flag) */
200  /* if (b_duration_flag) */
203  /* */
204 
207  uint8_t i_avail_num;
211  /* end */
212 
214 };
215 
225 {
226  uint8_t i_splice_count;
229 
240 {
242  /* if (b_time_specified_flag) */
243  uint64_t i_pts_time;
246  /* else reserved */
247  /* end */
248 
250 };
251 
262 {
263  uint8_t i_component_tag;
266  /* if (splice_immediate_flag) */
268  /* */
269 
271 };
272 
282 {
283  uint32_t i_splice_event_id;
286  /* if (!b_splice_event_cancel_indicator) */
292  /* if (b_program_splice_flag) && (!b_splice_immediate_flag) */
295  /* if (!b_program_splice_flag) */
301  /* if (b_duration_flag) */
304  /* */
306  uint8_t i_avail_num;
310  /* end */
312 
322 {
325 
335 {
336  /* nothing */
338 
339 /*****************************************************************************
340  * dvbpsi_sis_callback
341  *****************************************************************************/
347 typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
348 
349 /*****************************************************************************
350  * dvbpsi_sis_attach
351  *****************************************************************************/
364 bool dvbpsi_sis_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
365  dvbpsi_sis_callback pf_callback, void* p_cb_data);
366 
367 /*****************************************************************************
368  * dvbpsi_sis_detach
369  *****************************************************************************/
379 void dvbpsi_sis_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
380 
381 /*****************************************************************************
382  * dvbpsi_sis_init/dvbpsi_sis_new
383  *****************************************************************************/
396 void dvbpsi_sis_init(dvbpsi_sis_t *p_sis, uint8_t i_table_id, uint16_t i_extension,
397  uint8_t i_version, bool b_current_next, uint8_t i_protocol_version);
398 
410 dvbpsi_sis_t* dvbpsi_sis_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version,
411  bool b_current_next, uint8_t i_protocol_version);
412 
413 /*****************************************************************************
414  * dvbpsi_sis_empty/dvbpsi_sis_delete
415  *****************************************************************************/
422 void dvbpsi_sis_empty(dvbpsi_sis_t *p_sis);
423 
430 void dvbpsi_sis_delete(dvbpsi_sis_t *p_sis);
431 
432 /*****************************************************************************
433  * dvbpsi_sis_descriptor_add
434  *****************************************************************************/
447  uint8_t i_tag, uint8_t i_length,
448  uint8_t *p_data);
449 
450 /*****************************************************************************
451  * dvbpsi_sis_sections_generate
452  *****************************************************************************
453  * Generate SIS sections based on the dvbpsi_sis_t structure.
454  *****************************************************************************/
464 dvbpsi_psi_section_t *dvbpsi_sis_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sis_t * p_sis);
465 
466 #ifdef __cplusplus
467 };
468 #endif
469 
470 #else
471 #error "Multiple inclusions of sis.h"
472 #endif
473