gstreamer1.0-plugins-good v1.16.1 v4l2src plugin tries to import
the dmabuf. This patch checks if the memory is drm.

This is required for dma_buf import support with v4l2src

Signed-off-by: Ramprasad N <[email protected]>
---
 ...heck-for-drm-memory-support-in-try_import.patch | 33 ++++++++++++++++++++++
 .../gstreamer1.0-plugins-good_1.16.%.bbappend      |  3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 
meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2src-Check-for-drm-memory-support-in-try_import.patch

diff --git 
a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2src-Check-for-drm-memory-support-in-try_import.patch
 
b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2src-Check-for-drm-memory-support-in-try_import.patch
new file mode 100644
index 0000000..81eceae
--- /dev/null
+++ 
b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2src-Check-for-drm-memory-support-in-try_import.patch
@@ -0,0 +1,33 @@
+From 6cd7e4a3647b6000c03db008e9dc06a7dc52e875 Mon Sep 17 00:00:00 2001
+From: Ramprasad N <[email protected]>
+Date: Fri, 21 Feb 2020 12:07:05 +0530
+Subject: [PATCH] v4l2src: Check for drm memory support in try_import
+
+In Gstreamer 1.16.1, if buffer pool is from a downstream
+element, v4l2 first tries to import.
+
+Check if the memory type is DRM memory.
+
+Signed-off-by: Ramprasad N <[email protected]>
+---
+ sys/v4l2/gstv4l2object.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index 2d401a7..5143e2c 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -4768,7 +4768,9 @@ gst_v4l2_object_try_import (GstV4l2Object * obj, 
GstBuffer * buffer)
+     for (i = 0; i < n_mem; i++) {
+       GstMemory *mem = gst_buffer_peek_memory (buffer, i);
+ 
+-      if (!gst_is_dmabuf_memory (mem)) {
++      if (!gst_is_dmabuf_memory (mem) &&
++          !gst_memory_is_type (mem, GST_ALLOCATOR_DMABUF)) {
++
+         GST_DEBUG_OBJECT (obj->dbg_obj, "Cannot import non-DMABuf memory.");
+         return FALSE;
+       }
+-- 
+1.9.1
+
diff --git 
a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
 
b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
index 59347d9..c5a41ba 100644
--- 
a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
+++ 
b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
@@ -1,4 +1,4 @@
-PR_append = ".arago0"
+PR_append = ".arago1"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
@@ -6,4 +6,5 @@ SRC_URI += " \
     file://0001-v4l2src-Increase-minimum-num-buffers-by-3.patch \
     file://0002-v4l2src-Use-generic-dmabuf-import-in-v4l2src.patch \
     file://0001-v4l2object-Update-formats-table-to-include-YUV422-mu.patch \
+    file://0001-v4l2src-Check-for-drm-memory-support-in-try_import.patch \
 "
-- 
1.9.1

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to