[{"id":34160,"web_url":"https://patchwork.libcamera.org/comment/34160/","msgid":"<5a75509f-46d0-493f-8ff7-5c52336729ab@ideasonboard.com>","date":"2025-05-08T07:43:35","subject":"Re: [PATCH] apps: qcam: Push the viewfinder role to vector","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 05. 07. 23:06 keltezéssel, Kieran Bingham írta:\n> In commit ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder\n> role fails\"), the viewfinder role is specified as the default if no role\n> is yet chosen.\n> \n> This was unfortunately added by directly accessing the vector rather\n> than extending the size when the vector is empty. Fix the code to push\n> the default viewfinder role on to the back of the vector, increasing the\n> size appropriately.\n> \n> Fixes: ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder role fails\")\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nTested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n> ---\n>   src/apps/qcam/main_window.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index 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) {","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 34E92C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 May 2025 07:43:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4D2F468B41;\n\tThu,  8 May 2025 09:43:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA9F5617C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 May 2025 09:43:39 +0200 (CEST)","from [192.168.33.16] (185.221.141.56.nat.pool.zt.hu\n\t[185.221.141.56])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 982989EC;\n\tThu,  8 May 2025 09:43:27 +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=\"uvGtea50\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746690207;\n\tbh=fS+VSBBaBqxHwwPS4oJPYoXqikZMbmaCSr0xbxAvSYY=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=uvGtea50W8lm2OZTs33UsaHrTwkIR+UMeOiOBS5ACJvd+YuwDJoNd98dqEyQjXET8\n\tBDex4fs+n2e2O1yk3G4ZvSBnECm18Yqh4n8zpmO0GBhWIDWOnHP2WW2wOlWWUyzM1u\n\tdwUKx3CQRDvZCeqvMHKcEaknS3lOlPBH+Lzpec2M=","Message-ID":"<5a75509f-46d0-493f-8ff7-5c52336729ab@ideasonboard.com>","Date":"Thu, 8 May 2025 09:43:35 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] apps: qcam: Push the viewfinder role to vector","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","References":"<20250507210648.83184-1-kieran.bingham@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250507210648.83184-1-kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":34161,"web_url":"https://patchwork.libcamera.org/comment/34161/","msgid":"<aBxlL6_cRkINWLBq@pyrite.rasen.tech>","date":"2025-05-08T08:02:55","subject":"Re: [PATCH] apps: qcam: Push the viewfinder role to vector","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Wed, May 07, 2025 at 11:06:48PM +0200, Kieran Bingham wrote:\n> In commit ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder\n> role fails\"), the viewfinder role is specified as the default if no role\n> is yet chosen.\n> \n> This was unfortunately added by directly accessing the vector rather\n> than extending the size when the vector is empty. Fix the code to push\n> the default viewfinder role on to the back of the vector, increasing the\n> size appropriately.\n> \n> Fixes: ee2b011b65c6 (\"apps: cam: Try raw role if default viewfinder role fails\")\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/apps/qcam/main_window.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index 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> -- \n> 2.49.0\n>","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 15C69C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 May 2025 08:03:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2899668B45;\n\tThu,  8 May 2025 10:03:01 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 91881617C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 May 2025 10:02:59 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2001:861:3a80:3300:4f2f:8c2c:b3ef:17d4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 78A5B446;\n\tThu,  8 May 2025 10:02:47 +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=\"LzNgOb61\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746691367;\n\tbh=xbFhRtq3mJBiyQB1alCNakb/mSOnit/cJEcchqTJQd0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LzNgOb616NVdJvDKpUAIS1+gF53vGlXqZuqMNEdp/r8sz3uhuMc4X8g6qEickL3fK\n\tEkSR0ZfzUQgEPZVu++BQAVqeOjHLaBm+xHIPIgV6tCwT7BAvm5Rv0DFOwnN/vIOIdh\n\tJslHKEutSOPNT+uU9deON6/sN1AZ/4BQqsRxme4M=","Date":"Thu, 8 May 2025 10:02:55 +0200","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Subject":"Re: [PATCH] apps: qcam: Push the viewfinder role to vector","Message-ID":"<aBxlL6_cRkINWLBq@pyrite.rasen.tech>","References":"<20250507210648.83184-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20250507210648.83184-1-kieran.bingham@ideasonboard.com>","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>"}}]