v4l2object: Allocate pool if needed in decide_allocation
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 5 Dec 2013 23:48:44 +0000 (18:48 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Jan 2014 22:13:23 +0000 (17:13 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=720568

sys/v4l2/gstv4l2object.c

index a93b4ad..a54caea 100644 (file)
@@ -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;