From patchwork Fri Jan 19 20:08:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 19418 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 B268CC323E for ; Fri, 19 Jan 2024 20:09:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 678E161D4C; Fri, 19 Jan 2024 21:09:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1705694954; bh=HvP1O5J7UkCfnfwhamMK0sBUkDJQnn6tDV1FlpaGbcc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uMutLT93qbAzTRCcxh1jGS/34sGz3aHnte1YvDOfKQLD0Q9GaX/6QHOlzPykZoHsy bye/sG2eDWRTcYB6XVof2MjcuKuPWwtFGxPBR0tLFSt6D0P0QchlLtZzaNDP2pvYQB cZx5HeZmPKe7dJbHJ2dSGdctBlX0h7Cz3aDLhSVT9wCR9tH4/WV0x2KeNIh2cwS2DZ dSWODnnG73VNUDabtfGaP7SUckjVlxacAgldVqU885UZBl4JTX/iVJ+aCdFs8lgODi ZT9PUsew2FXqbSW/c17e02MQxPFTycs7afNZj+wuur2ra9gaaU/bhcA0L5YI2NRJwu fBCFZnf9gm4Iw== Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 41C8361D3C for ; Fri, 19 Jan 2024 21:09:12 +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 A31A6378042B; Fri, 19 Jan 2024 20:09:11 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Fri, 19 Jan 2024 15:08:48 -0500 Message-ID: <20240119200848.358298-2-nicolas@ndufresne.ca> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240119200848.358298-1-nicolas@ndufresne.ca> References: <20240119200848.358298-1-nicolas@ndufresne.ca> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] test: gstreamer: Use env instead of registry edit 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 Instead of editing the registry, use gst_env variable provided by the plugin and already used as part of the devenv shell. This reduces the complexity of the C++ test code. Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- New in V2 test/gstreamer/gstreamer_test.cpp | 17 ----------------- test/gstreamer/meson.build | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp index 091f7bf7..e8119b85 100644 --- a/test/gstreamer/gstreamer_test.cpp +++ b/test/gstreamer/gstreamer_test.cpp @@ -51,23 +51,6 @@ GstreamerTest::GstreamerTest(unsigned int numStreams) return; } - /* - * Remove the system libcamera plugin, if any, and add the plugin from - * the build directory. - */ - GstRegistry *registry = gst_registry_get(); - g_autoptr(GstPlugin) plugin = gst_registry_lookup(registry, "libgstlibcamera.so"); - if (plugin) - gst_registry_remove_plugin(registry, plugin); - - std::string path = libcamera::utils::libcameraBuildPath() + "src/gstreamer"; - if (!gst_registry_scan_path(registry, path.c_str())) { - g_printerr("Failed to add plugin to registry\n"); - - status_ = TestFail; - return; - } - /* * Atleast one camera should be available with numStreams streams, * otherwise skip the test entirely. diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build index a5c003b6..f3ba5a23 100644 --- a/test/gstreamer/meson.build +++ b/test/gstreamer/meson.build @@ -17,5 +17,5 @@ foreach test : gstreamer_tests link_with : test_libraries, include_directories : test_includes_internal) - test(test['name'], exe, suite : 'gstreamer', is_parallel : false) + test(test['name'], exe, suite : 'gstreamer', is_parallel : false, env : gst_env) endforeach