libcamera: global_configuration: Drop Option type
The GlobalConfiguration::Option type was introduced to decouple the configuration option storage from its users, and make changes to the underlying implementation easier. While the type could indeed be changed to map to a different class, the API would need to remain the same. The Option type therefore brings little value. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
@@ -55,14 +55,6 @@ LOG_DEFINE_CATEGORY(Configuration)
|
||||
* options, or configuration() to access the whole configuration.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \typedef GlobalConfiguration::Option
|
||||
* \brief Type representing a configuration option
|
||||
*
|
||||
* All code outside GlobalConfiguration must use this type declaration and not
|
||||
* the underlying type.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Initialize the global configuration
|
||||
*/
|
||||
@@ -153,12 +145,9 @@ unsigned int GlobalConfiguration::version() const
|
||||
* The requested part of the configuration can be accessed using \a ValueNode
|
||||
* methods.
|
||||
*
|
||||
* \note \a ValueNode type itself shouldn't be used in type declarations to
|
||||
* avoid trouble if we decide to change the underlying data objects in future.
|
||||
*
|
||||
* \return The top-level configuration option
|
||||
* \return The global configuration
|
||||
*/
|
||||
GlobalConfiguration::Option GlobalConfiguration::configuration() const
|
||||
const ValueNode &GlobalConfiguration::configuration() const
|
||||
{
|
||||
return (*configuration_)["configuration"];
|
||||
}
|
||||
|
||||
@@ -1880,7 +1880,7 @@ bool SimplePipelineHandler::matchDevice(std::shared_ptr<MediaDevice> media,
|
||||
|
||||
swIspEnabled_ = info.swIspEnabled;
|
||||
const GlobalConfiguration &configuration = cameraManager()->_d()->configuration();
|
||||
for (GlobalConfiguration::Option entry :
|
||||
for (const ValueNode &entry :
|
||||
configuration.configuration()["pipelines"]["simple"]["supported_devices"]
|
||||
.asList()) {
|
||||
auto name = entry["driver"].get<std::string>();
|
||||
|
||||
Reference in New Issue
Block a user