From a77d2a64c1f2251fb8afcd041c7d37815fcb3ed1 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 5 Dec 2013 18:48:44 -0500 Subject: [PATCH] v4l2object: Allocate pool if needed in decide_allocation https://bugzilla.gnome.org/show_bug.cgi?id=720568 --- sys/v4l2/gstv4l2object.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index a93b4ad..a54caea 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -3153,6 +3153,14 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query) g_return_val_if_fail (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, FALSE); + if (obj->pool == NULL) { + GstCaps *caps; + gst_query_parse_allocation (query, &caps, NULL); + + if (!gst_v4l2_object_setup_pool (obj, caps)) + goto pool_failed; + } + if (gst_query_get_n_allocation_pools (query) > 0) { gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); update = TRUE; -- 2.7.4