From patchwork Thu Jun 23 14:47:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16339 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 93E75BD808 for ; Thu, 23 Jun 2022 14:48:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2F40965636; Thu, 23 Jun 2022 16:48:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655995682; bh=OK+Gtkm8vVSc70bwKYeTSCzxUdJjJrN89szkRE52YsM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VFptnshIQC8aiPtiw3ndPLpq3tE0SGjiC4rCPkLjAJkikKIA8v841Ku90s1UM6MYG 0f9R3lk47YLikHfnNQNgKoFsm1QSEyJnXg+KpG+bfGQWznSZv8ur1K+3kOkHjOnahM pGrEFLyIcr3kY0AM6T9PnivDzxcjBwaFbdgpv3Wc6Ki+OvpuKJCgp4bAdPW1RjXHpO N7dcRKdnGiEVLtG8E6mJBsxBXf8XZYoB+dZa5GOj8Ge+qxgX0i4FqTnO1xqe943Ftt EWl7Lr4nxXWyEKbTKRQNyeX3u+WyAvIXTzLRiYMYya+J2JdpFQwJFPtoBxEscH2dqH fA65EBRy+esTw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2EDB56048F for ; Thu, 23 Jun 2022 16:47:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="o5s79w2j"; dkim-atps=neutral Received: from deskari.lan (91-158-154-79.elisa-laajakaista.fi [91.158.154.79]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 577B06BB; Thu, 23 Jun 2022 16:47:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655995677; bh=OK+Gtkm8vVSc70bwKYeTSCzxUdJjJrN89szkRE52YsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o5s79w2jQwgFDqol4AARzU6kbbTYN/lrcdMFTgXteMfHmL9/ltDKlYr0LeR9WFMtN ked7jMDXtsjj+xlKrcMTGrwtiltH1IwG08bZRa7sxI2B4aDomu/fBH9bULEdhxv4jG ILtEBaSBZhofhVJWOElZo9/x2Sz6rat9Siw9eNqI= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Thu, 23 Jun 2022 17:47:30 +0300 Message-Id: <20220623144736.78537-2-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220623144736.78537-1-tomi.valkeinen@ideasonboard.com> References: <20220623144736.78537-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera capture without -C 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: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" -C flag is supposed to affect only the camera that was previously defined in the arguments. That's not the case, and, e.g.: cam.py -c2 -C -c3 causes camera 3 to start capturing, but it stops after the initial Requests have been completed. Fix the issue by filtering out camera contexts that do not have -C defined. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/py/cam/cam.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py index 2ae89fa8..733e9ae5 100755 --- a/src/py/cam/cam.py +++ b/src/py/cam/cam.py @@ -434,6 +434,8 @@ def main(): if args.info: ctx.do_cmd_info() + contexts = [ctx for ctx in contexts if ctx.opt_capture > 0] + if args.capture: state = CaptureState(cm, contexts)