From patchwork Fri Jan 19 20:08:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 19417 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 92C75C323E for ; Fri, 19 Jan 2024 20:09:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA34662916; Fri, 19 Jan 2024 21:09:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1705694940; bh=8dK+fx1U/Rm4uQqLalwH8wJCS9ZVyWq2iWCqiOUoyew=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gpBjPFhsrrGxSVfCzDf0VhJK97q1u2iqq6Qi1G1mjyjl/8K7iBp/PeZ+QZDq4quPE AJnSoMBUJIv1XO86THe8g+AXwgb9tapDZ9HHJoZw7XLSyZPRPo2SIRU5Q7i8cAj3Vb D14KY9rl8h4/y83G+v9P12uNmRGUrD5RDQDhudDlBN6gNkJeoqNDLLsA+CHQOIkipQ VrIY46ej92G+AsbfAAPoZsFgtXhlPt53aIALt31B9UhzrXFBgyIfgaTpGW16HwxMqr 9uPoumsPFhrSuamRl4FgBtTKzjPQcSsRlaabsUANP7v9xp16MbWI0P/5BTTUD1KLGO VC379zy7TEEfQ== Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E096761D3C for ; Fri, 19 Jan 2024 21:08:59 +0100 (CET) Received: from nicolas-tpx395.lan (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2D15B378042B; Fri, 19 Jan 2024 20:08:59 +0000 (UTC) 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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicolas Dufresne via libcamera-devel From: Nicolas Dufresne Reply-To: Nicolas Dufresne Cc: Nicolas Dufresne Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicolas Dufresne This change to the build system will prepend the plugin build directory to GST_PLUGIN_PATH environment. This makes the built plugin visible to GStreamer inside meson devenv enabling uninstalled testing. In order to avoid pulluting the user registry, the GST_REGISTRY environement is also set. Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Changes in V2: - Use gst_ prefix for the path and env - Don't call fs.parent twice - Set GST_REGISTRY - Update the documentation README.rst | 7 ++++--- src/gstreamer/meson.build | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 315738ee..a7e0561f 100644 --- a/README.rst +++ b/README.rst @@ -120,12 +120,13 @@ setting the ``LIBCAMERA_LOG_LEVELS`` environment variable: Using GStreamer plugin ~~~~~~~~~~~~~~~~~~~~~~ -To use GStreamer plugin from source tree, set the following environment so that -GStreamer can find it. This isn't necessary when libcamera is installed. +To use GStreamer plugin from source tree, use meson ``devenv`` command. +This will create a new shell instance with ``GST_PLUGIN_PATH`` environment set +accordingly. .. code:: - export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer + meson devenv -C build The debugging tool ``gst-launch-1.0`` can be used to construct a pipeline and test it. The following pipeline will stream from the camera named "Camera 1" diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build index 20784b71..1536fd23 100644 --- a/src/gstreamer/meson.build +++ b/src/gstreamer/meson.build @@ -46,3 +46,14 @@ libcamera_gst = shared_library('gstlibcamera', install : true, install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')), ) + +# Makes the plugin visible to GStreamer inside meson devenv +fs = import('fs') +gst_plugin_path = fs.parent(libcamera_gst.full_path()) + +gst_env = environment() +gst_env.prepend('GST_PLUGIN_PATH', gst_plugin_path) +# Avoid polluting the system registry +gst_env.set('GST_REGISTRY', gst_plugin_path / 'registry.data') + +meson.add_devenv(gst_env)