cam: capture_script: Introduce 'loop' property

Add support to the capture script for properties that control the script
execution. Script properties are specified in the 'properties' section
before the actual list of controls specified in the 'frames' section.

Define a first 'loop' property that allows repeating the frame list
periodically. All the frame ids in the 'frames' section shall be smaller
than the loop control.

Modify the capture script example to show usage of the 'loop' property
and better document the frames list while at it.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jacopo Mondi 2022-09-02 16:54:43 +02:00
parent 74ab3f778c
commit cf5d0cbb34
3 changed files with 107 additions and 5 deletions

View file

@ -40,6 +40,7 @@ private:
std::map<unsigned int, libcamera::ControlList> frameControls_;
std::shared_ptr<libcamera::Camera> camera_;
yaml_parser_t parser_;
unsigned int loop_;
bool valid_;
EventPtr nextEvent(yaml_event_type_t expectedType = YAML_NO_EVENT);
@ -49,6 +50,8 @@ private:
int parseScript(FILE *script);
int parseProperties();
int parseProperty();
int parseFrames();
int parseFrame(EventPtr event);
int parseControl(EventPtr event, libcamera::ControlList &controls);