scte35-section: semantic API break
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 6 Apr 2021 15:57:42 +0000 (17:57 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 25 Sep 2021 01:29:37 +0000 (01:29 +0000)
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>

subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.c
subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-scte-section.h
subprojects/gst-plugins-bad/tests/examples/mpegts/ts-scte-writer.c

index de20fe0..585f288 100644 (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 ();
index 4b98a4a..aff52bc 100644 (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
index 00c1fe8..ab651d0 100644 (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);