hc
2023-11-20 2e7bd41e4e8ab3d1efdabd9e263a2f7fe79bff8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From daf0a63c1c27cd738579b3d10284b5760b70122d Mon Sep 17 00:00:00 2001
From: "vicent.chi" <vicent.chi@rock-chips.com>
Date: Sat, 28 Mar 2020 18:03:57 +0800
Subject: [PATCH 5/8] libv4l mplane plugin add exbuf_ioctl for dmabuf
 
Signed-off-by: vicent.chi <vicent.chi@rock-chips.com>
---
 lib/libv4l-mplane/libv4l-mplane.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
 
diff --git a/lib/libv4l-mplane/libv4l-mplane.c b/lib/libv4l-mplane/libv4l-mplane.c
index b30840a3..db22b0b4 100644
--- a/lib/libv4l-mplane/libv4l-mplane.c
+++ b/lib/libv4l-mplane/libv4l-mplane.c
@@ -539,6 +539,17 @@ static int buf_ioctl(int fd, unsigned long int cmd, struct v4l2_buffer *arg)
     return ret;
 }
 
+static int exbuf_ioctl(int fd, unsigned long int cmd, struct v4l2_exportbuffer *arg)
+{
+    if (arg->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
+        arg->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
+        errno = EINVAL;
+        return -1;
+    }
+    arg->type = convert_type(arg->type);
+    return SYS_IOCTL(fd, cmd, arg);
+}
+
 static int plugin_ioctl(void *dev_ops_priv, int fd,
             unsigned long int cmd, void *arg)
 {
@@ -580,7 +591,8 @@ static int plugin_ioctl(void *dev_ops_priv, int fd,
 
         return SYS_IOCTL(fd, cmd, &type);
     }
-    /* CASE VIDIOC_EXPBUF: */
+    case VIDIOC_EXPBUF:
+        return exbuf_ioctl(fd, cmd, arg);
     default:
         return SYS_IOCTL(fd, cmd, arg);
     }
-- 
2.20.1