[libcamera-devel,4/5] cam: Add a --script option
diff mbox series

Message ID 20220518171921.244168-5-jacopo@jmondi.org
State Superseded, archived
Headers show
Series
  • cam: Add support for capture scripts
Related show

Commit Message

Jacopo Mondi May 18, 2022, 5:19 p.m. UTC
Add a "--script" option to the cam test application to allow specify a
capture script to be used to drive the capture session.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/cam/main.cpp | 4 ++++
 src/cam/main.h   | 1 +
 2 files changed, 5 insertions(+)

Comments

Laurent Pinchart May 20, 2022, 10:24 a.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Wed, May 18, 2022 at 07:19:20PM +0200, Jacopo Mondi via libcamera-devel wrote:
> Add a "--script" option to the cam test application to allow specify a
> capture script to be used to drive the capture session.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/cam/main.cpp | 4 ++++
>  src/cam/main.h   | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/src/cam/main.cpp b/src/cam/main.cpp
> index fd3108b05d25..3428075c03dd 100644
> --- a/src/cam/main.cpp
> +++ b/src/cam/main.cpp
> @@ -162,6 +162,10 @@ int CamApp::parseOptions(int argc, char *argv[])
>  			 "Print the metadata for completed requests",
>  			 "metadata", ArgumentNone, nullptr, false,
>  			 OptCamera);
> +	parser.addOption(OptCaptureScript, OptionString,
> +			 "Load a capture session configuration script from a file\n",

Stray \n.

I'd squash this with 5/5.

> +			 "script", ArgumentRequired, "script", false,
> +			 OptCamera);
>  
>  	options_ = parser.parse(argc, argv);
>  	if (!options_.valid())
> diff --git a/src/cam/main.h b/src/cam/main.h
> index 2b2858084bb1..5ec20e1496eb 100644
> --- a/src/cam/main.h
> +++ b/src/cam/main.h
> @@ -22,4 +22,5 @@ enum {
>  	OptListControls = 256,
>  	OptStrictFormats = 257,
>  	OptMetadata = 258,
> +	OptCaptureScript = 259,
>  };

Patch
diff mbox series

diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index fd3108b05d25..3428075c03dd 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -162,6 +162,10 @@  int CamApp::parseOptions(int argc, char *argv[])
 			 "Print the metadata for completed requests",
 			 "metadata", ArgumentNone, nullptr, false,
 			 OptCamera);
+	parser.addOption(OptCaptureScript, OptionString,
+			 "Load a capture session configuration script from a file\n",
+			 "script", ArgumentRequired, "script", false,
+			 OptCamera);
 
 	options_ = parser.parse(argc, argv);
 	if (!options_.valid())
diff --git a/src/cam/main.h b/src/cam/main.h
index 2b2858084bb1..5ec20e1496eb 100644
--- a/src/cam/main.h
+++ b/src/cam/main.h
@@ -22,4 +22,5 @@  enum {
 	OptListControls = 256,
 	OptStrictFormats = 257,
 	OptMetadata = 258,
+	OptCaptureScript = 259,
 };