videoaggregator: update to new samples selection API
authorMathieu Duponchelle <mathieu@centricular.com>
Wed, 5 Aug 2020 14:54:19 +0000 (16:54 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Wed, 5 Aug 2020 18:09:52 +0000 (20:09 +0200)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/778>

gst-libs/gst/video/gstvideoaggregator.c
tests/check/elements/compositor.c
tests/examples/compositor/signals.c

index b6fe148..d6fae1b 100644 (file)
@@ -1737,7 +1737,7 @@ clean_pad (GstElement * agg, GstPad * pad, gpointer user_data)
 static GstFlowReturn
 gst_video_aggregator_do_aggregate (GstVideoAggregator * vagg,
     GstClockTime output_start_time, GstClockTime output_end_time,
-    GstBuffer ** outbuf)
+    GstClockTime output_start_running_time, GstBuffer ** outbuf)
 {
   GstAggregator *agg = GST_AGGREGATOR (vagg);
   GstFlowReturn ret = GST_FLOW_OK;
@@ -1772,7 +1772,8 @@ gst_video_aggregator_do_aggregate (GstVideoAggregator * vagg,
       &out_stream_time);
 
   /* Let the application know that input buffers have been staged */
-  gst_aggregator_selected_samples (agg);
+  gst_aggregator_selected_samples (agg, GST_BUFFER_PTS (*outbuf),
+      GST_BUFFER_DTS (*outbuf), GST_BUFFER_DURATION (*outbuf));
 
   /* Convert all the frames the subclass has before aggregating */
   gst_element_foreach_sink_pad (GST_ELEMENT_CAST (vagg), prepare_frames, NULL);
@@ -1953,7 +1954,7 @@ gst_video_aggregator_aggregate (GstAggregator * agg, gboolean timeout)
   jitter = gst_video_aggregator_do_qos (vagg, output_start_time);
   if (jitter <= 0) {
     flow_ret = gst_video_aggregator_do_aggregate (vagg, output_start_time,
-        output_end_time, &outbuf);
+        output_end_time, output_start_running_time, &outbuf);
     if (flow_ret != GST_FLOW_OK)
       goto done;
     vagg->priv->qos_processed++;
index 5e0a30a..958cca6 100644 (file)
@@ -2169,7 +2169,8 @@ GST_END_TEST;
 static GstBuffer *expected_selected_buffer = NULL;
 
 static void
-samples_selected_cb (GstAggregator * agg, gint * called)
+samples_selected_cb (GstAggregator * agg, GstSegment * segment,
+    GstClockTime pts, GstClockTime dts, GstClockTime duration, gint * called)
 {
   GstPad *pad;
   GstSample *sample;
index 0075ab0..b74c9b4 100644 (file)
@@ -61,9 +61,13 @@ check_aggregated_buffer (GstElement * agg, GstPad * pad,
 }
 
 static void
-samples_selected_cb (GstElement * agg, GHashTable * consumed_buffers)
+samples_selected_cb (GstElement * agg, GstSegment * segment, GstClockTime pts,
+    GstClockTime dts, GstClockTime duration, GHashTable * consumed_buffers)
 {
-  gst_printerr ("Compositor has selected the samples it will aggregate\n");
+  gst_printerr
+      ("Compositor has selected the samples it will aggregate for output buffer with PTS %"
+      GST_TIME_FORMAT " and duration %" GST_TIME_FORMAT "\n",
+      GST_TIME_ARGS (pts), GST_TIME_ARGS (duration));
   gst_element_foreach_sink_pad (agg,
       (GstElementForeachPadFunc) check_aggregated_buffer, consumed_buffers);
 }