{"id":15304,"url":"https://patchwork.libcamera.org/api/1.1/patches/15304/?format=json","web_url":"https://patchwork.libcamera.org/patch/15304/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220131210757.105299-1-kieran.bingham@ideasonboard.com>","date":"2022-01-31T21:07:57","name":"[libcamera-devel,v2] v4l2: Provide libcamerify wrapper script","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2ad605ce46ebca02088bef540ae0740ebe6de0c8","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":{"id":11,"url":"https://patchwork.libcamera.org/api/1.1/users/11/?format=json","username":"kbingham","first_name":"Kieran","last_name":"Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/15304/mbox/","series":[{"id":2905,"url":"https://patchwork.libcamera.org/api/1.1/series/2905/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2905","date":"2022-01-31T21:07:57","name":"[libcamera-devel,v2] v4l2: Provide libcamerify wrapper script","version":2,"mbox":"https://patchwork.libcamera.org/series/2905/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15304/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15304/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 17071BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 31 Jan 2022 21:08:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5A0B6609AF;\n\tMon, 31 Jan 2022 22:08:03 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B5E4609AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Jan 2022 22:08:01 +0100 (CET)","from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E4D04D97;\n\tMon, 31 Jan 2022 22:08:00 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RuS5Z75Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1643663281;\n\tbh=sdvXI1mERAYn6dKCzuC+HynsGZb8TG//bQi5gjIC50k=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=RuS5Z75ZZqDPMsKlh/J2yt7gPsUWPV0UFPF6/oEFDYnR4VL2QsE+Sx1WRJZzwgL24\n\tfMUvhNlxmt25iz/n4l8+IPamqaWkAOPsjcA226aZpvw9kF/MGuCUcu//cXP2qD6tf0\n\tJ+WwVwq7XNH7lm398VW5wvUiS+9/YyuvATSp3LCs=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Mon, 31 Jan 2022 21:07:57 +0000","Message-Id":"<20220131210757.105299-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] v4l2: Provide libcamerify wrapper\n\tscript","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Support easier usage of the v4l2 compatibility layer with a script that\nhandles the LD_PRELOAD for applications.\n\nThe wrapper can be prefixed to launch any application with the preload\nset:\n\n $ libcamerify v4l2-ctl --list-devices\n \\_SB_.PCI0.GP13.XHC0.RHUB.PRT4- (libcamera:0):\n \t/dev/video0\n\n platform/vimc.0 Sensor B (libcamera:1):\n \t/dev/video2\n \t/dev/video3\n \t/dev/video4\n\nSpecifying '-d' once before the command to run will enable V4L2Compat\nlayer debug output from libcamera.\n\nSpecifying '-d' twice will enable all debug levels from all libcamera\ncomponents and provide a very detailed log for analysis.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nv2:\n - rename to libcamerify (from libcamera-v4l2)\n - add extending support for setting debug log levels.\n\n\n src/v4l2/libcamerify.in | 34 ++++++++++++++++++++++++++++++++++\n src/v4l2/meson.build    | 14 ++++++++++++++\n 2 files changed, 48 insertions(+)\n create mode 100755 src/v4l2/libcamerify.in","diff":"diff --git a/src/v4l2/libcamerify.in b/src/v4l2/libcamerify.in\nnew file mode 100755\nindex 000000000000..161f5e49190e\n--- /dev/null\n+++ b/src/v4l2/libcamerify.in\n@@ -0,0 +1,34 @@\n+#!/bin/sh\n+\n+if [ \"$LD_PRELOAD\" = \"\" ] ; then\n+   LD_PRELOAD='@LIBCAMERA_V4L2_SO@'\n+else\n+   LD_PRELOAD=\"$LD_PRELOAD \"'@LIBCAMERA_V4L2_SO@'\n+fi\n+\n+export LD_PRELOAD\n+\n+help() {\n+\techo \"$0: Load an application with libcamera V4L2 compatibility layer preload\"\n+\techo \" $0 [OPTIONS...] executable [args]\"\n+\techo \" -d, --debug\tIncrease log level\"\n+\texit 1;\n+}\n+\n+debug=0\n+while [ $# -gt 0 ]; do\n+\tcase $1 in\n+\t\t-d|--debug) debug=$((debug+1));;\n+\t\t-h) help; break;;\n+\t\t--) shift; break;;\n+\t\t-*) echo \"Unrecognised option: $1\"; help; break;;\n+\t\t*) break;;\n+\tesac\n+\tshift\n+done\n+\n+[ $debug -gt 0 ] && loglevel=V4L2Compat:0\n+[ $debug -gt 1 ] && loglevel=0\n+[ \"$loglevel\" != \"\" ] && export LIBCAMERA_LOG_LEVELS=$loglevel\n+\n+exec \"$@\"\ndiff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\nindex f78497b6799b..07ff9a6939d2 100644\n--- a/src/v4l2/meson.build\n+++ b/src/v4l2/meson.build\n@@ -33,3 +33,17 @@ v4l2_compat = shared_library('v4l2-compat',\n                              install : true,\n                              dependencies : [libcamera_private, libdl],\n                              cpp_args : v4l2_compat_cpp_args)\n+\n+# Provide a wrapper script to support easily loading applications with the V4L2\n+# adaptation layer\n+\n+config_h.set('LIBCAMERA_V4L2_SO', get_option('prefix') / get_option('libdir') / 'v4l2-compat.so')\n+\n+summary({\n+    'LIBCAMERA_V4L2_SO' : config_h.get('LIBCAMERA_V4L2_SO'),\n+}, section : 'Paths')\n+\n+configure_file(input : 'libcamerify.in',\n+               output : 'libcamerify',\n+               configuration : config_h,\n+               install_dir : get_option('bindir'))\n","prefixes":["libcamera-devel","v2"]}