[libcamera-devel] [RFC v1 1/7] py: cam.py: Fix multi camera capture without -C

Tomi Valkeinen tomi.valkeinen at ideasonboard.com
Thu Jun 23 16:47:30 CEST 2022


-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 <tomi.valkeinen at ideasonboard.com>
---
 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)
 
-- 
2.34.1



More information about the libcamera-devel mailing list