2013-09-27 14:45:00 +00:00
|
|
|
|
/*
|
2017-03-08 18:01:13 +00:00
|
|
|
|
* gst-scte-section.h -
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* Copyright (C) 2013, CableLabs, Louisville, CO 80027
|
2019-09-26 15:45:31 +00:00
|
|
|
|
* (c) 2019, Centricular ltd
|
2017-03-08 18:01:13 +00:00
|
|
|
|
*
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* Authors:
|
|
|
|
|
* RUIH Team <ruih@cablelabs.com>
|
2019-09-26 15:45:31 +00:00
|
|
|
|
* Edward Hervey <edward@centricular.com>
|
2013-09-27 14:45:00 +00:00
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GST_SCTE_SECTION_H
|
|
|
|
|
#define GST_SCTE_SECTION_H
|
|
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
#include <gst/mpegts/gstmpegtssection.h>
|
|
|
|
|
#include <gst/mpegts/gstmpegtsdescriptor.h>
|
|
|
|
|
|
2014-01-06 15:01:22 +00:00
|
|
|
|
G_BEGIN_DECLS
|
2013-09-27 14:45:00 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* GstMpegtsScteStreamType:
|
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_SUBTITLING: SCTE-27 Subtitling
|
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_ISOCH_DATA: SCTE-19 Isochronous data
|
2019-09-26 15:28:27 +00:00
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_SIT: SCTE-35 Splice Information Table
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_DST_NRT: SCTE-07 Data Service or
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* Network Resource Table
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_DSMCC_DCB: Type B - DSM-CC Data Carousel
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* [IEC 13818-6])
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_SIGNALING: Enhanced Television Application
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* Signaling (OC-SP-ETV-AM1.0.1-120614)
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_SYNC_DATA: SCTE-07 Synchronous data
|
|
|
|
|
* @GST_MPEGTS_STREAM_TYPE_SCTE_ASYNC_DATA: SCTE-53 Asynchronous data
|
2013-09-27 14:45:00 +00:00
|
|
|
|
*
|
2020-12-14 09:50:02 +00:00
|
|
|
|
* Type of mpeg-ts streams for SCTE. Most users would want to use the
|
|
|
|
|
* #GstMpegtsATSCStreamType instead since it also covers these stream types
|
2013-09-27 14:45:00 +00:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
2020-12-14 09:50:02 +00:00
|
|
|
|
/* 0x01 - 0x7f : defined in other specs */
|
2014-06-25 12:50:05 +00:00
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_SUBTITLING = 0x82, /* Subtitling data */
|
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_ISOCH_DATA = 0x83, /* Isochronous data */
|
2019-09-26 15:28:27 +00:00
|
|
|
|
/* 0x84 - 0x85 : defined in other specs */
|
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_SIT = 0x86, /* Splice Information Table */
|
|
|
|
|
/* 0x87 - 0x94 : defined in other specs */
|
2014-06-25 12:50:05 +00:00
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_DST_NRT = 0x95, /* DST / NRT data */
|
2013-09-27 14:45:00 +00:00
|
|
|
|
/* 0x96 - 0xaf : defined in other specs */
|
2014-06-25 12:50:05 +00:00
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_DSMCC_DCB = 0xb0, /* Data Carousel Type B */
|
2013-09-27 14:45:00 +00:00
|
|
|
|
/* 0xb1 - 0xbf : User Private (or defined in other specs) */
|
2014-06-25 12:50:05 +00:00
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_SIGNALING = 0xc0, /* EBIF Signaling */
|
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_SYNC_DATA = 0xc2, /* Synchronous data */
|
|
|
|
|
GST_MPEGTS_STREAM_TYPE_SCTE_ASYNC_DATA = 0xc3, /* Asynchronous data */
|
2013-09-27 14:45:00 +00:00
|
|
|
|
/* 0xc4 - 0xff : User Private (or defined in other specs) */
|
|
|
|
|
|
2014-06-25 12:50:05 +00:00
|
|
|
|
} GstMpegtsScteStreamType;
|
2013-09-27 14:45:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* GstMpegtsSectionSCTETableID:
|
2013-09-27 14:45:00 +00:00
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_EAS: SCTE-18 Emergency Alert System
|
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_EBIF: CL-SP-ETV-AM 1.0.1 EBIF message
|
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_EISS: CL-SP-ETV-AM 1.0.1 EBIF Int. Signaling Sect.
|
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_DII: CL-SP-ETV-AM 1.0.1 DSMCC DII message
|
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_DDB: CL-SP-ETV-AM 1.0.1 DSMCC Data Download Block
|
|
|
|
|
* @GST_MTS_TABLE_ID_SCTE_SPLICE: SCTE-35 splice information is carried in a
|
|
|
|
|
* section stream on a separate PID in the program’s Map Table (PMT) allowing
|
|
|
|
|
* Splice Event notifications to remain associated with the program and pass
|
|
|
|
|
* through multiplexers.
|
|
|
|
|
*
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* Values for a #GstMpegtsSection table_id.
|
2013-09-27 14:45:00 +00:00
|
|
|
|
*
|
|
|
|
|
* These are the registered SCTE table_id variants.
|
|
|
|
|
*
|
2014-06-25 12:50:05 +00:00
|
|
|
|
* see also: #GstMpegtsSectionTableID
|
2013-09-27 14:45:00 +00:00
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
|
|
|
|
/* 0x01 - 0xd7 : defined in other specs */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_EAS = 0xd8, /* emergency alert information */
|
|
|
|
|
/* 0xd8 - 0xdf : defined in other specs */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_EBIF = 0xE0, /* EBIF message */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_RESERVED = 0xE1,
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_EISS = 0xE2, /* EBIF Int. Signaling Sect. */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_DII = 0xE3, /* DSMCC DII message */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_DDB = 0xE4, /* DSMCC Data Download Block */
|
|
|
|
|
/* 0xe5 - 0xfb : defined in other specs */
|
|
|
|
|
GST_MTS_TABLE_ID_SCTE_SPLICE = 0xfc, /* splice information table */
|
|
|
|
|
|
2014-06-25 12:50:05 +00:00
|
|
|
|
} GstMpegtsSectionSCTETableID;
|
2013-09-27 14:45:00 +00:00
|
|
|
|
|
2021-09-24 22:09:00 +00:00
|
|
|
|
#define GST_MPEGTS_TYPE_SCTE_SPLICE_COMPONENT (gst_mpegts_scte_splice_component_get_type())
|
2021-04-13 21:38:16 +00:00
|
|
|
|
typedef struct _GstMpegtsSCTESpliceComponent GstMpegtsSCTESpliceComponent;
|
|
|
|
|
|
2021-09-24 22:09:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* GstMpegtsSCTESpliceComponent:
|
|
|
|
|
* @tag: the elementary PID stream containing the Splice Point
|
|
|
|
|
* @splice_time_specified: Whether @splice_time was specified
|
|
|
|
|
* @splice_time: the presentation time of the signaled splice event
|
|
|
|
|
* @utc_splice_time: The UTC time of the signaled splice event
|
|
|
|
|
*
|
|
|
|
|
* Per-PID splice information.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.20
|
|
|
|
|
*/
|
2021-04-13 21:38:16 +00:00
|
|
|
|
struct _GstMpegtsSCTESpliceComponent {
|
|
|
|
|
guint8 tag;
|
|
|
|
|
|
|
|
|
|
gboolean splice_time_specified; /* Only valid for insert_event */
|
|
|
|
|
guint64 splice_time; /* Only valid for insert_event */
|
|
|
|
|
|
|
|
|
|
guint32 utc_splice_time; /* Only valid for !insert_event (schedule) */
|
|
|
|
|
};
|
|
|
|
|
|
2019-09-26 15:28:27 +00:00
|
|
|
|
/* Splice Information Table (SIT) */
|
2021-04-05 22:21:58 +00:00
|
|
|
|
#define GST_TYPE_MPEGTS_SCTE_SPLICE_EVENT (gst_mpegts_scte_splice_event_get_type())
|
2019-09-26 15:28:27 +00:00
|
|
|
|
typedef struct _GstMpegtsSCTESpliceEvent GstMpegtsSCTESpliceEvent;
|
|
|
|
|
|
|
|
|
|
struct _GstMpegtsSCTESpliceEvent {
|
|
|
|
|
/* TRUE if from/to an insert event (else belongs to a schedule event) */
|
|
|
|
|
gboolean insert_event;
|
|
|
|
|
|
|
|
|
|
guint32 splice_event_id;
|
|
|
|
|
gboolean splice_event_cancel_indicator;
|
|
|
|
|
|
|
|
|
|
/* If splice_event_cancel_indicator == 0 */
|
|
|
|
|
gboolean out_of_network_indicator;
|
2021-04-13 21:38:16 +00:00
|
|
|
|
gboolean program_splice_flag;
|
2019-09-26 15:28:27 +00:00
|
|
|
|
gboolean duration_flag;
|
2021-04-13 18:51:09 +00:00
|
|
|
|
|
2019-09-26 15:28:27 +00:00
|
|
|
|
gboolean splice_immediate_flag; /* Only valid for insert_event */
|
|
|
|
|
|
2021-04-13 21:38:16 +00:00
|
|
|
|
gboolean program_splice_time_specified; /* Only valid for insert_event && program_splice */
|
|
|
|
|
guint64 program_splice_time; /* Only valid for insert_event && program_splice */
|
|
|
|
|
|
2021-09-24 22:09:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* GstMpegtsSCTESpliceEvent.utc_splice_time:
|
|
|
|
|
*
|
|
|
|
|
* The UTC time of the signaled splice event
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.20
|
|
|
|
|
*/
|
2021-04-13 21:38:16 +00:00
|
|
|
|
guint32 utc_splice_time; /* Only valid for !insert_event (schedule) && program_splice */
|
|
|
|
|
|
2021-09-24 22:09:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* GstMpegtsSCTESpliceEvent.components:
|
|
|
|
|
*
|
|
|
|
|
* Per-PID splice time information
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.20
|
|
|
|
|
*/
|
2021-04-13 21:38:16 +00:00
|
|
|
|
GPtrArray *components; /* Only valid for !program_splice */
|
2019-09-26 15:28:27 +00:00
|
|
|
|
|
|
|
|
|
gboolean break_duration_auto_return;
|
|
|
|
|
guint64 break_duration;
|
|
|
|
|
|
|
|
|
|
guint16 unique_program_id;
|
|
|
|
|
guint8 avail_num;
|
|
|
|
|
guint8 avails_expected;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Types of descriptors
|
|
|
|
|
*
|
|
|
|
|
* Note: These are only for the descriptors *WITHIN* a SIT */
|
|
|
|
|
typedef enum {
|
|
|
|
|
GST_MTS_SCTE_DESC_AVAIL = 0x00,
|
|
|
|
|
GST_MTS_SCTE_DESC_DTMF = 0x01,
|
|
|
|
|
GST_MTS_SCTE_DESC_SEGMENTATION = 0x02,
|
|
|
|
|
GST_MTS_SCTE_DESC_TIME = 0x03,
|
|
|
|
|
GST_MTS_SCTE_DESC_AUDIO = 0x04
|
|
|
|
|
} GstMpegtsSCTESpliceDescriptor;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_NULL = 0x00,
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_SCHEDULE = 0x04,
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_INSERT = 0x05,
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_TIME = 0x06,
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_BANDWIDTH = 0x07,
|
|
|
|
|
GST_MTS_SCTE_SPLICE_COMMAND_PRIVATE = 0xff
|
|
|
|
|
} GstMpegtsSCTESpliceCommandType;
|
|
|
|
|
|
2021-04-05 22:21:58 +00:00
|
|
|
|
#define GST_TYPE_MPEGTS_SCTE_SIT (gst_mpegts_scte_sit_get_type())
|
2019-09-26 15:28:27 +00:00
|
|
|
|
|
|
|
|
|
typedef struct _GstMpegtsSCTESIT GstMpegtsSCTESIT;
|
|
|
|
|
|
|
|
|
|
struct _GstMpegtsSCTESIT
|
|
|
|
|
{
|
|
|
|
|
gboolean encrypted_packet;
|
|
|
|
|
guint8 encryption_algorithm;
|
|
|
|
|
|
|
|
|
|
guint64 pts_adjustment;
|
|
|
|
|
guint8 cw_index;
|
|
|
|
|
guint16 tier;
|
|
|
|
|
|
|
|
|
|
guint16 splice_command_length;
|
2021-04-13 18:44:54 +00:00
|
|
|
|
|
2019-09-26 15:28:27 +00:00
|
|
|
|
GstMpegtsSCTESpliceCommandType splice_command_type;
|
|
|
|
|
|
|
|
|
|
/* For time_signal commands */
|
|
|
|
|
gboolean splice_time_specified;
|
|
|
|
|
guint64 splice_time;
|
|
|
|
|
|
|
|
|
|
GPtrArray *splices;
|
|
|
|
|
|
|
|
|
|
GPtrArray *descriptors;
|
2021-04-22 23:22:32 +00:00
|
|
|
|
|
2021-09-24 22:09:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* GstMpegtsSCTESIT.fully_parsed:
|
|
|
|
|
*
|
|
|
|
|
* When encrypted, or when encountering an unknown command type,
|
|
|
|
|
* we may still want to pass the sit through.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.20
|
|
|
|
|
*/
|
2021-04-22 23:22:32 +00:00
|
|
|
|
gboolean fully_parsed;
|
2021-09-24 22:09:00 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GstMpegtsSCTESIT.is_running_time:
|
|
|
|
|
*
|
|
|
|
|
* When the SIT was constructed by the application, splice times
|
|
|
|
|
* are in running_time and must be translated before packetizing.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.20
|
|
|
|
|
*/
|
2021-04-22 23:22:32 +00:00
|
|
|
|
gboolean is_running_time;
|
2019-09-26 15:28:27 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GType gst_mpegts_scte_sit_get_type (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESIT *gst_mpegts_scte_sit_new (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESIT *gst_mpegts_scte_null_new (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESIT *gst_mpegts_scte_cancel_new (guint32 event_id);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESIT *gst_mpegts_scte_splice_in_new (guint32 event_id,
|
2021-04-06 15:57:42 +00:00
|
|
|
|
GstClockTime splice_time);
|
2019-09-26 15:28:27 +00:00
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESIT *gst_mpegts_scte_splice_out_new (guint32 event_id,
|
2021-04-06 15:57:42 +00:00
|
|
|
|
GstClockTime splice_time,
|
|
|
|
|
GstClockTime duration);
|
2019-09-26 15:28:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GType gst_mpegts_scte_splice_event_get_type (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESpliceEvent *gst_mpegts_scte_splice_event_new (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
const GstMpegtsSCTESIT *gst_mpegts_section_get_scte_sit (GstMpegtsSection *section);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSection *gst_mpegts_section_from_scte_sit (GstMpegtsSCTESIT * sit, guint16 pid);
|
|
|
|
|
|
2021-04-13 21:38:16 +00:00
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GType gst_mpegts_scte_splice_component_get_type (void);
|
|
|
|
|
|
|
|
|
|
GST_MPEGTS_API
|
|
|
|
|
GstMpegtsSCTESpliceComponent *gst_mpegts_scte_splice_component_new (guint8 tag);
|
|
|
|
|
|
2019-09-26 15:28:27 +00:00
|
|
|
|
|
2014-01-06 15:01:22 +00:00
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
2013-09-27 14:45:00 +00:00
|
|
|
|
#endif /* GST_SCTE_SECTION_H */
|