{"id":19417,"url":"https://patchwork.libcamera.org/api/patches/19417/?format=json","web_url":"https://patchwork.libcamera.org/patch/19417/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20240119200848.358298-1-nicolas@ndufresne.ca>","date":"2024-01-19T20:08:47","name":"[libcamera-devel,v2,1/2] gstreamer: Add meson devenv support","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"0b6f190c4d421dfabed2cb3a62e3cf10cbcb40f7","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/?format=json","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19417/mbox/","series":[{"id":4146,"url":"https://patchwork.libcamera.org/api/series/4146/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4146","date":"2024-01-19T20:08:47","name":"[libcamera-devel,v2,1/2] gstreamer: Add meson devenv support","version":2,"mbox":"https://patchwork.libcamera.org/series/4146/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19417/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19417/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 92C75C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Jan 2024 20:09:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA34662916;\n\tFri, 19 Jan 2024 21:09:00 +0100 (CET)","from madrid.collaboradmins.com (madrid.collaboradmins.com\n\t[IPv6:2a00:1098:ed:100::25])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E096761D3C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Jan 2024 21:08:59 +0100 (CET)","from nicolas-tpx395.lan (cola.collaboradmins.com [195.201.22.229])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby madrid.collaboradmins.com (Postfix) with ESMTPSA id 2D15B378042B; \n\tFri, 19 Jan 2024 20:08:59 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1705694940;\n\tbh=8dK+fx1U/Rm4uQqLalwH8wJCS9ZVyWq2iWCqiOUoyew=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=gpBjPFhsrrGxSVfCzDf0VhJK97q1u2iqq6Qi1G1mjyjl/8K7iBp/PeZ+QZDq4quPE\n\tAJnSoMBUJIv1XO86THe8g+AXwgb9tapDZ9HHJoZw7XLSyZPRPo2SIRU5Q7i8cAj3Vb\n\tD14KY9rl8h4/y83G+v9P12uNmRGUrD5RDQDhudDlBN6gNkJeoqNDLLsA+CHQOIkipQ\n\tVrIY46ej92G+AsbfAAPoZsFgtXhlPt53aIALt31B9UhzrXFBgyIfgaTpGW16HwxMqr\n\t9uPoumsPFhrSuamRl4FgBtTKzjPQcSsRlaabsUANP7v9xp16MbWI0P/5BTTUD1KLGO\n\tVC379zy7TEEfQ==","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 19 Jan 2024 15:08:47 -0500","Message-ID":"<20240119200848.358298-1-nicolas@ndufresne.ca>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 1/2] gstreamer: Add meson devenv support","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>","From":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nThis change to the build system will prepend the plugin build directory\nto GST_PLUGIN_PATH environment. This makes the built plugin visible to\nGStreamer inside meson devenv enabling uninstalled testing. In order to avoid\npulluting the user registry, the GST_REGISTRY environement is also set.\n\nSigned-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n---\nChanges in V2:\n  - Use gst_ prefix for the path and env\n  - Don't call fs.parent twice\n  - Set GST_REGISTRY\n  - Update the documentation\n\n README.rst                |  7 ++++---\n src/gstreamer/meson.build | 11 +++++++++++\n 2 files changed, 15 insertions(+), 3 deletions(-)","diff":"diff --git a/README.rst b/README.rst\nindex 315738ee..a7e0561f 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -120,12 +120,13 @@ setting the ``LIBCAMERA_LOG_LEVELS`` environment variable:\n Using GStreamer plugin\n ~~~~~~~~~~~~~~~~~~~~~~\n \n-To use GStreamer plugin from source tree, set the following environment so that\n-GStreamer can find it. This isn't necessary when libcamera is installed.\n+To use GStreamer plugin from source tree, use meson ``devenv`` command.\n+This will create a new shell instance with ``GST_PLUGIN_PATH`` environment set\n+accordingly.\n \n .. code::\n \n-  export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer\n+  meson devenv -C build\n \n The debugging tool ``gst-launch-1.0`` can be used to construct a pipeline and\n test it. The following pipeline will stream from the camera named \"Camera 1\"\ndiff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\nindex 20784b71..1536fd23 100644\n--- a/src/gstreamer/meson.build\n+++ b/src/gstreamer/meson.build\n@@ -46,3 +46,14 @@ libcamera_gst = shared_library('gstlibcamera',\n     install : true,\n     install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\n )\n+\n+# Makes the plugin visible to GStreamer inside meson devenv\n+fs = import('fs')\n+gst_plugin_path = fs.parent(libcamera_gst.full_path())\n+\n+gst_env = environment()\n+gst_env.prepend('GST_PLUGIN_PATH', gst_plugin_path)\n+# Avoid polluting the system registry\n+gst_env.set('GST_REGISTRY', gst_plugin_path / 'registry.data')\n+\n+meson.add_devenv(gst_env)\n","prefixes":["libcamera-devel","v2","1/2"]}