From patchwork Thu Jul 21 10:30:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16711 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 E1078BE173 for ; Thu, 21 Jul 2022 10:30:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F808603F1; Thu, 21 Jul 2022 12:30:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658399431; bh=gj/4uLSmucRm59rf11/uvkJuaxlh1Btm5tvywjg8UsI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=h4xm/iIueRvTnV3VnyRVwJr1THK/ZWeSr3zKbcr2oquI4841/r2q8cmYVVMDREas9 C6Q3EpzNa3Kq3u/2yLxWHM+EmIR1jTRlpQRNvIOvkQDkJevDDdqncw8v6Pq8O/x1D8 jE7cCAfi7C7rpaf6ogWFyUP2px9Y5H6WLVS36l4pecC4/SZ3xMYu5Eu8SeT70UBE4h 5heIBJdMeTUWqVH+NlAahg1nrKHZiLY9yyzPHx6gBiDz68MPn/v28AVh9B2T/KilxY LggLAhdBAqcV0M/UlkqXvKj7nyBb4dW6rt41SL2ymTA4mjoAZKp+2k9HE+LZ54fTo9 SoJSSCOQnwG/A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 03933601B8 for ; Thu, 21 Jul 2022 12:30:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MhF/caaZ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [IPv6:2401:4900:1f3f:a2d:c6dd:7a7c:3d3c:dbb9]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5D430496; Thu, 21 Jul 2022 12:30:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1658399429; bh=gj/4uLSmucRm59rf11/uvkJuaxlh1Btm5tvywjg8UsI=; h=From:To:Cc:Subject:Date:From; b=MhF/caaZE7jqovVjJS3Skbt1zpnH39R58lsKqs718FPZVkM2pHee4ahTUfcdAmNR6 +5Ylv3kofgYz4gMNw+LovAWyYj+KljUNlz7p+YrQYlKbpbEmo384/hK/4wbpJSnwWF Wlr4VDFqCqllV6nmqR+WmmTQIy1TOoPjBqZhU5XY= To: libcamera-devel@lists.libcamera.org Date: Thu, 21 Jul 2022 16:00:20 +0530 Message-Id: <20220721103020.1066512-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] test: gstreamer_single_stream: Check for cameras before running 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: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Before running or setting up the pipeline, check for cameras availablity first. If no cameras are available, skip the test. Signed-off-by: Umang Jain --- test/gstreamer/gstreamer_single_stream_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp index a0dd12cf..1e0801e8 100644 --- a/test/gstreamer/gstreamer_single_stream_test.cpp +++ b/test/gstreamer/gstreamer_single_stream_test.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include #include "gstreamer_test.h" @@ -29,6 +31,17 @@ protected: if (status_ != TestPass) return status_; + libcamera::CameraManager cm; + cm.start(); + + bool cameraFound = cm.cameras().size() > 1 ? true : false; + if (!cameraFound) { + cm.stop(); + return TestSkip; + } + + cm.stop(); + const gchar *streamDescription = "videoconvert ! fakesink"; g_autoptr(GError) error0 = NULL; stream0_ = gst_parse_bin_from_description_full(streamDescription, TRUE,