libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
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  uint16_t i_tier;
77  /* splice command */
81  /* Splice Command:
82  * splice_command_type splice_info_section
83  * 0x00 splice_null()
84  * 0x01 reserved
85  * 0x02 reserved
86  * 0x03 reserved
87  * 0x04 splice_schedule()
88  * 0x05 splice_insert()
89  * 0x06 time_signal()
90  * 0x07 bandwidth_reservation()
91  * 0x08 - 0xff reserved
92  */
96  /* descriptors */
102  /* FIXME: alignment stuffing */
103  uint32_t i_ecrc;
105 } __attribute__((packed)) dvbpsi_sis_t;
106 
107 /*****************************************************************************
108  * Splice Commands
109  *****************************************************************************/
123 {
124  /* nothing */
126 
136 {
141  uint64_t i_duration;
146 
157 {
158  uint8_t i_tag;
161  uint32_t i_utc_splice_time;
168 };
169 
180 {
181  uint32_t i_splice_event_id;
184  /* if (!b_splice_event_cancel_indicator) */
188  /* if (b_program_splice_flag) */
189  uint32_t i_utc_splice_time;
194  /* if (!b_program_splice_flag) */
202  /* if (b_duration_flag) */
205  /* */
206 
209  uint8_t i_avail_num;
213  /* end */
214 
216 };
217 
227 {
228  uint8_t i_splice_count;
231 
242 {
244  /* if (b_time_specified_flag) */
245  uint64_t i_pts_time;
248  /* else reserved */
249  /* end */
250 
252 };
253 
264 {
265  uint8_t i_component_tag;
268  /* if (splice_immediate_flag) */
270  /* */
271 
273 };
274 
285 {
286  uint32_t i_splice_event_id;
289  /* if (!b_splice_event_cancel_indicator) */
295  /* if (b_program_splice_flag) && (!b_splice_immediate_flag) */
298  /* if (!b_program_splice_flag) */
307  /* if (b_duration_flag) */
310  /* */
311 
314  uint8_t i_avail_num;
318  /* end */
319 };
320 
330 {
333 
343 {
344  /* nothing */
346 
347 /*****************************************************************************
348  * dvbpsi_sis_callback
349  *****************************************************************************/
355 typedef void (* dvbpsi_sis_callback)(void* p_priv, dvbpsi_sis_t* p_new_sis);
356 
357 /*****************************************************************************
358  * dvbpsi_sis_attach
359  *****************************************************************************/
372 bool dvbpsi_sis_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
373  dvbpsi_sis_callback pf_callback, void* p_priv);
374 
375 /*****************************************************************************
376  * dvbpsi_sis_detach
377  *****************************************************************************/
387 void dvbpsi_sis_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
388 
389 /*****************************************************************************
390  * dvbpsi_sis_init/dvbpsi_sis_new
391  *****************************************************************************/
404 void dvbpsi_sis_init(dvbpsi_sis_t *p_sis, uint8_t i_table_id, uint16_t i_extension,
405  uint8_t i_version, bool b_current_next, uint8_t i_protocol_version);
406 
418 dvbpsi_sis_t* dvbpsi_sis_new(uint8_t i_table_id, uint16_t i_extension, uint8_t i_version,
419  bool b_current_next, uint8_t i_protocol_version);
420 
421 /*****************************************************************************
422  * dvbpsi_sis_empty/dvbpsi_sis_delete
423  *****************************************************************************/
430 void dvbpsi_sis_empty(dvbpsi_sis_t *p_sis);
431 
438 void dvbpsi_sis_delete(dvbpsi_sis_t *p_sis);
439 
440 /*****************************************************************************
441  * dvbpsi_sis_descriptor_add
442  *****************************************************************************/
455  uint8_t i_tag, uint8_t i_length,
456  uint8_t *p_data);
457 
458 /*****************************************************************************
459  * dvbpsi_sis_sections_generate
460  *****************************************************************************
461  * Generate SIS sections based on the dvbpsi_sis_t structure.
462  *****************************************************************************/
473 
474 #ifdef __cplusplus
475 };
476 #endif
477 
478 #else
479 #error "Multiple inclusions of sis.h"
480 #endif
481 
__attribute__((deprecated, unused)) bool dvbpsi_AttachDemux(dvbpsi_t *p_dvbpsi
dvbpsi_atsc_DetachEIT is deprecated use
Definition: atsc_eit.h:257
uint8_t i_table_id
Definition: sis.h:1
uint8_t i_version
Definition: sis.h:5
void dvbpsi_sis_delete(dvbpsi_sis_t *p_sis)
Clean and free a dvbpsi_sis_t structure.
struct dvbpsi_sis_cmd_time_signal_s dvbpsi_sis_cmd_time_signal_t
time_signal() splice command definition
struct dvbpsi_sis_cmd_splice_schedule_s dvbpsi_sis_cmd_splice_schedule_t
splice_schedule() splice command definition
dvbpsi_psi_section_t * dvbpsi_sis_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sis_t *p_sis)
SIS generator.
bool b_current_next
Definition: sis.h:8
struct dvbpsi_sis_break_duration_s dvbpsi_sis_break_duration_t
splice event definition
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.
struct dvbpsi_sis_cmd_bandwidth_reservation_s dvbpsi_sis_cmd_bandwidth_reservation_t
bandwidth_reservation() splice command definition
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:
uint16_t i_extension
Definition: sis.h:2
void dvbpsi_sis_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
Destroy a SIS decoder.
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.
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.
void dvbpsi_sis_empty(dvbpsi_sis_t *p_sis)
Clean a dvbpsi_sis_t structure.
void(* dvbpsi_sis_callback)(void *p_priv, dvbpsi_sis_t *p_new_sis)
Callback type definition.
Definition: sis.h:355
uint8_t i_protocol_version
Definition: sis.h:6
Descriptor structure.
Definition: descriptor.h:83
PSI section structure.
Definition: psi.h:69
DVBPSI handle structure.
Definition: dvbpsi.h:143
splice break duration
Definition: sis.h:136
uint64_t i_duration
Definition: sis.h:141
bool b_auto_return
Definition: sis.h:137
bandwidth_reservation() splice command definition
Definition: sis.h:343
splice_insert() splice command definition
Definition: sis.h:285
dvbpsi_sis_splice_time_t i_splice_time
Definition: sis.h:296
bool b_out_of_network_indicator
Definition: sis.h:290
bool b_program_splice_flag
Definition: sis.h:291
uint8_t i_avails_expected
Definition: sis.h:316
dvbpsi_sis_component_splice_time_t * p_splice_time
Definition: sis.h:302
bool b_duration_flag
Definition: sis.h:292
uint32_t i_splice_event_id
Definition: sis.h:286
bool b_splice_immediate_flag
Definition: sis.h:293
uint16_t i_unique_program_id
Definition: sis.h:312
uint8_t i_avail_num
Definition: sis.h:314
bool b_splice_event_cancel_indicator
Definition: sis.h:287
uint8_t i_component_count
Definition: sis.h:299
dvbpsi_sis_break_duration_t i_break_duration
Definition: sis.h:308
splice_null() splice command definition
Definition: sis.h:123
splice_schedule() splice command definition
Definition: sis.h:227
uint8_t i_splice_count
Definition: sis.h:228
dvbpsi_sis_splice_event_t * p_splice_event
Definition: sis.h:229
time_signal() splice command definition
Definition: sis.h:330
dvbpsi_sis_splice_time_t * p_splice_time
Definition: sis.h:331
combined component tag and UTC splice time definition
Definition: sis.h:157
uint32_t i_utc_splice_time
Definition: sis.h:161
uint8_t i_tag
Definition: sis.h:158
dvbpsi_sis_component_t * p_next
Definition: sis.h:167
component_tag, splice_time definition
Definition: sis.h:264
dvbpsi_sis_splice_time_t i_splice_time
Definition: sis.h:269
uint8_t i_component_tag
Definition: sis.h:265
dvbpsi_sis_component_splice_time_t * p_next
Definition: sis.h:272
SIS structure.
Definition: sis.h:55
bool b_current_next
Definition: sis.h:64
uint8_t i_version
Definition: sis.h:61
uint16_t i_splice_command_length
Definition: sis.h:78
uint16_t i_extension
Definition: sis.h:58
void * p_splice_command
Definition: sis.h:93
bool b_encrypted_packet
Definition: sis.h:67
uint8_t i_splice_command_type
Definition: sis.h:79
uint64_t i_pts_adjustment
Definition: sis.h:72
uint8_t cw_index
Definition: sis.h:73
uint16_t i_ts_id
Definition: sis.h:60
dvbpsi_descriptor_t * p_first_descriptor
Definition: sis.h:99
uint16_t i_descriptors_length
Definition: sis.h:97
uint8_t i_protocol_version
Definition: sis.h:62
uint32_t i_ecrc
Definition: sis.h:103
uint8_t i_table_id
Definition: sis.h:57
uint16_t i_tier
Definition: sis.h:75
uint8_t i_encryption_algorithm
Definition: sis.h:69
splice events structure,
Definition: sis.h:180
uint8_t i_avail_num
Definition: sis.h:209
uint32_t i_splice_event_id
Definition: sis.h:181
uint8_t i_component_count
Definition: sis.h:195
bool b_program_splice_flag
Definition: sis.h:186
uint16_t i_unique_program_id
Definition: sis.h:207
uint32_t i_utc_splice_time
Definition: sis.h:189
dvbpsi_sis_break_duration_t i_break_duration
Definition: sis.h:203
bool b_duration_flag
Definition: sis.h:187
bool b_out_of_network_indicator
Definition: sis.h:185
bool b_splice_event_cancel_indicator
Definition: sis.h:182
dvbpsi_sis_splice_event_t * p_next
Definition: sis.h:215
uint8_t i_avails_expected
Definition: sis.h:211
dvbpsi_sis_component_t * p_component
Definition: sis.h:198
splice_time() splice definition
Definition: sis.h:242
dvbpsi_sis_splice_time_t * p_next
Definition: sis.h:251
uint64_t i_pts_time
Definition: sis.h:245
bool b_time_specified_flag
Definition: sis.h:243