Skip to content

Commit

Permalink
videoaggregator: update to new samples selection API
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuDuponchelle committed Aug 5, 2020
1 parent 66ff1ee commit 1de8af6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions gst-libs/gst/video/gstvideoaggregator.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
Expand Down
3 changes: 2 additions & 1 deletion tests/check/elements/compositor.c
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions tests/examples/compositor/signals.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1de8af6

Please sign in to comment.