Commit baf927dd authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/tables/sis.*: Add Splice Command structures definitions. (WIP)

SCTE 35 2004 section 7.2 describes the following Splice Commands:
- 0x00 splice_null
- 0x04 splice_schedule
- 0x05 splice_insert
- 0x06 time_signal
- 0x07 bandwidth_reservation
parent 8ff6d3c9
......@@ -194,7 +194,7 @@ void dvbpsi_EmptySIS(dvbpsi_sis_t* p_sis)
*****************************************************************************
* Add a descriptor in the SIS service description.
*****************************************************************************/
dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor( dvbpsi_sis_t *p_sis,
dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor(dvbpsi_sis_t *p_sis,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data)
{
......@@ -359,7 +359,20 @@ void dvbpsi_DecodeSISSections(dvbpsi_t* p_dvbpsi, dvbpsi_sis_t* p_sis,
/* FIXME: size 0xfff of splice_command_section is undefined */
assert(p_sis->i_splice_command_length != 0xfff);
}
/* FIXME: handle splice_command_sections */
switch(p_sis->i_splice_command_type)
{
case 0x00: /* splice_null */
case 0x04: /* splice_schedule */
case 0x05: /* splice_insert */
case 0x06: /* time_signal */
case 0x07: /* bandwidth_reservation */
break;
default:
dvbpsi_error(p_dvbpsi, "SIS decoder", "invalid SIS Command found");
break;
}
/* Service descriptors */
uint8_t *p_desc = p_byte + 13 + i_splice_command_length;
......
......@@ -70,7 +70,7 @@ typedef struct dvbpsi_sis_s
uint16_t i_splice_command_length;/*!< Length of splice command */
uint8_t i_splice_command_type; /*!< Splice command type */
/* FIXME: splice_info_section comes here
/* Splice Command:
* splice_command_type splice_info_section
* 0x00 splice_null()
* 0x01 reserved
......@@ -82,18 +82,214 @@ typedef struct dvbpsi_sis_s
* 0x07 bandwidth_reservation()
* 0x08 - 0xff reserved
*/
void *p_splice_command; /*!< Pointer to splice command
structure */
/* descriptors */
uint16_t i_descriptors_length; /*!< Descriptors loop
length */
dvbpsi_descriptor_t * p_first_descriptor; /*!< First of the following
DVB descriptors */
dvbpsi_descriptor_t *p_first_descriptor; /*!< First of the following
SIS descriptors */
/* FIXME: alignment stuffing */
uint32_t i_ecrc; /*!< CRC 32 of decrypted splice_info_section */
} dvbpsi_sis_t;
/*****************************************************************************
* Splice Commands
*****************************************************************************/
/*!
* \brief The Splice Info Section (SIS) defines some Splice Commands, which
* are described below:
*/
/*!
* \typedef struct dvbpsi_sis_cmd_splice_null_s dvbpsi_sis_cmd_splice_null_t
* \brief splice_null() splice command definition
*/
typedef struct dvbpsi_sis_cmd_splice_null_s
{
/* nothing */
} dvbpsi_sis_cmd_splice_null_t;
/*!
* \typedef struct dvbpsi_sis_break_duration_s dvbpsi_sis_break_duration_t
* \brief splice event definition
*/
typedef struct dvbpsi_sis_break_duration_s
{
bool b_auto_return; /*!< when true it denotes that the duration
shall be used by the splicing device to
know when the return to the network feed
(end of break) is to take place */
uint64_t i_duration; /*!< indicates elapsed time in terms of ticks
of the program’s 90 kHz clock indicates
elapsed time in terms of ticks of the
program’s 90 kHz clock */
} dvbpsi_sis_break_duration_t;
/*!
* \typedef struct dvbpsi_sis_component_utc_splice_time_s dvbpsi_sis_component_utc_splice_time_t
* \brief combined component tag and UTC splice time definition
*/
typedef struct dvbpsi_sis_component_utc_splice_time_s dvbpsi_sis_component_utc_splice_time_s;
struct dvbpsi_sis_component_utc_splice_time_s
{
uint8_t component_tag; /*!< identifies the elementary PID stream containing
the Splice Point specified by the value of
splice_time() that follows. */
uint32_t i_utc_splice_time; /*!< time of the signaled splice event as
the number of seconds since 00 hours UTC,
January 6th, 1980.
Maybe converted to UTC without use of
GPS_UTC_offset value from System Time table. */
dvbpsi_sis_component_utc_splice_time_s *p_next; /*!< next component, utc splice time structure */
};
/*!
* \typedef struct dvbpsi_sis_splice_event_s dvbpsi_sis_splice_event_t
* \brief splice event definition
*/
typedef struct dvbpsi_sis_splice_event_s dvbpsi_sis_splice_event_t;
struct dvbpsi_sis_splice_event_s
{
uint32_t i_splice_event_id; /*!< splice event identifier */
bool b_splice_event_cancel_indicator; /*!< cancels splice event when true */
/* if (!b_splice_event_cancel_indicator) */
bool b_out_of_network_indicator; /*!< signals an out of network feed event */
bool b_program_splice_flag; /*!< signals a Program Splice Point */
bool b_duration_flag; /*!< signals existing break_duration() field */
/* if (b_program_splice_flag) */
uint32_t i_utc_splice_time; /*!< time of the signaled splice event as
the number of seconds since 00 hours UTC,
January 6th, 1980.
Maybe converted to UTC without use of
GPS_UTC_offset value from System Time table.*/
/* if (!b_program_splice_flag) */
uint8_t i_component_count; /*!< number of stream PID in the following
loop. A component is equivalent to
elementary stream PIDs.*/
dvbpsi_sis_component_utc_splice_time_s *p_data;
/*!< identifies the elementary PID stream containing
the Splice Point specified by the value of
splice_time() that follows. */
/* if (b_duration_flag) */
dvbpsi_sis_break_duration_t *p_break_duration; /*!< break duration is present when
b_duration_flag is set */
/* */
uint16_t i_unique_program_id; /*!< provide a unique identification for
a viewing event */
uint8_t i_avail_num; /*!< identification for a specific
avail within one unique_program_id. */
uint8_t i_avails_expected; /*!< count of the expected number of individual
avails within the current viewing event */
/* end */
dvbpsi_sis_splice_event_t *p_next; /*!< next splice event structure */
};
/*!
* \typedef struct dvbpsi_sis_cmd_splice_schedule_s dvbpsi_sis_cmd_splice_schedule_t
* \brief splice_schedule() splice command definition
*/
typedef struct dvbpsi_sis_cmd_splice_schedule_s
{
uint8_t i_splice_count; /*!< Count of splice events */
dvbpsi_sis_splice_event_t *p_splice_event; /*!< List splice of events */
} dvbpsi_sis_cmd_splice_schedule_t;
/*!
* \typedef struct dvbpsi_sis_splice_time_s dvbpsi_sis_splice_time_t
* \brief splice_time() splice definition
*/
typedef struct dvbpsi_sis_splice_time_s dvbpsi_sis_splice_time_t;
struct dvbpsi_sis_splice_time_s
{
bool b_time_specified_flag; /*!< signals presence of PTS time field */
/* if (b_time_specified_flag) */
uint64_t i_pts_time; /*!< time in terms of ticks of the program’s 90 kHz
clock. This field, when modified by pts_adjustment,
represents the time of the intended splice point.*/
/* else reserved */
/* end */
dvbpsi_sis_splice_time_t *p_next; /*!< next splice_time() entry */
};
/*!
* \typedef struct dvbpsi_sis_splice_time_s dvbpsi_sis_splice_time_t
* \brief component_tag, splice_time definition
*/
typedef struct dvbpsi_sis_component_splice_time_s dvbpsi_sis_component_splice_time_t;
struct dvbpsi_sis_component_splice_time_s
{
uint8_t i_component_tag; /*!< identifies the elementary PID stream containing
the Splice Point specified by the value of
splice_time() that follows. */
/* if (splice_immediate_flag) */
dvbpsi_sis_splice_time_t *p_splice_time; /*!< splice time defintions */
/* */
dvbpsi_sis_component_splice_time_t *p_next; /*!< next in list */
};
/*!
* \typedef struct dvbpsi_sis_cmd_splice_insert_s dvbpsi_sis_cmd_splice_insert_t
* \brief splice_insert() splice command definition
*/
typedef struct dvbpsi_sis_cmd_splice_insert_s
{
uint32_t i_splice_event_id; /*!< splice event identifier */
bool b_splice_event_cancel_indicator; /*!< cancels splice event when true */
/* if (!b_splice_event_cancel_indicator) */
bool b_out_of_network_indicator; /*!< signals an out of network feed event */
bool b_program_splice_flag; /*!< signals a Program Splice Point */
bool b_duration_flag; /*!< signals existing break_duration() field */
bool b_splice_immediate_flag; /*!< signals immediate splice insertion */
/* if (b_program_splice_flag) && (!b_splice_immediate_flag) */
dvbpsi_sis_splice_time_t *p_splice_time; /*!< splice time */
/* if (!b_program_splice_flag) */
uint8_t i_component_count; /*!< number of stream PID in the following loop.
A component is equivalent to elementary stream PIDs.*/
dvbpsi_sis_component_splice_time_t *p_data; /*!< identifies the elementary PID stream containing
the Splice Point specified by the value of
splice_time() that follows. */
/* if (b_duration_flag) */
dvbpsi_sis_break_duration_t *p_break_duration; /*!< break duration is present when b_duration_flag is set */
/* */
uint16_t i_unique_program_id; /*!< provide a unique identification for a viewing event */
uint8_t i_avail_num; /*!< identification for a specific avail within
one unique_program_id. */
uint8_t i_avails_expected; /*!< count of the expected number of individual avails
within the current viewing event */
/* end */
} dvbpsi_sis_cmd_splice_insert_t;
/*!
* \typedef struct dvbpsi_sis_cmd_time_signal_s dvbpsi_sis_cmd_time_signal_t
* \brief time_signal() splice command definition
*/
typedef struct dvbpsi_sis_cmd_time_signal_s
{
dvbpsi_sis_splice_time_t *p_splice_time; /*!< splice time command */
} dvbpsi_sis_cmd_time_signal_t;
/*!
* \typedef struct dvbpsi_sis_cmd_bandwidth_reservation_s dvbpsi_sis_cmd_bandwidth_reservation_t
* \brief bandwidth_reservation() splice command definition
*/
typedef struct dvbpsi_sis_cmd_bandwidth_reservation_s
{
/* nothing */
} dvbpsi_sis_cmd_bandwidth_reservation_t;
/*****************************************************************************
* dvbpsi_sis_callback
*****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment