summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/controls.h13
-rw-r--r--include/libcamera/internal/control_serializer.h1
-rw-r--r--include/libcamera/internal/v4l2_device.h1
-rw-r--r--include/libcamera/ipa/raspberrypi.h40
4 files changed, 28 insertions, 27 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index de733bd8..9b0d5a54 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -309,12 +309,11 @@ public:
ControlInfoMap() = default;
ControlInfoMap(const ControlInfoMap &other) = default;
- ControlInfoMap(std::initializer_list<Map::value_type> init);
- ControlInfoMap(Map &&info);
+ ControlInfoMap(std::initializer_list<Map::value_type> init,
+ const ControlIdMap &idmap);
+ ControlInfoMap(Map &&info, const ControlIdMap &idmap);
ControlInfoMap &operator=(const ControlInfoMap &other) = default;
- ControlInfoMap &operator=(std::initializer_list<Map::value_type> init);
- ControlInfoMap &operator=(Map &&info);
using Map::key_type;
using Map::mapped_type;
@@ -339,12 +338,12 @@ public:
iterator find(unsigned int key);
const_iterator find(unsigned int key) const;
- const ControlIdMap &idmap() const { return idmap_; }
+ const ControlIdMap &idmap() const { return *idmap_; }
private:
- void generateIdmap();
+ bool validate();
- ControlIdMap idmap_;
+ const ControlIdMap *idmap_;
};
class ControlList
diff --git a/include/libcamera/internal/control_serializer.h b/include/libcamera/internal/control_serializer.h
index 7d4426c9..8a66be32 100644
--- a/include/libcamera/internal/control_serializer.h
+++ b/include/libcamera/internal/control_serializer.h
@@ -48,6 +48,7 @@ private:
unsigned int serial_;
std::vector<std::unique_ptr<ControlId>> controlIds_;
+ std::vector<std::unique_ptr<ControlIdMap>> controlIdMaps_;
std::map<unsigned int, ControlInfoMap> infoMaps_;
std::map<const ControlInfoMap *, unsigned int> infoMapHandles_;
};
diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h
index 77b835b3..423c8fb1 100644
--- a/include/libcamera/internal/v4l2_device.h
+++ b/include/libcamera/internal/v4l2_device.h
@@ -69,6 +69,7 @@ private:
std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_;
std::vector<std::unique_ptr<ControlId>> controlIds_;
+ ControlIdMap controlIdMap_;
ControlInfoMap controls_;
std::string deviceNode_;
int fd_;
diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h
index a8790000..521eaecd 100644
--- a/include/libcamera/ipa/raspberrypi.h
+++ b/include/libcamera/ipa/raspberrypi.h
@@ -27,26 +27,26 @@ namespace RPi {
* and the pipeline handler may be reverted so that it aborts when an
* unsupported control is encountered.
*/
-static const ControlInfoMap Controls = {
- { &controls::AeEnable, ControlInfo(false, true) },
- { &controls::ExposureTime, ControlInfo(0, 999999) },
- { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },
- { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },
- { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },
- { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },
- { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },
- { &controls::AwbEnable, ControlInfo(false, true) },
- { &controls::ColourGains, ControlInfo(0.0f, 32.0f) },
- { &controls::AwbMode, ControlInfo(controls::AwbModeValues) },
- { &controls::Brightness, ControlInfo(-1.0f, 1.0f) },
- { &controls::Contrast, ControlInfo(0.0f, 32.0f) },
- { &controls::Saturation, ControlInfo(0.0f, 32.0f) },
- { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
- { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
- { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
- { &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
- { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
-};
+static const ControlInfoMap Controls({
+ { &controls::AeEnable, ControlInfo(false, true) },
+ { &controls::ExposureTime, ControlInfo(0, 999999) },
+ { &controls::AnalogueGain, ControlInfo(1.0f, 32.0f) },
+ { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) },
+ { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },
+ { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },
+ { &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },
+ { &controls::AwbEnable, ControlInfo(false, true) },
+ { &controls::ColourGains, ControlInfo(0.0f, 32.0f) },
+ { &controls::AwbMode, ControlInfo(controls::AwbModeValues) },
+ { &controls::Brightness, ControlInfo(-1.0f, 1.0f) },
+ { &controls::Contrast, ControlInfo(0.0f, 32.0f) },
+ { &controls::Saturation, ControlInfo(0.0f, 32.0f) },
+ { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },
+ { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
+ { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
+ { &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
+ { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }
+ }, controls::controls);
} /* namespace RPi */