xref: /OK3568_Linux_fs/buildroot/package/libv4l/0007-libv4l-Disallow-conversion-by-default.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From d86fb1667ffd8e4dcf4a6339b2a2465da560e015 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 12 May 2022 15:54:25 +0800
4Subject: [PATCH 7/7] libv4l: Disallow conversion by default
5
6The conversion is slow, let's disable it by default.
7
8Set env "V4L2_DISABLE_CONVERSION" to enable it.
9
10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
11---
12 lib/libv4l2/libv4l2.c | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
16index 949a020..bd0b207 100644
17--- a/lib/libv4l2/libv4l2.c
18+++ b/lib/libv4l2/libv4l2.c
19@@ -789,6 +789,9 @@ int v4l2_fd_open(int fd, int v4l2_flags)
20 	if (dev_ops->ioctl(dev_ops_priv, fd, VIDIOC_G_PARM, &parm))
21 		parm.type = 0;
22
23+	if (!getenv("LIBV4L2_ALLOW_CONVERSION"))
24+		v4l2_flags |= V4L2_DISABLE_CONVERSION;
25+
26 	/* init libv4lconvert */
27 	if (!(v4l2_flags & V4L2_DISABLE_CONVERSION)) {
28 		convert = v4lconvert_create_with_dev_ops(fd, dev_ops_priv, dev_ops);
29--
302.20.1
31
32