mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
videoaggregator: use new gst_element_foreach_sink_pad()
Instead of gst_aggregator_iterate_sinkpads() which will soon be removed. https://bugzilla.gnome.org/show_bug.cgi?id=785679
This commit is contained in:
parent
46d40debba
commit
13c730776b
1 changed files with 17 additions and 16 deletions
|
@ -1261,16 +1261,17 @@ gst_video_aggregator_fill_queues (GstVideoAggregator * vagg,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
sync_pad_values (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
|
sync_pad_values (GstElement * vagg, GstPad * pad, gpointer user_data)
|
||||||
{
|
{
|
||||||
GstAggregatorPad *bpad = GST_AGGREGATOR_PAD (pad);
|
GstVideoAggregatorPad *vpad = GST_VIDEO_AGGREGATOR_PAD (pad);
|
||||||
|
GstAggregatorPad *bpad = GST_AGGREGATOR_PAD_CAST (pad);
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
gint64 stream_time;
|
gint64 stream_time;
|
||||||
|
|
||||||
if (pad->buffer == NULL)
|
if (vpad->buffer == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (pad->buffer);
|
timestamp = GST_BUFFER_TIMESTAMP (vpad->buffer);
|
||||||
GST_OBJECT_LOCK (bpad);
|
GST_OBJECT_LOCK (bpad);
|
||||||
stream_time = gst_segment_to_stream_time (&bpad->segment, GST_FORMAT_TIME,
|
stream_time = gst_segment_to_stream_time (&bpad->segment, GST_FORMAT_TIME,
|
||||||
timestamp);
|
timestamp);
|
||||||
|
@ -1278,30 +1279,33 @@ sync_pad_values (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
|
||||||
|
|
||||||
/* sync object properties on stream time */
|
/* sync object properties on stream time */
|
||||||
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
||||||
gst_object_sync_values (GST_OBJECT (pad), stream_time);
|
gst_object_sync_values (GST_OBJECT_CAST (pad), stream_time);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
prepare_frames (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
|
prepare_frames (GstElement * agg, GstPad * pad, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
GstVideoAggregatorPad *vpad = GST_VIDEO_AGGREGATOR_PAD_CAST (pad);
|
||||||
GstVideoAggregatorPadClass *vaggpad_class =
|
GstVideoAggregatorPadClass *vaggpad_class =
|
||||||
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS (pad);
|
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS (pad);
|
||||||
|
|
||||||
if (pad->buffer == NULL || !vaggpad_class->prepare_frame)
|
if (vpad->buffer == NULL || !vaggpad_class->prepare_frame)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return vaggpad_class->prepare_frame (pad, vagg);
|
return vaggpad_class->prepare_frame (vpad, GST_VIDEO_AGGREGATOR_CAST (agg));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clean_pad (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
|
clean_pad (GstElement * agg, GstPad * pad, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR_CAST (agg);
|
||||||
|
GstVideoAggregatorPad *vpad = GST_VIDEO_AGGREGATOR_PAD_CAST (pad);
|
||||||
GstVideoAggregatorPadClass *vaggpad_class =
|
GstVideoAggregatorPadClass *vaggpad_class =
|
||||||
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS (pad);
|
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS (pad);
|
||||||
|
|
||||||
vaggpad_class->clean_frame (pad, vagg);
|
vaggpad_class->clean_frame (vpad, vagg);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1334,18 +1338,15 @@ gst_video_aggregator_do_aggregate (GstVideoAggregator * vagg,
|
||||||
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
|
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
|
||||||
|
|
||||||
/* Sync pad properties to the stream time */
|
/* Sync pad properties to the stream time */
|
||||||
gst_aggregator_iterate_sinkpads (GST_AGGREGATOR (vagg),
|
gst_element_foreach_sink_pad (GST_ELEMENT_CAST (vagg), sync_pad_values, NULL);
|
||||||
(GstAggregatorPadForeachFunc) sync_pad_values, NULL);
|
|
||||||
|
|
||||||
/* Convert all the frames the subclass has before aggregating */
|
/* Convert all the frames the subclass has before aggregating */
|
||||||
gst_aggregator_iterate_sinkpads (GST_AGGREGATOR (vagg),
|
gst_element_foreach_sink_pad (GST_ELEMENT_CAST (vagg), prepare_frames, NULL);
|
||||||
(GstAggregatorPadForeachFunc) prepare_frames, NULL);
|
|
||||||
|
|
||||||
ret = vagg_klass->aggregate_frames (vagg, *outbuf);
|
ret = vagg_klass->aggregate_frames (vagg, *outbuf);
|
||||||
|
|
||||||
if (vaggpad_class->clean_frame) {
|
if (vaggpad_class->clean_frame) {
|
||||||
gst_aggregator_iterate_sinkpads (GST_AGGREGATOR (vagg),
|
gst_element_foreach_sink_pad (GST_ELEMENT_CAST (vagg), clean_pad, NULL);
|
||||||
(GstAggregatorPadForeachFunc) clean_pad, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue