From patchwork Wed May 7 21:06:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 23349 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 30F23C3200 for ; Wed, 7 May 2025 21:07:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 52A9F68B40; Wed, 7 May 2025 23:07:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W9xNm4nc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A328268B3F for ; Wed, 7 May 2025 23:07:41 +0200 (CEST) Received: from charm.lan (unknown [IPv6:2001:861:3a80:3300:485e:25b2:e7f9:296e]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E2A89C59; Wed, 7 May 2025 23:07:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1746652050; bh=5KxmEQb2ZXNOosmJSYfWbcPnrvv16s52boimzKbN/b0=; h=From:To:Cc:Subject:Date:From; b=W9xNm4ncqPdZYjsbPTn6PwwL+GNjeom/yFnEsylVld84G8IvtI1+0ZUf+M7vEr6Qc QkSb3w2CEY6OJLxFStdNItd9k39C2CsOFTecrvBOnZQ29se+sZzRoCSuAgAxCuZtHg eN9USD+cr4FjlRYizghHjaOGP4pOXlaLRr3eAij0= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH] apps: qcam: Push the viewfinder role to vector Date: Wed, 7 May 2025 23:06:48 +0200 Message-ID: <20250507210648.83184-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" In commit ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails"), the viewfinder role is specified as the default if no role is yet chosen. This was unfortunately added by directly accessing the vector rather than extending the size when the vector is empty. Fix the code to push the default viewfinder role on to the back of the vector, increasing the size appropriately. Fixes: ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails") Signed-off-by: Kieran Bingham Reviewed-by: Barnabás Pőcze Tested-by: Barnabás Pőcze Reviewed-by: Paul Elder --- src/apps/qcam/main_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index 224a7e5a693a..7e3f3da605c4 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -357,7 +357,7 @@ int MainWindow::startCapture() /* Verify roles are supported. */ switch (roles.size()) { case 0: - roles[0] = StreamRole::Viewfinder; + roles.push_back(StreamRole::Viewfinder); break; case 1: if (roles[0] != StreamRole::Viewfinder) {