videoaggregator: Also sync pad properties to the controller if conversion is disabled

This commit is contained in:
Sebastian Dröge 2014-11-26 13:06:21 +01:00
parent dbadc6c8a5
commit fc593bd2ca

View file

@ -990,17 +990,12 @@ static gboolean
prepare_frames (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
{
GstAggregatorPad *bpad = GST_AGGREGATOR_PAD (pad);
static GstAllocationParams params = { 0, 15, 0, 0, };
GstVideoAggregatorClass *vagg_klass = GST_VIDEO_AGGREGATOR_GET_CLASS (vagg);
if (pad->buffer != NULL) {
guint outsize;
GstClockTime timestamp;
gint64 stream_time;
GstSegment *seg;
GstVideoFrame *converted_frame;
GstBuffer *converted_buf = NULL;
GstVideoFrame *frame = g_slice_new0 (GstVideoFrame);
seg = &bpad->segment;
@ -1012,6 +1007,12 @@ prepare_frames (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (pad), stream_time);
if (!vagg_klass->disable_frame_conversion) {
guint outsize;
GstVideoFrame *converted_frame;
GstBuffer *converted_buf = NULL;
GstVideoFrame *frame = g_slice_new0 (GstVideoFrame);
static GstAllocationParams params = { 0, 15, 0, 0, };
if (!gst_video_frame_map (frame, &pad->buffer_vinfo, pad->buffer,
GST_MAP_READ)) {
@ -1057,6 +1058,7 @@ prepare_frames (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad)
pad->aggregated_frame = converted_frame;
}
}
return TRUE;
}
@ -1099,11 +1101,10 @@ gst_videoaggregator_do_aggregate (GstVideoAggregator * vagg,
GST_BUFFER_TIMESTAMP (*outbuf) = output_start_time;
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
if (vagg_klass->disable_frame_conversion == FALSE) {
/* Here we convert all the frames the subclass will have to aggregate */
/* Here we convert all the frames the subclass will have to aggregate
* and also sync pad properties to the stream time */
gst_aggregator_iterate_sinkpads (GST_AGGREGATOR (vagg),
(GstAggregatorPadForeachFunc) prepare_frames, NULL);
}
ret = vagg_klass->aggregate_frames (vagg, *outbuf);