From 46ffef798c41bdaef1d0b503a78b685b12a82015 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 8 Apr 2014 17:34:19 -0400 Subject: [PATCH] v4l2object: Ensure size before configuring the pool --- sys/v4l2/gstv4l2object.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 586a7cc552..78fbb4637c 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -3128,6 +3128,17 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query) break; } + /* Size field is mandatory and we have no size if now using our own pool and + * downstream didn't provide one. */ + if (size == 0) { + GstVideoInfo info; + + gst_video_info_init (&info); + gst_video_info_from_caps (&info, caps); + + size = GST_VIDEO_INFO_SIZE (&info); + } + if (pool) { GstStructure *config; @@ -3144,17 +3155,6 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query) gst_buffer_pool_set_config (pool, config); } - /* Size field is mandatory and we have no size if now using our own pool and - * downstream didn't provide one. */ - if (size == 0) { - GstVideoInfo info; - - gst_video_info_init (&info); - gst_video_info_from_caps (&info, caps); - - size = GST_VIDEO_INFO_SIZE (&info); - } - if (update) gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max); else