From patchwork Wed Jun 29 07:04:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16407 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 B634FBE173 for ; Wed, 29 Jun 2022 07:04:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 961A665636; Wed, 29 Jun 2022 09:04:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656486283; bh=kAL85UrCX4ZS6H5jh0S4WDQbWuTWODAQW0q+OmJ+1ng=; 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=s5oFWW9wJcV7M+Xa+WosaofnRNWibP+EmSxmnqP63YdSqNBu0zROTjkT8CJdUe+CN /hEvhaVIFi7UeeMWTVmrE5xRB5ppEkL8m1GRkcJtL7EHGrI6G/GWdjSx2n20dK70yw sSZMZa0g5kty9vPPjdWPGTqfDdZJNUzgxgcHE2kHc5KuIinSs/tnOFH6Sahr5xz0Og b6bSbvkOKrmsHXbUOOLMEP7nFzNw8QKSKHFuCwGdyHNTHjhnBz46cyXQkDzvbyf+MS zq+YBpj3oIZUcOcHeg/DSHRImFALF75UOhpt0j7yDy4w4kn2vxTd6SiQH7VTQh0IjT vgJqak6LA876g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9A46F65631 for ; Wed, 29 Jun 2022 09:04:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Wq+zs6lX"; 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 E2FDB6D1; Wed, 29 Jun 2022 09:04:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1656486280; bh=kAL85UrCX4ZS6H5jh0S4WDQbWuTWODAQW0q+OmJ+1ng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wq+zs6lXsW7fgOhcjWCKrn9opX6NDsUu/IFwlfGP3Ltf1tyEn6pw/xkYUJc3zR5sY 3I84rojbEiRd/m5Ai+enYq4yADbtinRzC8+8oayrWT86hEZe+YMM4YmZ89eK2er2Gi k1oRXA+hHZZY7c0jJWcMSwJuvt/9lbpe4QRFpbYM= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Wed, 29 Jun 2022 10:04:03 +0300 Message-Id: <20220629070416.17550-2-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220629070416.17550-1-tomi.valkeinen@ideasonboard.com> References: <20220629070416.17550-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 01/14] 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py index 2ae89fa8..8a82e092 100755 --- a/src/py/cam/cam.py +++ b/src/py/cam/cam.py @@ -434,7 +434,10 @@ def main(): if args.info: ctx.do_cmd_info() - if args.capture: + # Filter out capture contexts which are not marked for capture + contexts = [ctx for ctx in contexts if ctx.opt_capture > 0] + + if contexts: state = CaptureState(cm, contexts) if args.renderer == 'null':