summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/controller.h
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-07-18 09:15:59 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-28 13:47:51 +0300
commit2ef6eafb6f4efc8a9ae7381253c7121d488d123d (patch)
treec2ef147494201d2689a63dcbfa293e2ab0ee5c05 /src/ipa/raspberrypi/controller/controller.h
parentc1597f989654618f782012104f547b367082fa3e (diff)
ipa: raspberrypi: Introduce version 2.0 format for the camera tuning file
The existing tuning file format (version 1.0) requires the controller algorithms to run in the same order as listed in the JSON structure. The JSON specification does not mandate any such ordering, but the Boost JSON parser would maintain this order. In order to remove this reliance on the parser to provide ordering, introduce a new version 2.0 format for the camera tuning file. In this version, the algorithms are specified in a top level list node ("algorithms"), which does require strict ordering of the elements. A "version" node is added to distinguish between the version 1.0 and 2.0 formats. The absence of the "version" node implies version 1.0. A "target" node is also added to specify the target platform for this configuration. Update the controller to support either version of the tuning file by looking at the version node. CreateAlgorithm member function to now load and configure each algorithm. Additionally, make CreateAlgorithm a private member, it does not get called externally. If a version 1.0 format tuning file is used, throw a warning message indicating it will be soon deprecated. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/controller.h')
-rw-r--r--src/ipa/raspberrypi/controller/controller.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipa/raspberrypi/controller/controller.h b/src/ipa/raspberrypi/controller/controller.h
index 841783bb..6be1e3cf 100644
--- a/src/ipa/raspberrypi/controller/controller.h
+++ b/src/ipa/raspberrypi/controller/controller.h
@@ -17,6 +17,8 @@
#include <linux/bcm2835-isp.h>
+#include "libcamera/internal/yaml_parser.h"
+
#include "camera_mode.h"
#include "device_status.h"
#include "metadata.h"
@@ -40,7 +42,6 @@ public:
Controller();
Controller(char const *jsonFilename);
~Controller();
- Algorithm *createAlgorithm(char const *name);
int read(char const *filename);
void initialise();
void switchMode(CameraMode const &cameraMode, Metadata *metadata);
@@ -50,6 +51,8 @@ public:
Algorithm *getAlgorithm(std::string const &name) const;
protected:
+ int createAlgorithm(const std::string &name, const libcamera::YamlObject &params);
+
Metadata globalMetadata_;
std::vector<AlgorithmPtr> algorithms_;
bool switchModeCalled_;