From 30e0ea843eb96a93f8282466e3a328fdda7fafdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 24 Jul 2020 15:24:39 +0200 Subject: cam: Add optional argument to --capture to specify how many frames to capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the '--capture' option with and optional numerical argument to be able to specify how many frames to capture before exiting. If the optional argument is not provided the old behavior of running until the user interrupts with a SIGINT is retained. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cam/main.cpp') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 3e83feab..f5aba041 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -167,8 +167,9 @@ int CamApp::parseOptions(int argc, char *argv[]) parser.addOption(OptCamera, OptionString, "Specify which camera to operate on, by name or by index", "camera", ArgumentRequired, "camera"); - parser.addOption(OptCapture, OptionNone, - "Capture until interrupted by user", "capture"); + parser.addOption(OptCapture, OptionInteger, + "Capture until interrupted by user or until frames captured", + "capture", ArgumentOptional, "count"); parser.addOption(OptFile, OptionString, "Write captured frames to disk\n" "The first '#' character in the file name is expanded to the stream name and frame sequence number.\n" -- cgit v1.2.1