From: Mathieu Duponchelle Date: Tue, 6 Apr 2021 15:37:28 +0000 (+0200) Subject: scte-section: add support for packetizing time_signal splices X-Git-Tag: 1.19.3~464 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9787d0c853d7f8e660019cf81640f81aab96e33;p=platform%2Fupstream%2Fgstreamer.git scte-section: add support for packetizing time_signal splices time_signal splices are trivial, they only contain a splice_time() and all the relevant information is carried in descriptors. Part-of: --- diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.c b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.c index e91191d12d..de20fe0559 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.c @@ -500,7 +500,6 @@ _packetize_sit (GstMpegtsSection * section) switch (sit->splice_command_type) { case GST_MTS_SCTE_SPLICE_COMMAND_SCHEDULE: - case GST_MTS_SCTE_SPLICE_COMMAND_TIME: case GST_MTS_SCTE_SPLICE_COMMAND_PRIVATE: GST_WARNING ("SCTE command not supported"); return FALSE; @@ -538,6 +537,14 @@ _packetize_sit (GstMpegtsSection * section) command_length += 5; } } + + if (sit->splice_command_type == GST_MTS_SCTE_SPLICE_COMMAND_TIME) { + if (sit->splice_time_specified) + command_length += 5; + else + command_length += 1; + } + length += command_length; /* Calculate size of descriptors */ @@ -573,6 +580,16 @@ _packetize_sit (GstMpegtsSection * section) GST_WRITE_UINT32_BE (data, tmp32); data += 4; + if (sit->splice_command_type == GST_MTS_SCTE_SPLICE_COMMAND_TIME) { + if (!sit->splice_time_specified) { + *data++ = 0x7f; + } else { + *data++ = 0xf2 | ((sit->splice_time >> 32) & 0x1); + GST_WRITE_UINT32_BE (data, sit->splice_time & 0xffffffff); + data += 4; + } + } + /* Write the events */ for (i = 0; i < sit->splices->len; i++) { GstMpegtsSCTESpliceEvent *event = g_ptr_array_index (sit->splices, i);