diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2022-05-18 19:19:20 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-05-22 12:52:13 +0300 |
commit | 568865a6c14355d74349dea61fee06e09f11dfd7 (patch) | |
tree | d33c7757839e3c627f473be610062efad0af43fd /src/cam/main.cpp | |
parent | 3a91e37bb82a9df0027adc4182fdb012068c7932 (diff) |
cam: Use script parser to set controls
Add a "--script" option to the cam test application to allow specify a
capture script to be used to drive the capture session. Add to the
CameraSession class a script parser instance, created conditionally to
the OptCaptureScript option.
If the script parser has been created, use it at queueRequest time to
retrieve the list of controls that has to be associated with a Request,
and populate Request::controls() with it before queueing it to the
Camera.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/cam/main.cpp')
-rw-r--r-- | src/cam/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp index c7f664b9..9c3370d7 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -158,6 +158,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", + "script", ArgumentRequired, "script", false, + OptCamera); options_ = parser.parse(argc, argv); if (!options_.valid()) |