{"id":23349,"url":"https://patchwork.libcamera.org/api/patches/23349/?format=json","web_url":"https://patchwork.libcamera.org/patch/23349/","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":"<20250507210648.83184-1-kieran.bingham@ideasonboard.com>","date":"2025-05-07T21:06:48","name":"apps: qcam: Push the viewfinder role to vector","commit_ref":"a79941501716eb65e6d905d2430bddf48887f3f5","pull_url":null,"state":"accepted","archived":false,"hash":"ced6afd40aec10fc96c7877795d054407ac8d564","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23349/mbox/","series":[{"id":5166,"url":"https://patchwork.libcamera.org/api/series/5166/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5166","date":"2025-05-07T21:06:48","name":"apps: qcam: Push the viewfinder role to vector","version":1,"mbox":"https://patchwork.libcamera.org/series/5166/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23349/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23349/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 30F23C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 May 2025 21:07:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 52A9F68B40;\n\tWed,  7 May 2025 23:07:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A328268B3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 May 2025 23:07:41 +0200 (CEST)","from charm.lan (unknown\n\t[IPv6:2001:861:3a80:3300:485e:25b2:e7f9:296e])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E2A89C59;\n\tWed,  7 May 2025 23:07:29 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"W9xNm4nc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746652050;\n\tbh=5KxmEQb2ZXNOosmJSYfWbcPnrvv16s52boimzKbN/b0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=W9xNm4ncqPdZYjsbPTn6PwwL+GNjeom/yFnEsylVld84G8IvtI1+0ZUf+M7vEr6Qc\n\tQkSb3w2CEY6OJLxFStdNItd9k39C2CsOFTecrvBOnZQ29se+sZzRoCSuAgAxCuZtHg\n\teN9USD+cr4FjlRYizghHjaOGP4pOXlaLRr3eAij0=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","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","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":"In commit ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder\nrole fails\"), the viewfinder role is specified as the default if no role\nis yet chosen.\n\nThis was unfortunately added by directly accessing the vector rather\nthan extending the size when the vector is empty. Fix the code to push\nthe default viewfinder role on to the back of the vector, increasing the\nsize appropriately.\n\nFixes: ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder role fails\")\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/apps/qcam/main_window.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\nindex 224a7e5a693a..7e3f3da605c4 100644\n--- a/src/apps/qcam/main_window.cpp\n+++ b/src/apps/qcam/main_window.cpp\n@@ -357,7 +357,7 @@ int MainWindow::startCapture()\n \t/* Verify roles are supported. */\n \tswitch (roles.size()) {\n \tcase 0:\n-\t\troles[0] = StreamRole::Viewfinder;\n+\t\troles.push_back(StreamRole::Viewfinder);\n \t\tbreak;\n \tcase 1:\n \t\tif (roles[0] != StreamRole::Viewfinder) {\n","prefixes":[]}