libdvbpsi  2.0.0-git
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;
105 /*****************************************************************************
106  * Splice Commands
107  *****************************************************************************/
121 {
122  /* nothing */
124 
134 {
139  uint64_t i_duration;
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 
bool b_splice_event_cancel_indicator
Definition: sis.h:180
void dvbpsi_sis_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a SIS decoder.
void dvbpsi_sis_empty(dvbpsi_sis_t *p_sis)
Clean a dvbpsi_sis_t structure.
dvbpsi_sis_t * dvbpsi_sis_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint8_t i_protocol_version)
Allocate and initialize a new dvbpsi_sis_t structure.
bool b_duration_flag
Definition: sis.h:289
bool b_splice_event_cancel_indicator
Definition: sis.h:284
uint32_t i_splice_event_id
Definition: sis.h:283
dvbpsi_sis_break_duration_t * p_break_duration
Definition: sis.h:302
splice_schedule() splice command definition
Definition: sis.h:224
struct dvbpsi_sis_cmd_splice_schedule_s dvbpsi_sis_cmd_splice_schedule_t
splice_schedule() splice command definition
uint16_t i_extension
Definition: sis.h:101
bool b_current_next
Definition: sis.h:107
dvbpsi_sis_break_duration_t * p_break_duration
Definition: sis.h:201
bool b_duration_flag
Definition: sis.h:185
uint16_t i_unique_program_id
Definition: sis.h:205
uint8_t i_table_id
Definition: sis.h:57
bool b_out_of_network_indicator
Definition: sis.h:183
uint8_t cw_index
Definition: sis.h:73
uint16_t i_splice_command_length
Definition: sis.h:76
uint32_t i_utc_splice_time
Definition: sis.h:187
bool b_program_splice_flag
Definition: sis.h:184
void dvbpsi_sis_init(dvbpsi_sis_t *p_sis, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint8_t i_protocol_version)
Initialize a user-allocated dvbpsi_sis_t structure.
dvbpsi_sis_splice_time_t * p_splice_time
Definition: sis.h:323
bandwidth_reservation() splice command definition
Definition: sis.h:334
uint16_t i_descriptors_length
Definition: sis.h:95
uint8_t i_table_id
Definition: sis.h:100
struct dvbpsi_sis_cmd_bandwidth_reservation_s dvbpsi_sis_cmd_bandwidth_reservation_t
bandwidth_reservation() splice command definition
void(* dvbpsi_sis_callback)(void *p_cb_data, dvbpsi_sis_t *p_new_sis)
Callback type definition.
Definition: sis.h:347
bool b_program_splice_flag
Definition: sis.h:288
uint16_t i_extension
Definition: sis.h:58
uint8_t i_component_count
Definition: sis.h:296
uint8_t i_avail_num
Definition: sis.h:306
struct dvbpsi_sis_break_duration_s dvbpsi_sis_break_duration_t
splice event definition
uint8_t i_protocol_version
Definition: sis.h:62
uint16_t i_ts_id
Definition: sis.h:60
component_tag, splice_time definition
Definition: sis.h:261
struct dvbpsi_sis_cmd_splice_null_s dvbpsi_sis_cmd_splice_null_t
The Splice Info Section (SIS) defines some Splice Commands, which are described below: ...
uint64_t i_duration
Definition: sis.h:139
time_signal() splice command definition
Definition: sis.h:321
splice break duration
Definition: sis.h:133
bool dvbpsi_sis_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_sis_callback pf_callback, void *p_cb_data)
Creation and initialization of a SIS decoder. It is attached to p_dvbpsi.
bool b_out_of_network_indicator
Definition: sis.h:287
uint8_t i_protocol_version
Definition: sis.h:105
uint64_t i_pts_time
Definition: sis.h:243
struct dvbpsi_sis_cmd_splice_insert_s dvbpsi_sis_cmd_splice_insert_t
splice_insert() splice command definition
SIS structure.
Definition: sis.h:54
bool b_auto_return
Definition: sis.h:135
PSI section structure.
Definition: psi.h:68
splice events structure,
Definition: sis.h:177
uint32_t i_ecrc
Definition: sis.h:101
uint64_t i_pts_adjustment
Definition: sis.h:72
dvbpsi_sis_splice_time_t * p_next
Definition: sis.h:249
dvbpsi_sis_component_splice_time_t * p_next
Definition: sis.h:270
bool b_current_next
Definition: sis.h:64
uint8_t i_splice_count
Definition: sis.h:226
splice_null() splice command definition
Definition: sis.h:120
dvbpsi_sis_splice_event_t * p_splice_event
Definition: sis.h:227
uint8_t i_splice_command_type
Definition: sis.h:77
combined component tag and UTC splice time definition
Definition: sis.h:154
dvbpsi_sis_splice_time_t * p_splice_time
Definition: sis.h:293
bool b_time_specified_flag
Definition: sis.h:241
bool b_encrypted_packet
Definition: sis.h:67
uint8_t i_component_tag
Definition: sis.h:263
dvbpsi_sis_component_splice_time_t * p_data
Definition: sis.h:298
dvbpsi_descriptor_t * p_first_descriptor
Definition: sis.h:97
uint8_t i_encryption_algorithm
Definition: sis.h:69
bool b_splice_immediate_flag
Definition: sis.h:290
splice_time() splice definition
Definition: sis.h:239
uint8_t i_avails_expected
Definition: sis.h:308
uint8_t i_avails_expected
Definition: sis.h:209
splice_insert() splice command definition
Definition: sis.h:281
void dvbpsi_sis_delete(dvbpsi_sis_t *p_sis)
Clean and free a dvbpsi_sis_t structure.
uint8_t i_component_count
Definition: sis.h:193
uint32_t i_utc_splice_time
Definition: sis.h:159
dvbpsi_sis_component_utc_splice_time_t * p_data
Definition: sis.h:196
uint8_t i_version
Definition: sis.h:61
struct dvbpsi_sis_cmd_time_signal_s dvbpsi_sis_cmd_time_signal_t
time_signal() splice command definition
DVBPSI handle structure.
Definition: dvbpsi.h:142
Descriptor structure.
Definition: descriptor.h:82
dvbpsi_descriptor_t * dvbpsi_sis_descriptor_add(dvbpsi_sis_t *p_sis, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
Add a descriptor in the SIS service.
uint16_t i_unique_program_id
Definition: sis.h:305
uint8_t component_tag
Definition: sis.h:156
dvbpsi_sis_component_utc_splice_time_t * p_next
Definition: sis.h:165
void * p_splice_command
Definition: sis.h:91
uint8_t i_version
Definition: sis.h:104
dvbpsi_sis_splice_time_t * p_splice_time
Definition: sis.h:267
dvbpsi_psi_section_t * dvbpsi_sis_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sis_t *p_sis)
SIS generator.
uint8_t i_avail_num
Definition: sis.h:207
uint32_t i_splice_event_id
Definition: sis.h:179
dvbpsi_sis_splice_event_t * p_next
Definition: sis.h:213