scte35-section: semantic API break

Document that the constructors for the splice events expect
a running time, as users of the API can not be expected to
predict the appropriate local PTS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
This commit is contained in:
Mathieu Duponchelle 2021-04-06 17:57:42 +02:00 committed by GStreamer Marge Bot
parent a9787d0c85
commit d17c7f25e6
3 changed files with 11 additions and 11 deletions

View file

@ -388,7 +388,7 @@ gst_mpegts_scte_cancel_new (guint32 event_id)
/**
* gst_mpegts_scte_splice_in_new:
* @event_id: The event ID.
* @splice_time: The PCR time for the splice event
* @splice_time: The running time for the splice event
*
* Allocates and initializes a new "Splice In" INSERT command
* #GstMpegtsSCTESIT for the given @event_id and @splice_time.
@ -399,7 +399,7 @@ gst_mpegts_scte_cancel_new (guint32 event_id)
* Returns: (transfer full): A newly allocated #GstMpegtsSCTESIT
*/
GstMpegtsSCTESIT *
gst_mpegts_scte_splice_in_new (guint32 event_id, guint64 splice_time)
gst_mpegts_scte_splice_in_new (guint32 event_id, GstClockTime splice_time)
{
GstMpegtsSCTESIT *sit = gst_mpegts_scte_sit_new ();
GstMpegtsSCTESpliceEvent *event = gst_mpegts_scte_splice_event_new ();
@ -420,12 +420,12 @@ gst_mpegts_scte_splice_in_new (guint32 event_id, guint64 splice_time)
/**
* gst_mpegts_scte_splice_out_new:
* @event_id: The event ID.
* @splice_time: The PCR time for the splice event
* @splice_time: The running time for the splice event
* @duration: The optional duration.
*
* Allocates and initializes a new "Splice Out" INSERT command
* #GstMpegtsSCTESIT for the given @event_id, @splice_time and
* duration.
* @duration.
*
* If the @splice_time is #G_MAXUINT64 then the event will be
* immediate as opposed to for the target @splice_time.
@ -435,8 +435,8 @@ gst_mpegts_scte_splice_in_new (guint32 event_id, guint64 splice_time)
* Returns: (transfer full): A newly allocated #GstMpegtsSCTESIT
*/
GstMpegtsSCTESIT *
gst_mpegts_scte_splice_out_new (guint32 event_id, guint64 splice_time,
guint64 duration)
gst_mpegts_scte_splice_out_new (guint32 event_id, GstClockTime splice_time,
GstClockTime duration)
{
GstMpegtsSCTESIT *sit = gst_mpegts_scte_sit_new ();
GstMpegtsSCTESpliceEvent *event = gst_mpegts_scte_splice_event_new ();

View file

@ -193,12 +193,12 @@ GstMpegtsSCTESIT *gst_mpegts_scte_cancel_new (guint32 event_id);
GST_MPEGTS_API
GstMpegtsSCTESIT *gst_mpegts_scte_splice_in_new (guint32 event_id,
guint64 splice_time);
GstClockTime splice_time);
GST_MPEGTS_API
GstMpegtsSCTESIT *gst_mpegts_scte_splice_out_new (guint32 event_id,
guint64 splice_time,
guint64 duration);
GstClockTime splice_time,
GstClockTime duration);
GST_MPEGTS_API

View file

@ -29,9 +29,9 @@ send_splice (GstElement * mux, gboolean out)
/* Splice is at 5s for 30s */
if (out)
sit = gst_mpegts_scte_splice_out_new (1, 5 * 90000, 30 * 90000);
sit = gst_mpegts_scte_splice_out_new (1, 5 * GST_SECOND, 30 * GST_SECOND);
else
sit = gst_mpegts_scte_splice_in_new (2, 35 * 90000);
sit = gst_mpegts_scte_splice_in_new (2, 35 * GST_SECOND);
section = gst_mpegts_section_from_scte_sit (sit, 123);
gst_mpegts_section_send_event (section, mux);