cam: capture_script: Make parseRectangles work for non-array
parseRectangles currently always parses Rectangle controls as an array of Rectangles. This causes non-array Rectangle controls to not be parsed correctly, as when the ControlValue is get()ed, the non-array assertion will fail. Set the ControlValue with a single Rectangle in case a single Rectangle has been specified in the yaml capture script to fix that. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
cdb07a0217
commit
01935edbba
1 changed files with 4 additions and 1 deletions
|
@ -351,7 +351,10 @@ ControlValue CaptureScript::parseRectangles()
|
|||
}
|
||||
|
||||
ControlValue controlValue;
|
||||
controlValue.set(Span<const Rectangle>(rectangles));
|
||||
if (rectangles.size() == 1)
|
||||
controlValue.set(rectangles.at(0));
|
||||
else
|
||||
controlValue.set(Span<const Rectangle>(rectangles));
|
||||
|
||||
return controlValue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue