diff options
-rw-r--r-- | include/libcamera/controls.h | 4 | ||||
-rw-r--r-- | src/libcamera/controls.cpp | 13 | ||||
-rw-r--r-- | src/libcamera/pipeline/uvcvideo.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/vimc.cpp | 2 | ||||
-rw-r--r-- | test/controls/control_info.cpp | 18 |
5 files changed, 8 insertions, 31 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index d4a74ada..854ea3b8 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -98,17 +98,15 @@ private: class ControlInfo { public: - explicit ControlInfo(const ControlId &id, const ControlValue &min = 0, + explicit ControlInfo(const ControlValue &min = 0, const ControlValue &max = 0); - const ControlId &id() const { return id_; } const ControlValue &min() const { return min_; } const ControlValue &max() const { return max_; } std::string toString() const; private: - const ControlId &id_; ControlValue min_; ControlValue max_; }; diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 5e8b3a9b..526b7755 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -323,23 +323,16 @@ Control<int64_t>::Control(unsigned int id, const char *name) /** * \brief Construct a ControlInfo with minimum and maximum range parameters - * \param[in] id The control ID * \param[in] min The control minimum value * \param[in] max The control maximum value */ -ControlInfo::ControlInfo(const ControlId &id, const ControlValue &min, +ControlInfo::ControlInfo(const ControlValue &min, const ControlValue &max) - : id_(id), min_(min), max_(max) + : min_(min), max_(max) { } /** - * \fn ControlInfo::id() - * \brief Retrieve the control ID - * \return The control ID - */ - -/** * \fn ControlInfo::min() * \brief Retrieve the minimum value of the control * \return A ControlValue with the minimum value for the control @@ -358,7 +351,7 @@ std::string ControlInfo::toString() const { std::stringstream ss; - ss << id_.name() << "[" << min_.toString() << ".." << max_.toString() << "]"; + ss << "[" << min_.toString() << ".." << max_.toString() << "]"; return ss.str(); } diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index d5d30932..2ac582d7 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -364,7 +364,7 @@ int UVCCameraData::init(MediaEntity *entity) controlInfo_.emplace(std::piecewise_construct, std::forward_as_tuple(id), - std::forward_as_tuple(*id, info.min(), info.max())); + std::forward_as_tuple(info.min(), info.max())); } return 0; diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index 608a47ae..ec9c1cd2 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -437,7 +437,7 @@ int VimcCameraData::init(MediaDevice *media) controlInfo_.emplace(std::piecewise_construct, std::forward_as_tuple(id), - std::forward_as_tuple(*id, info.min(), info.max())); + std::forward_as_tuple(info.min(), info.max())); } return 0; diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp index dbc43df8..9cf59185 100644 --- a/test/controls/control_info.cpp +++ b/test/controls/control_info.cpp @@ -24,14 +24,7 @@ protected: * Test information retrieval from a control with no minimum * and maximum. */ - ControlInfo brightness(controls::Brightness); - - if (brightness.id() != controls::Brightness || - brightness.id().type() != ControlTypeInteger32 || - brightness.id().name() != std::string("Brightness")) { - cout << "Invalid control identification for Brightness" << endl; - return TestFail; - } + ControlInfo brightness; if (brightness.min().get<int32_t>() != 0 || brightness.max().get<int32_t>() != 0) { @@ -43,14 +36,7 @@ protected: * Test information retrieval from a control with a minimum and * a maximum value. */ - ControlInfo contrast(controls::Contrast, 10, 200); - - if (contrast.id() != controls::Contrast || - contrast.id().type() != ControlTypeInteger32 || - contrast.id().name() != std::string("Contrast")) { - cout << "Invalid control identification for Contrast" << endl; - return TestFail; - } + ControlInfo contrast(10, 200); if (contrast.min().get<int32_t>() != 10 || contrast.max().get<int32_t>() != 200) { |