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>
This commit is contained in:
Jacopo Mondi
2022-05-18 19:19:20 +02:00
committed by Laurent Pinchart
parent 3a91e37bb8
commit 568865a6c1
4 changed files with 22 additions and 0 deletions
+3
View File
@@ -23,6 +23,7 @@
#include "options.h"
class CaptureScript;
class FrameSink;
class CameraSession
@@ -60,6 +61,8 @@ private:
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;
std::unique_ptr<CaptureScript> script_;
std::map<const libcamera::Stream *, std::string> streamNames_;
std::unique_ptr<FrameSink> sink_;
unsigned int cameraIndex_;