v4l2object: Only offer MMAP/DMABUF pool
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 22 Aug 2018 19:23:53 +0000 (19:23 +0000)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 31 Aug 2018 19:44:02 +0000 (15:44 -0400)
The propose allocation was offering a pool even in DMABUF_IMPORT or
USERPTR mode. These pool are internal only.

sys/v4l2/gstv4l2object.c

index 9b50c16..e9b3e24 100644 (file)
@@ -4555,8 +4555,16 @@ gst_v4l2_object_propose_allocation (GstV4l2Object * obj, GstQuery * query)
   if (caps == NULL)
     goto no_caps;
 
-  if ((pool = obj->pool))
-    gst_object_ref (pool);
+  switch (obj->mode) {
+    case GST_V4L2_IO_MMAP:
+    case GST_V4L2_IO_DMABUF:
+      if ((pool = obj->pool))
+        gst_object_ref (pool);
+      break;
+    default:
+      pool = NULL;
+      break;
+  }
 
   if (pool != NULL) {
     GstCaps *pcaps;