{"id":21680,"url":"https://patchwork.libcamera.org/api/patches/21680/?format=json","web_url":"https://patchwork.libcamera.org/patch/21680/","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":"<20241018142916.23578-1-stanislaw.gruszka@linux.intel.com>","date":"2024-10-18T14:29:16","name":"qcam: Automatically select the camera if only one is available","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"77c4fc09f32cb9e26af3e03f4114e13aeb87e308","submitter":{"id":211,"url":"https://patchwork.libcamera.org/api/people/211/?format=json","name":"Stanislaw Gruszka","email":"stanislaw.gruszka@linux.intel.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21680/mbox/","series":[{"id":4719,"url":"https://patchwork.libcamera.org/api/series/4719/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4719","date":"2024-10-18T14:29:16","name":"qcam: Automatically select the camera if only one is available","version":1,"mbox":"https://patchwork.libcamera.org/series/4719/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21680/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21680/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 8EAAEC32AF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Oct 2024 14:29:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3D3E76538F;\n\tFri, 18 Oct 2024 16:29:24 +0200 (CEST)","from mgamail.intel.com (mgamail.intel.com [198.175.65.19])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AD2C4633C6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Oct 2024 16:29:21 +0200 (CEST)","from fmviesa006.fm.intel.com ([10.60.135.146])\n\tby orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n\t18 Oct 2024 07:29:20 -0700","from sgruszka-mobl.ger.corp.intel.com (HELO localhost)\n\t([10.245.97.183]) by fmviesa006-auth.fm.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 07:29:19 -0700"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"eKk5oI6Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n\tt=1729261762; x=1760797762;\n\th=from:to:subject:date:message-id:mime-version:\n\tcontent-transfer-encoding;\n\tbh=7gcaP2kB6ASTteaXOjfxNAhsaQW93aP55/00mYA5qE8=;\n\tb=eKk5oI6Y1Y1ISRRkPSHExrweDwkJDLXAMYTIyffoS+xKXbI0sCmlvs1w\n\t63mBt25f9XzXlSGZxJm9ymKFgr9Ef9xmSKi9v1eJMMSiorVRhmtzxLrh5\n\txY3qlWLug6bBEnz3g4vaWFEmBW1Ga7fqvbqHKNC8r3dXHkWqu7xvmKMMS\n\tfP3CT0u/e05iORWnmBME7J9jDcC4prDk8zoOXb7IhptIjuW+dXbBsSEd+\n\tk6DU8hta3vdCzPduKLagCN57CNaRzMnaUhXPHFIWzWWCvTWgf1Q4XHLmU\n\thmflVMjYsWsMFNozFsn2eUNYJ3876BqLfk6t+y3+vuGk9wViwR8WDtQ7y g==;","X-CSE-ConnectionGUID":["d94sV7S7S/ODkLp0KBnqnA==","M42xN+jHRkWTuF+/xeDqUg=="],"X-CSE-MsgGUID":["r6kVIHuCRpOtaCi/inIWJQ==","pmV2/gG6Q3OTJoHIcJSBxA=="],"X-IronPort-AV":["E=McAfee;i=\"6700,10204,11222\"; a=\"28674546\"","E=Sophos;i=\"6.11,199,1725346800\"; d=\"scan'208\";a=\"28674546\"","E=Sophos;i=\"6.11,213,1725346800\"; d=\"scan'208\";a=\"78480920\""],"X-ExtLoop1":"1","From":"Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH] qcam: Automatically select the camera if only one is\n\tavailable","Date":"Fri, 18 Oct 2024 16:29:16 +0200","Message-Id":"<20241018142916.23578-1-stanislaw.gruszka@linux.intel.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"When only a single camera is available, showing the camera selection\ndialog is unnecessary. It's better to automatically select the available\ncamera without prompting the user for input.\n\nSigned-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>\n---\n src/apps/qcam/main_window.cpp | 2 ++\n 1 file changed, 2 insertions(+)","diff":"diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\nindex 5144c6b3..b0dfd850 100644\n--- a/src/apps/qcam/main_window.cpp\n+++ b/src/apps/qcam/main_window.cpp\n@@ -303,6 +303,8 @@ int MainWindow::openCamera()\n \t */\n \tif (options_.isSet(OptCamera))\n \t\tcameraName = static_cast<std::string>(options_[OptCamera]);\n+\telse if (cm_->cameras().size() == 1)\n+\t\tcameraName = cm_->cameras()[0]->id();\n \telse\n \t\tcameraName = chooseCamera();\n \n","prefixes":[]}