[{"id":37616,"web_url":"https://patchwork.libcamera.org/comment/37616/","msgid":"<916baf72-e6b1-44fb-a42b-8c5c553f84aa@ideasonboard.com>","date":"2026-01-13T16:21:52","subject":"Re: [PATCH 11/36] libcamera: yaml_parser: Replace getList() with\n\tget() specializations","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 13. 1:07 keltezéssel, Laurent Pinchart írta:\n> The YamlObject class has two member function templates to get values:\n> the get() function gets a scalar value, while the getList() function\n> gets a vector of scalar values.\n> \n> As get() is a function template, we can provide specializations for\n> vector types. This makes the code more systematic, and therefore more\n> readable. Replace all getList() occurrences, and drop the getList()\n> function.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>   include/libcamera/internal/yaml_parser.h      |  19 ----\n>   src/ipa/libipa/agc_mean_luminance.cpp         |   4 +-\n>   src/ipa/libipa/awb_bayes.cpp                  |   4 +-\n>   src/ipa/mali-c55/algorithms/lsc.cpp           |   6 +-\n>   src/ipa/rkisp1/algorithms/agc.cpp             |   2 +-\n>   src/ipa/rkisp1/algorithms/dpf.cpp             |   6 +-\n>   src/ipa/rkisp1/algorithms/gsl.cpp             |   8 +-\n>   src/ipa/rkisp1/algorithms/lsc.cpp             |   4 +-\n>   src/ipa/rpi/controller/rpi/agc_channel.cpp    |   4 +-\n>   src/ipa/rpi/controller/rpi/hdr.cpp            |   8 +-\n>   src/libcamera/converter/converter_dw100.cpp   |   2 +-\n>   src/libcamera/global_configuration.cpp        |   2 +-\n>   .../pipeline/virtual/config_parser.cpp        |   2 +-\n>   src/libcamera/yaml_parser.cpp                 | 102 ++++++++----------\n>   test/yaml-parser.cpp                          |   4 +-\n>   15 files changed, 75 insertions(+), 102 deletions(-)\n> \n> diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\n> index 0ff026706682..7953befe11e2 100644\n> --- a/include/libcamera/internal/yaml_parser.h\n> +++ b/include/libcamera/internal/yaml_parser.h\n> @@ -182,25 +182,6 @@ public:\n>   \t\treturn get<T>().value_or(std::forward<U>(defaultValue));\n>   \t}\n>   \n> -#ifndef __DOXYGEN__\n> -\ttemplate<typename T,\n> -\t\t std::enable_if_t<\n> -\t\t\t std::is_same_v<bool, T> ||\n> -\t\t\t std::is_same_v<float, T> ||\n> -\t\t\t std::is_same_v<double, T> ||\n> -\t\t\t std::is_same_v<int8_t, T> ||\n> -\t\t\t std::is_same_v<uint8_t, T> ||\n> -\t\t\t std::is_same_v<int16_t, T> ||\n> -\t\t\t std::is_same_v<uint16_t, T> ||\n> -\t\t\t std::is_same_v<int32_t, T> ||\n> -\t\t\t std::is_same_v<uint32_t, T> ||\n> -\t\t\t std::is_same_v<std::string, T> ||\n> -\t\t\t std::is_same_v<Size, T>> * = nullptr>\n> -#else\n> -\ttemplate<typename T>\n> -#endif\n> -\tstd::optional<std::vector<T>> getList() const;\n> -\n>   \tDictAdapter asDict() const { return DictAdapter{ list_ }; }\n>   \tListAdapter asList() const { return ListAdapter{ list_ }; }\n>   \n> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\n> index 564d4143d363..72988096d384 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.cpp\n> +++ b/src/ipa/libipa/agc_mean_luminance.cpp\n> @@ -288,9 +288,9 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)\n>   \t\t\t}\n>   \n>   \t\t\tstd::vector<uint32_t> exposureTimes =\n> -\t\t\t\tmodeValues[\"exposureTime\"].getList<uint32_t>().value_or(std::vector<uint32_t>{});\n> +\t\t\t\tmodeValues[\"exposureTime\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n>   \t\t\tstd::vector<double> gains =\n> -\t\t\t\tmodeValues[\"gain\"].getList<double>().value_or(std::vector<double>{});\n> +\t\t\t\tmodeValues[\"gain\"].get<std::vector<double>>().value_or(std::vector<double>{});\n>   \n>   \t\t\tif (exposureTimes.size() != gains.size()) {\n>   \t\t\t\tLOG(AgcMeanLuminance, Error)\n> diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp\n> index d2bcbd83d7f8..595bd0705732 100644\n> --- a/src/ipa/libipa/awb_bayes.cpp\n> +++ b/src/ipa/libipa/awb_bayes.cpp\n> @@ -211,9 +211,9 @@ int AwbBayes::readPriors(const YamlObject &tuningData)\n>   \t\t}\n>   \n>   \t\tstd::vector<uint32_t> temperatures =\n> -\t\t\tp[\"ct\"].getList<uint32_t>().value_or(std::vector<uint32_t>{});\n> +\t\t\tp[\"ct\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n>   \t\tstd::vector<double> probabilities =\n> -\t\t\tp[\"probability\"].getList<double>().value_or(std::vector<double>{});\n> +\t\t\tp[\"probability\"].get<std::vector<double>>().value_or(std::vector<double>{});\n>   \n>   \t\tif (temperatures.size() != probabilities.size()) {\n>   \t\t\tLOG(Awb, Error)\n> diff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\n> index 5b042c757bc7..f75b9cd7b7b8 100644\n> --- a/src/ipa/mali-c55/algorithms/lsc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/lsc.cpp\n> @@ -48,11 +48,11 @@ int Lsc::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n>   \t\t}\n>   \n>   \t\tstd::vector<uint8_t> rTable =\n> -\t\t\tyamlSet[\"r\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\t\t\tyamlSet[\"r\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \t\tstd::vector<uint8_t> gTable =\n> -\t\t\tyamlSet[\"g\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\t\t\tyamlSet[\"g\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \t\tstd::vector<uint8_t> bTable =\n> -\t\t\tyamlSet[\"b\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\t\t\tyamlSet[\"b\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \n>   \t\t/*\n>   \t\t * Some validation to do; only 16x16 and 32x32 tables of\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 1ecaff680978..7cc06f91ac2b 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -55,7 +55,7 @@ int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)\n>   \t\t}\n>   \n>   \t\tstd::vector<uint8_t> weights =\n> -\t\t\tvalue.getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\t\t\tvalue.get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \t\tif (weights.size() != context.hw.numHistogramWeights) {\n>   \t\t\tLOG(RkISP1Agc, Warning)\n>   \t\t\t\t<< \"Failed to read metering mode'\" << key << \"'\";\n> diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> index 39f3e461f313..ec989bc2421f 100644\n> --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> @@ -72,7 +72,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n>   \t *    +---------|--------> X\n>   \t *     -4....-1 0 1 2 3 4\n>   \t */\n> -\tvalues = dFObject[\"g\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\tvalues = dFObject[\"g\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) {\n>   \t\tLOG(RkISP1Dpf, Error)\n>   \t\t\t<< \"Invalid 'DomainFilter:g': expected \"\n> @@ -108,7 +108,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n>   \t * For a 9x9 kernel, columns -6 and 6 are dropped, so coefficient\n>   \t * number 6 is not used.\n>   \t */\n> -\tvalues = dFObject[\"rb\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> +\tvalues = dFObject[\"rb\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n>   \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS &&\n>   \t    values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) {\n>   \t\tLOG(RkISP1Dpf, Error)\n> @@ -137,7 +137,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n>   \tconst YamlObject &rFObject = tuningData[\"NoiseLevelFunction\"];\n>   \n>   \tstd::vector<uint16_t> nllValues;\n> -\tnllValues = rFObject[\"coeff\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\tnllValues = rFObject[\"coeff\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \tif (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {\n>   \t\tLOG(RkISP1Dpf, Error)\n>   \t\t\t<< \"Invalid 'RangeFilter:coeff': expected \"\n> diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\n> index 9604c0ac001a..7ac5dc215850 100644\n> --- a/src/ipa/rkisp1/algorithms/gsl.cpp\n> +++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n> @@ -59,7 +59,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n>   \t\t\t\t   const YamlObject &tuningData)\n>   {\n>   \tstd::vector<uint16_t> xIntervals =\n> -\t\ttuningData[\"x-intervals\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\t\ttuningData[\"x-intervals\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \tif (xIntervals.size() != kDegammaXIntervals) {\n>   \t\tLOG(RkISP1Gsl, Error)\n>   \t\t\t<< \"Invalid 'x' coordinates: expected \"\n> @@ -83,7 +83,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n>   \t\treturn -EINVAL;\n>   \t}\n>   \n> -\tcurveYr_ = yObject[\"red\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\tcurveYr_ = yObject[\"red\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \tif (curveYr_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n>   \t\tLOG(RkISP1Gsl, Error)\n>   \t\t\t<< \"Invalid 'y:red' coordinates: expected \"\n> @@ -92,7 +92,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n>   \t\treturn -EINVAL;\n>   \t}\n>   \n> -\tcurveYg_ = yObject[\"green\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\tcurveYg_ = yObject[\"green\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \tif (curveYg_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n>   \t\tLOG(RkISP1Gsl, Error)\n>   \t\t\t<< \"Invalid 'y:green' coordinates: expected \"\n> @@ -101,7 +101,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n>   \t\treturn -EINVAL;\n>   \t}\n>   \n> -\tcurveYb_ = yObject[\"blue\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\tcurveYb_ = yObject[\"blue\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \tif (curveYb_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n>   \t\tLOG(RkISP1Gsl, Error)\n>   \t\t\t<< \"Invalid 'y:blue' coordinates: expected \"\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index e7301bfec863..429565a0b51f 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -252,7 +252,7 @@ private:\n>   \t\t\tRKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n>   \n>   \t\tstd::vector<uint16_t> table =\n> -\t\t\ttuningData[prop].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> +\t\t\ttuningData[prop].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n>   \t\tif (table.size() != kLscNumSamples) {\n>   \t\t\tLOG(RkISP1Lsc, Error)\n>   \t\t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n> @@ -269,7 +269,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,\n>   \t\t\t\t      const char *prop)\n>   {\n>   \tstd::vector<double> sizes =\n> -\t\ttuningData[prop].getList<double>().value_or(std::vector<double>{});\n> +\t\ttuningData[prop].get<std::vector<double>>().value_or(std::vector<double>{});\n>   \tif (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n>   \t\tLOG(RkISP1Lsc, Error)\n>   \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index 154551dfacc2..c6cf1f8903f1 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -66,13 +66,13 @@ readMeteringModes(std::map<std::string, AgcMeteringMode> &metering_modes,\n>   \n>   int AgcExposureMode::read(const libcamera::YamlObject &params)\n>   {\n> -\tauto value = params[\"shutter\"].getList<double>();\n> +\tauto value = params[\"shutter\"].get<std::vector<double>>();\n>   \tif (!value)\n>   \t\treturn -EINVAL;\n>   \tstd::transform(value->begin(), value->end(), std::back_inserter(exposureTime),\n>   \t\t       [](double v) { return v * 1us; });\n>   \n> -\tvalue = params[\"gain\"].getList<double>();\n> +\tvalue = params[\"gain\"].get<std::vector<double>>();\n>   \tif (!value)\n>   \t\treturn -EINVAL;\n>   \tgain = std::move(*value);\n> diff --git a/src/ipa/rpi/controller/rpi/hdr.cpp b/src/ipa/rpi/controller/rpi/hdr.cpp\n> index f3da8291bf5d..06400ea79a95 100644\n> --- a/src/ipa/rpi/controller/rpi/hdr.cpp\n> +++ b/src/ipa/rpi/controller/rpi/hdr.cpp\n> @@ -29,7 +29,7 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n>   \n>   \tif (!params.contains(\"cadence\"))\n>   \t\tLOG(RPiHdr, Fatal) << \"No cadence for HDR mode \" << name;\n> -\tcadence = params[\"cadence\"].getList<unsigned int>().value();\n> +\tcadence = params[\"cadence\"].get<std::vector<unsigned int>>().value();\n>   \tif (cadence.empty())\n>   \t\tLOG(RPiHdr, Fatal) << \"Empty cadence in HDR mode \" << name;\n>   \n> @@ -69,14 +69,14 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n>   \t\ttonemap = params[\"tonemap\"].get<ipa::Pwl>(ipa::Pwl{});\n>   \tspeed = params[\"speed\"].get<double>(1.0);\n>   \tif (params.contains(\"hi_quantile_targets\")) {\n> -\t\thiQuantileTargets = params[\"hi_quantile_targets\"].getList<double>().value();\n> +\t\thiQuantileTargets = params[\"hi_quantile_targets\"].get<std::vector<double>>().value();\n>   \t\tif (hiQuantileTargets.empty() || hiQuantileTargets.size() % 2)\n>   \t\t\tLOG(RPiHdr, Fatal) << \"hi_quantile_targets much be even and non-empty\";\n>   \t} else\n>   \t\thiQuantileTargets = { 0.95, 0.65, 0.5, 0.28, 0.3, 0.25 };\n>   \thiQuantileMaxGain = params[\"hi_quantile_max_gain\"].get<double>(1.6);\n>   \tif (params.contains(\"quantile_targets\")) {\n> -\t\tquantileTargets = params[\"quantile_targets\"].getList<double>().value();\n> +\t\tquantileTargets = params[\"quantile_targets\"].get<std::vector<double>>().value();\n>   \t\tif (quantileTargets.empty() || quantileTargets.size() % 2)\n>   \t\t\tLOG(RPiHdr, Fatal) << \"quantile_targets much be even and non-empty\";\n>   \t} else\n> @@ -84,7 +84,7 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n>   \tpowerMin = params[\"power_min\"].get<double>(0.65);\n>   \tpowerMax = params[\"power_max\"].get<double>(1.0);\n>   \tif (params.contains(\"contrast_adjustments\")) {\n> -\t\tcontrastAdjustments = params[\"contrast_adjustments\"].getList<double>().value();\n> +\t\tcontrastAdjustments = params[\"contrast_adjustments\"].get<std::vector<double>>().value();\n>   \t} else\n>   \t\tcontrastAdjustments = { 0.5, 0.75 };\n>   \n> diff --git a/src/libcamera/converter/converter_dw100.cpp b/src/libcamera/converter/converter_dw100.cpp\n> index df5155cfdc93..5782cd0b21b7 100644\n> --- a/src/libcamera/converter/converter_dw100.cpp\n> +++ b/src/libcamera/converter/converter_dw100.cpp\n> @@ -126,7 +126,7 @@ int ConverterDW100Module::init(const YamlObject &params)\n>   \t\treturn -EINVAL;\n>   \t}\n>   \n> -\tconst auto coeffs = coefficients.getList<double>();\n> +\tconst auto coeffs = coefficients.get<std::vector<double>>();\n>   \tif (!coeffs) {\n>   \t\tLOG(Converter, Error) << \"Dewarp parameters 'coefficients' value is not a list\";\n>   \t\treturn -EINVAL;\n> diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp\n> index e086246d6856..99d16e7c38c6 100644\n> --- a/src/libcamera/global_configuration.cpp\n> +++ b/src/libcamera/global_configuration.cpp\n> @@ -152,7 +152,7 @@ std::optional<std::vector<std::string>> GlobalConfiguration::listOption(\n>   \t\tif (!*c)\n>   \t\t\treturn {};\n>   \t}\n> -\treturn c->getList<std::string>();\n> +\treturn c->get<std::vector<std::string>>();\n>   }\n>   \n>   /**\n> diff --git a/src/libcamera/pipeline/virtual/config_parser.cpp b/src/libcamera/pipeline/virtual/config_parser.cpp\n> index 1d3d9ba87ec0..fdc729509371 100644\n> --- a/src/libcamera/pipeline/virtual/config_parser.cpp\n> +++ b/src/libcamera/pipeline/virtual/config_parser.cpp\n> @@ -115,7 +115,7 @@ int ConfigParser::parseSupportedFormats(const YamlObject &cameraConfigData,\n>   \t\t\tstd::vector<int64_t> frameRates;\n>   \t\t\tif (supportedResolution.contains(\"frame_rates\")) {\n>   \t\t\t\tauto frameRatesList =\n> -\t\t\t\t\tsupportedResolution[\"frame_rates\"].getList<int>();\n> +\t\t\t\t\tsupportedResolution[\"frame_rates\"].get<std::vector<int>>();\n>   \t\t\t\tif (!frameRatesList || (frameRatesList->size() != 1 &&\n>   \t\t\t\t\t\t\tframeRatesList->size() != 2)) {\n>   \t\t\t\t\tLOG(Virtual, Error) << \"Invalid frame_rates: either one or two values\";\n> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> index a21e589fdd86..2b3723287051 100644\n> --- a/src/libcamera/yaml_parser.cpp\n> +++ b/src/libcamera/yaml_parser.cpp\n> @@ -109,12 +109,16 @@ std::size_t YamlObject::size() const\n>   \n>   /**\n>    * \\fn template<typename T> YamlObject::get<T>() const\n> + * \\tparam T Type of the value\n>    * \\brief Parse the YamlObject as a \\a T value\n>    *\n>    * This function parses the value of the YamlObject as a \\a T object, and\n>    * returns the value. If parsing fails (usually because the YamlObject doesn't\n>    * store a \\a T value), std::nullopt is returned.\n>    *\n> + * If the type \\a T is an std::vector, the YamlObject will be parsed as a list\n> + * of values.\n> + *\n>    * \\return The YamlObject value, or std::nullopt if parsing failed\n>    */\n>   \n> @@ -127,6 +131,9 @@ std::size_t YamlObject::size() const\n>    * returns the value. If parsing fails (usually because the YamlObject doesn't\n>    * store a \\a T value), the \\a defaultValue is returned.\n>    *\n> + * Unlike the get() function, this overload does not support std::vector for the\n> + * type \\a T.\n> + *\n>    * \\return The YamlObject value, or \\a defaultValue if parsing failed\n>    */\n>   \n> @@ -239,65 +246,50 @@ YamlObject::Accessor<Size>::get(const YamlObject &obj) const\n>   \treturn Size(*width, *height);\n>   }\n>   \n> -#endif /* __DOXYGEN__ */\n> -\n> -/**\n> - * \\fn template<typename T> YamlObject::getList<T>() const\n> - * \\brief Parse the YamlObject as a list of \\a T\n> - *\n> - * This function parses the value of the YamlObject as a list of \\a T objects,\n> - * and returns the value as a \\a std::vector<T>. If parsing fails, std::nullopt\n> - * is returned.\n> - *\n> - * \\return The YamlObject value as a std::vector<T>, or std::nullopt if parsing\n> - * failed\n> - */\n> -\n> -#ifndef __DOXYGEN__\n> -\n> -template<typename T,\n> -\t std::enable_if_t<\n> -\t\t std::is_same_v<bool, T> ||\n> -\t\t std::is_same_v<float, T> ||\n> -\t\t std::is_same_v<double, T> ||\n> -\t\t std::is_same_v<int8_t, T> ||\n> -\t\t std::is_same_v<uint8_t, T> ||\n> -\t\t std::is_same_v<int16_t, T> ||\n> -\t\t std::is_same_v<uint16_t, T> ||\n> -\t\t std::is_same_v<int32_t, T> ||\n> -\t\t std::is_same_v<uint32_t, T> ||\n> -\t\t std::is_same_v<std::string, T> ||\n> -\t\t std::is_same_v<Size, T>> *>\n> -std::optional<std::vector<T>> YamlObject::getList() const\n> +template<typename T>\n> +struct YamlObject::Accessor<std::vector<T>, std::enable_if_t<\n> +\tstd::is_same_v<bool, T> ||\n> +\tstd::is_same_v<float, T> ||\n> +\tstd::is_same_v<double, T> ||\n> +\tstd::is_same_v<int8_t, T> ||\n> +\tstd::is_same_v<uint8_t, T> ||\n> +\tstd::is_same_v<int16_t, T> ||\n> +\tstd::is_same_v<uint16_t, T> ||\n> +\tstd::is_same_v<int32_t, T> ||\n> +\tstd::is_same_v<uint32_t, T> ||\n> +\tstd::is_same_v<std::string, T> ||\n> +\tstd::is_same_v<Size, T>>>\n\nI think the SFINAE check can be removed, no? The \"user\" side has no SFINAE\nchecking, so one gets a linker error either way. If a \"wrong\" type is used\nhere, when explicitly instantiating, then I think either it works or there\nwill be a compilation error.\n\nOr maybe\n\n   std::enable_if_t<std::is_same_v<decltype(std::declval<const YamlObject&>().get<T>), std::optional<T>>>\n\nbut it is likely an overkill, especially that the instantiations are very much\ncontrolled in this file.\n\n>   {\n> -\tif (type_ != Type::List)\n> -\t\treturn std::nullopt;\n> -\n> -\tstd::vector<T> values;\n> -\tvalues.reserve(list_.size());\n> -\n> -\tfor (const YamlObject &entry : asList()) {\n> -\t\tconst auto value = entry.get<T>();\n> -\t\tif (!value)\n> +\tstd::optional<std::vector<T>> get(const YamlObject &obj) const\n> +\t{\n> +\t\tif (obj.type_ != Type::List)\n>   \t\t\treturn std::nullopt;\n> -\t\tvalues.emplace_back(*value);\n> +\n> +\t\tstd::vector<T> values;\n> +\t\tvalues.reserve(obj.list_.size());\n> +\n> +\t\tfor (const YamlObject &entry : obj.asList()) {\n> +\t\t\tconst auto value = entry.get<T>();\n> +\t\t\tif (!value)\n> +\t\t\t\treturn std::nullopt;\n> +\t\t\tvalues.emplace_back(*value);\n\nI think we should take this opportunity to make a small change:\n\n   auto value = ...\n   ...\n   values.emplace_back(std::move(*value));\n\n\n> +\t\t}\n> +\n> +\t\treturn values;\n>   \t}\n> +};\n>   \n> -\treturn values;\n> -}\n> -\n> -template std::optional<std::vector<bool>> YamlObject::getList<bool>() const;\n> -template std::optional<std::vector<float>> YamlObject::getList<float>() const;\n> -template std::optional<std::vector<double>> YamlObject::getList<double>() const;\n> -template std::optional<std::vector<int8_t>> YamlObject::getList<int8_t>() const;\n> -template std::optional<std::vector<uint8_t>> YamlObject::getList<uint8_t>() const;\n> -template std::optional<std::vector<int16_t>> YamlObject::getList<int16_t>() const;\n> -template std::optional<std::vector<uint16_t>> YamlObject::getList<uint16_t>() const;\n> -template std::optional<std::vector<int32_t>> YamlObject::getList<int32_t>() const;\n> -template std::optional<std::vector<uint32_t>> YamlObject::getList<uint32_t>() const;\n> -template std::optional<std::vector<std::string>> YamlObject::getList<std::string>() const;\n> -template std::optional<std::vector<Size>> YamlObject::getList<Size>() const;\n> -\n> +template struct YamlObject::Accessor<std::vector<bool>>;\n> +template struct YamlObject::Accessor<std::vector<float>>;\n> +template struct YamlObject::Accessor<std::vector<double>>;\n> +template struct YamlObject::Accessor<std::vector<int8_t>>;\n> +template struct YamlObject::Accessor<std::vector<uint8_t>>;\n> +template struct YamlObject::Accessor<std::vector<int16_t>>;\n> +template struct YamlObject::Accessor<std::vector<uint16_t>>;\n> +template struct YamlObject::Accessor<std::vector<int32_t>>;\n> +template struct YamlObject::Accessor<std::vector<uint32_t>>;\n> +template struct YamlObject::Accessor<std::vector<std::string>>;\n> +template struct YamlObject::Accessor<std::vector<Size>>;\n>   #endif /* __DOXYGEN__ */\n>   \n>   /**\n> diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\n> index 1b22c87b72f1..566401afcab6 100644\n> --- a/test/yaml-parser.cpp\n> +++ b/test/yaml-parser.cpp\n> @@ -587,9 +587,9 @@ protected:\n>   \t\t\treturn TestFail;\n>   \t\t}\n>   \n> -\t\tconst auto &values = firstElement.getList<uint16_t>();\n> +\t\tconst auto &values = firstElement.get<std::vector<uint16_t>>();\n>   \t\tif (!values || values->size() != 2 || (*values)[0] != 1 || (*values)[1] != 2) {\n> -\t\t\tcerr << \"getList() failed to return correct vector\" << std::endl;\n> +\t\t\tcerr << \"get() failed to return correct vector\" << std::endl;\n>   \t\t\treturn TestFail;\n>   \t\t}\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0650CBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Jan 2026 16:21:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0529C61FBC;\n\tTue, 13 Jan 2026 17:21:58 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B1D461FA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Jan 2026 17:21:56 +0100 (CET)","from [192.168.33.30] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E75C63A4;\n\tTue, 13 Jan 2026 17:21:29 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"eppd5yk6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768321290;\n\tbh=kTpezV8HcknNaMTO223qA+R51Vi5Pml0LqNuDIC+mhg=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=eppd5yk6nlrZl/DgcEa7YdbzRSWb+Hq1NGoIYxsr2uPKBii6g80TOZHYoEa1ZcdA2\n\tg0uiABSB77MRRdj4tL2MMkFeg5+EvRlBRL1xFlsD+4cmuZbEPLI02Szw+mzwtQU1UA\n\t8QMYnX37JZIzuUopZd6jCMVeGFOj4y1gTwUm9fNQ=","Message-ID":"<916baf72-e6b1-44fb-a42b-8c5c553f84aa@ideasonboard.com>","Date":"Tue, 13 Jan 2026 17:21:52 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 11/36] libcamera: yaml_parser: Replace getList() with\n\tget() specializations","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260113000808.15395-1-laurent.pinchart@ideasonboard.com>\n\t<20260113000808.15395-12-laurent.pinchart@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260113000808.15395-12-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37626,"web_url":"https://patchwork.libcamera.org/comment/37626/","msgid":"<20260113204039.GD30544@pendragon.ideasonboard.com>","date":"2026-01-13T20:40:39","subject":"Re: [PATCH 11/36] libcamera: yaml_parser: Replace getList() with\n\tget() specializations","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jan 13, 2026 at 05:21:52PM +0100, Barnabás Pőcze wrote:\n> 2026. 01. 13. 1:07 keltezéssel, Laurent Pinchart írta:\n> > The YamlObject class has two member function templates to get values:\n> > the get() function gets a scalar value, while the getList() function\n> > gets a vector of scalar values.\n> > \n> > As get() is a function template, we can provide specializations for\n> > vector types. This makes the code more systematic, and therefore more\n> > readable. Replace all getList() occurrences, and drop the getList()\n> > function.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >   include/libcamera/internal/yaml_parser.h      |  19 ----\n> >   src/ipa/libipa/agc_mean_luminance.cpp         |   4 +-\n> >   src/ipa/libipa/awb_bayes.cpp                  |   4 +-\n> >   src/ipa/mali-c55/algorithms/lsc.cpp           |   6 +-\n> >   src/ipa/rkisp1/algorithms/agc.cpp             |   2 +-\n> >   src/ipa/rkisp1/algorithms/dpf.cpp             |   6 +-\n> >   src/ipa/rkisp1/algorithms/gsl.cpp             |   8 +-\n> >   src/ipa/rkisp1/algorithms/lsc.cpp             |   4 +-\n> >   src/ipa/rpi/controller/rpi/agc_channel.cpp    |   4 +-\n> >   src/ipa/rpi/controller/rpi/hdr.cpp            |   8 +-\n> >   src/libcamera/converter/converter_dw100.cpp   |   2 +-\n> >   src/libcamera/global_configuration.cpp        |   2 +-\n> >   .../pipeline/virtual/config_parser.cpp        |   2 +-\n> >   src/libcamera/yaml_parser.cpp                 | 102 ++++++++----------\n> >   test/yaml-parser.cpp                          |   4 +-\n> >   15 files changed, 75 insertions(+), 102 deletions(-)\n> > \n> > diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\n> > index 0ff026706682..7953befe11e2 100644\n> > --- a/include/libcamera/internal/yaml_parser.h\n> > +++ b/include/libcamera/internal/yaml_parser.h\n> > @@ -182,25 +182,6 @@ public:\n> >   \t\treturn get<T>().value_or(std::forward<U>(defaultValue));\n> >   \t}\n> >   \n> > -#ifndef __DOXYGEN__\n> > -\ttemplate<typename T,\n> > -\t\t std::enable_if_t<\n> > -\t\t\t std::is_same_v<bool, T> ||\n> > -\t\t\t std::is_same_v<float, T> ||\n> > -\t\t\t std::is_same_v<double, T> ||\n> > -\t\t\t std::is_same_v<int8_t, T> ||\n> > -\t\t\t std::is_same_v<uint8_t, T> ||\n> > -\t\t\t std::is_same_v<int16_t, T> ||\n> > -\t\t\t std::is_same_v<uint16_t, T> ||\n> > -\t\t\t std::is_same_v<int32_t, T> ||\n> > -\t\t\t std::is_same_v<uint32_t, T> ||\n> > -\t\t\t std::is_same_v<std::string, T> ||\n> > -\t\t\t std::is_same_v<Size, T>> * = nullptr>\n> > -#else\n> > -\ttemplate<typename T>\n> > -#endif\n> > -\tstd::optional<std::vector<T>> getList() const;\n> > -\n> >   \tDictAdapter asDict() const { return DictAdapter{ list_ }; }\n> >   \tListAdapter asList() const { return ListAdapter{ list_ }; }\n> >   \n> > diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\n> > index 564d4143d363..72988096d384 100644\n> > --- a/src/ipa/libipa/agc_mean_luminance.cpp\n> > +++ b/src/ipa/libipa/agc_mean_luminance.cpp\n> > @@ -288,9 +288,9 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)\n> >   \t\t\t}\n> >   \n> >   \t\t\tstd::vector<uint32_t> exposureTimes =\n> > -\t\t\t\tmodeValues[\"exposureTime\"].getList<uint32_t>().value_or(std::vector<uint32_t>{});\n> > +\t\t\t\tmodeValues[\"exposureTime\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n> >   \t\t\tstd::vector<double> gains =\n> > -\t\t\t\tmodeValues[\"gain\"].getList<double>().value_or(std::vector<double>{});\n> > +\t\t\t\tmodeValues[\"gain\"].get<std::vector<double>>().value_or(std::vector<double>{});\n> >   \n> >   \t\t\tif (exposureTimes.size() != gains.size()) {\n> >   \t\t\t\tLOG(AgcMeanLuminance, Error)\n> > diff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp\n> > index d2bcbd83d7f8..595bd0705732 100644\n> > --- a/src/ipa/libipa/awb_bayes.cpp\n> > +++ b/src/ipa/libipa/awb_bayes.cpp\n> > @@ -211,9 +211,9 @@ int AwbBayes::readPriors(const YamlObject &tuningData)\n> >   \t\t}\n> >   \n> >   \t\tstd::vector<uint32_t> temperatures =\n> > -\t\t\tp[\"ct\"].getList<uint32_t>().value_or(std::vector<uint32_t>{});\n> > +\t\t\tp[\"ct\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n> >   \t\tstd::vector<double> probabilities =\n> > -\t\t\tp[\"probability\"].getList<double>().value_or(std::vector<double>{});\n> > +\t\t\tp[\"probability\"].get<std::vector<double>>().value_or(std::vector<double>{});\n> >   \n> >   \t\tif (temperatures.size() != probabilities.size()) {\n> >   \t\t\tLOG(Awb, Error)\n> > diff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\n> > index 5b042c757bc7..f75b9cd7b7b8 100644\n> > --- a/src/ipa/mali-c55/algorithms/lsc.cpp\n> > +++ b/src/ipa/mali-c55/algorithms/lsc.cpp\n> > @@ -48,11 +48,11 @@ int Lsc::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n> >   \t\t}\n> >   \n> >   \t\tstd::vector<uint8_t> rTable =\n> > -\t\t\tyamlSet[\"r\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\t\t\tyamlSet[\"r\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \t\tstd::vector<uint8_t> gTable =\n> > -\t\t\tyamlSet[\"g\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\t\t\tyamlSet[\"g\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \t\tstd::vector<uint8_t> bTable =\n> > -\t\t\tyamlSet[\"b\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\t\t\tyamlSet[\"b\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \n> >   \t\t/*\n> >   \t\t * Some validation to do; only 16x16 and 32x32 tables of\n> > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> > index 1ecaff680978..7cc06f91ac2b 100644\n> > --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> > @@ -55,7 +55,7 @@ int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)\n> >   \t\t}\n> >   \n> >   \t\tstd::vector<uint8_t> weights =\n> > -\t\t\tvalue.getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\t\t\tvalue.get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \t\tif (weights.size() != context.hw.numHistogramWeights) {\n> >   \t\t\tLOG(RkISP1Agc, Warning)\n> >   \t\t\t\t<< \"Failed to read metering mode'\" << key << \"'\";\n> > diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > index 39f3e461f313..ec989bc2421f 100644\n> > --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > @@ -72,7 +72,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n> >   \t *    +---------|--------> X\n> >   \t *     -4....-1 0 1 2 3 4\n> >   \t */\n> > -\tvalues = dFObject[\"g\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\tvalues = dFObject[\"g\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) {\n> >   \t\tLOG(RkISP1Dpf, Error)\n> >   \t\t\t<< \"Invalid 'DomainFilter:g': expected \"\n> > @@ -108,7 +108,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n> >   \t * For a 9x9 kernel, columns -6 and 6 are dropped, so coefficient\n> >   \t * number 6 is not used.\n> >   \t */\n> > -\tvalues = dFObject[\"rb\"].getList<uint8_t>().value_or(std::vector<uint8_t>{});\n> > +\tvalues = dFObject[\"rb\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n> >   \tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS &&\n> >   \t    values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) {\n> >   \t\tLOG(RkISP1Dpf, Error)\n> > @@ -137,7 +137,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n> >   \tconst YamlObject &rFObject = tuningData[\"NoiseLevelFunction\"];\n> >   \n> >   \tstd::vector<uint16_t> nllValues;\n> > -\tnllValues = rFObject[\"coeff\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\tnllValues = rFObject[\"coeff\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \tif (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {\n> >   \t\tLOG(RkISP1Dpf, Error)\n> >   \t\t\t<< \"Invalid 'RangeFilter:coeff': expected \"\n> > diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\n> > index 9604c0ac001a..7ac5dc215850 100644\n> > --- a/src/ipa/rkisp1/algorithms/gsl.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n> > @@ -59,7 +59,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n> >   \t\t\t\t   const YamlObject &tuningData)\n> >   {\n> >   \tstd::vector<uint16_t> xIntervals =\n> > -\t\ttuningData[\"x-intervals\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\t\ttuningData[\"x-intervals\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \tif (xIntervals.size() != kDegammaXIntervals) {\n> >   \t\tLOG(RkISP1Gsl, Error)\n> >   \t\t\t<< \"Invalid 'x' coordinates: expected \"\n> > @@ -83,7 +83,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n> >   \t\treturn -EINVAL;\n> >   \t}\n> >   \n> > -\tcurveYr_ = yObject[\"red\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\tcurveYr_ = yObject[\"red\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \tif (curveYr_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n> >   \t\tLOG(RkISP1Gsl, Error)\n> >   \t\t\t<< \"Invalid 'y:red' coordinates: expected \"\n> > @@ -92,7 +92,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n> >   \t\treturn -EINVAL;\n> >   \t}\n> >   \n> > -\tcurveYg_ = yObject[\"green\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\tcurveYg_ = yObject[\"green\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \tif (curveYg_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n> >   \t\tLOG(RkISP1Gsl, Error)\n> >   \t\t\t<< \"Invalid 'y:green' coordinates: expected \"\n> > @@ -101,7 +101,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n> >   \t\treturn -EINVAL;\n> >   \t}\n> >   \n> > -\tcurveYb_ = yObject[\"blue\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\tcurveYb_ = yObject[\"blue\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \tif (curveYb_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n> >   \t\tLOG(RkISP1Gsl, Error)\n> >   \t\t\t<< \"Invalid 'y:blue' coordinates: expected \"\n> > diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > index e7301bfec863..429565a0b51f 100644\n> > --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > @@ -252,7 +252,7 @@ private:\n> >   \t\t\tRKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n> >   \n> >   \t\tstd::vector<uint16_t> table =\n> > -\t\t\ttuningData[prop].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n> > +\t\t\ttuningData[prop].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n> >   \t\tif (table.size() != kLscNumSamples) {\n> >   \t\t\tLOG(RkISP1Lsc, Error)\n> >   \t\t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n> > @@ -269,7 +269,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,\n> >   \t\t\t\t      const char *prop)\n> >   {\n> >   \tstd::vector<double> sizes =\n> > -\t\ttuningData[prop].getList<double>().value_or(std::vector<double>{});\n> > +\t\ttuningData[prop].get<std::vector<double>>().value_or(std::vector<double>{});\n> >   \tif (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n> >   \t\tLOG(RkISP1Lsc, Error)\n> >   \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n> > diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> > index 154551dfacc2..c6cf1f8903f1 100644\n> > --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> > +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> > @@ -66,13 +66,13 @@ readMeteringModes(std::map<std::string, AgcMeteringMode> &metering_modes,\n> >   \n> >   int AgcExposureMode::read(const libcamera::YamlObject &params)\n> >   {\n> > -\tauto value = params[\"shutter\"].getList<double>();\n> > +\tauto value = params[\"shutter\"].get<std::vector<double>>();\n> >   \tif (!value)\n> >   \t\treturn -EINVAL;\n> >   \tstd::transform(value->begin(), value->end(), std::back_inserter(exposureTime),\n> >   \t\t       [](double v) { return v * 1us; });\n> >   \n> > -\tvalue = params[\"gain\"].getList<double>();\n> > +\tvalue = params[\"gain\"].get<std::vector<double>>();\n> >   \tif (!value)\n> >   \t\treturn -EINVAL;\n> >   \tgain = std::move(*value);\n> > diff --git a/src/ipa/rpi/controller/rpi/hdr.cpp b/src/ipa/rpi/controller/rpi/hdr.cpp\n> > index f3da8291bf5d..06400ea79a95 100644\n> > --- a/src/ipa/rpi/controller/rpi/hdr.cpp\n> > +++ b/src/ipa/rpi/controller/rpi/hdr.cpp\n> > @@ -29,7 +29,7 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n> >   \n> >   \tif (!params.contains(\"cadence\"))\n> >   \t\tLOG(RPiHdr, Fatal) << \"No cadence for HDR mode \" << name;\n> > -\tcadence = params[\"cadence\"].getList<unsigned int>().value();\n> > +\tcadence = params[\"cadence\"].get<std::vector<unsigned int>>().value();\n> >   \tif (cadence.empty())\n> >   \t\tLOG(RPiHdr, Fatal) << \"Empty cadence in HDR mode \" << name;\n> >   \n> > @@ -69,14 +69,14 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n> >   \t\ttonemap = params[\"tonemap\"].get<ipa::Pwl>(ipa::Pwl{});\n> >   \tspeed = params[\"speed\"].get<double>(1.0);\n> >   \tif (params.contains(\"hi_quantile_targets\")) {\n> > -\t\thiQuantileTargets = params[\"hi_quantile_targets\"].getList<double>().value();\n> > +\t\thiQuantileTargets = params[\"hi_quantile_targets\"].get<std::vector<double>>().value();\n> >   \t\tif (hiQuantileTargets.empty() || hiQuantileTargets.size() % 2)\n> >   \t\t\tLOG(RPiHdr, Fatal) << \"hi_quantile_targets much be even and non-empty\";\n> >   \t} else\n> >   \t\thiQuantileTargets = { 0.95, 0.65, 0.5, 0.28, 0.3, 0.25 };\n> >   \thiQuantileMaxGain = params[\"hi_quantile_max_gain\"].get<double>(1.6);\n> >   \tif (params.contains(\"quantile_targets\")) {\n> > -\t\tquantileTargets = params[\"quantile_targets\"].getList<double>().value();\n> > +\t\tquantileTargets = params[\"quantile_targets\"].get<std::vector<double>>().value();\n> >   \t\tif (quantileTargets.empty() || quantileTargets.size() % 2)\n> >   \t\t\tLOG(RPiHdr, Fatal) << \"quantile_targets much be even and non-empty\";\n> >   \t} else\n> > @@ -84,7 +84,7 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n> >   \tpowerMin = params[\"power_min\"].get<double>(0.65);\n> >   \tpowerMax = params[\"power_max\"].get<double>(1.0);\n> >   \tif (params.contains(\"contrast_adjustments\")) {\n> > -\t\tcontrastAdjustments = params[\"contrast_adjustments\"].getList<double>().value();\n> > +\t\tcontrastAdjustments = params[\"contrast_adjustments\"].get<std::vector<double>>().value();\n> >   \t} else\n> >   \t\tcontrastAdjustments = { 0.5, 0.75 };\n> >   \n> > diff --git a/src/libcamera/converter/converter_dw100.cpp b/src/libcamera/converter/converter_dw100.cpp\n> > index df5155cfdc93..5782cd0b21b7 100644\n> > --- a/src/libcamera/converter/converter_dw100.cpp\n> > +++ b/src/libcamera/converter/converter_dw100.cpp\n> > @@ -126,7 +126,7 @@ int ConverterDW100Module::init(const YamlObject &params)\n> >   \t\treturn -EINVAL;\n> >   \t}\n> >   \n> > -\tconst auto coeffs = coefficients.getList<double>();\n> > +\tconst auto coeffs = coefficients.get<std::vector<double>>();\n> >   \tif (!coeffs) {\n> >   \t\tLOG(Converter, Error) << \"Dewarp parameters 'coefficients' value is not a list\";\n> >   \t\treturn -EINVAL;\n> > diff --git a/src/libcamera/global_configuration.cpp b/src/libcamera/global_configuration.cpp\n> > index e086246d6856..99d16e7c38c6 100644\n> > --- a/src/libcamera/global_configuration.cpp\n> > +++ b/src/libcamera/global_configuration.cpp\n> > @@ -152,7 +152,7 @@ std::optional<std::vector<std::string>> GlobalConfiguration::listOption(\n> >   \t\tif (!*c)\n> >   \t\t\treturn {};\n> >   \t}\n> > -\treturn c->getList<std::string>();\n> > +\treturn c->get<std::vector<std::string>>();\n> >   }\n> >   \n> >   /**\n> > diff --git a/src/libcamera/pipeline/virtual/config_parser.cpp b/src/libcamera/pipeline/virtual/config_parser.cpp\n> > index 1d3d9ba87ec0..fdc729509371 100644\n> > --- a/src/libcamera/pipeline/virtual/config_parser.cpp\n> > +++ b/src/libcamera/pipeline/virtual/config_parser.cpp\n> > @@ -115,7 +115,7 @@ int ConfigParser::parseSupportedFormats(const YamlObject &cameraConfigData,\n> >   \t\t\tstd::vector<int64_t> frameRates;\n> >   \t\t\tif (supportedResolution.contains(\"frame_rates\")) {\n> >   \t\t\t\tauto frameRatesList =\n> > -\t\t\t\t\tsupportedResolution[\"frame_rates\"].getList<int>();\n> > +\t\t\t\t\tsupportedResolution[\"frame_rates\"].get<std::vector<int>>();\n> >   \t\t\t\tif (!frameRatesList || (frameRatesList->size() != 1 &&\n> >   \t\t\t\t\t\t\tframeRatesList->size() != 2)) {\n> >   \t\t\t\t\tLOG(Virtual, Error) << \"Invalid frame_rates: either one or two values\";\n> > diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> > index a21e589fdd86..2b3723287051 100644\n> > --- a/src/libcamera/yaml_parser.cpp\n> > +++ b/src/libcamera/yaml_parser.cpp\n> > @@ -109,12 +109,16 @@ std::size_t YamlObject::size() const\n> >   \n> >   /**\n> >    * \\fn template<typename T> YamlObject::get<T>() const\n> > + * \\tparam T Type of the value\n> >    * \\brief Parse the YamlObject as a \\a T value\n> >    *\n> >    * This function parses the value of the YamlObject as a \\a T object, and\n> >    * returns the value. If parsing fails (usually because the YamlObject doesn't\n> >    * store a \\a T value), std::nullopt is returned.\n> >    *\n> > + * If the type \\a T is an std::vector, the YamlObject will be parsed as a list\n> > + * of values.\n> > + *\n> >    * \\return The YamlObject value, or std::nullopt if parsing failed\n> >    */\n> >   \n> > @@ -127,6 +131,9 @@ std::size_t YamlObject::size() const\n> >    * returns the value. If parsing fails (usually because the YamlObject doesn't\n> >    * store a \\a T value), the \\a defaultValue is returned.\n> >    *\n> > + * Unlike the get() function, this overload does not support std::vector for the\n> > + * type \\a T.\n> > + *\n> >    * \\return The YamlObject value, or \\a defaultValue if parsing failed\n> >    */\n> >   \n> > @@ -239,65 +246,50 @@ YamlObject::Accessor<Size>::get(const YamlObject &obj) const\n> >   \treturn Size(*width, *height);\n> >   }\n> >   \n> > -#endif /* __DOXYGEN__ */\n> > -\n> > -/**\n> > - * \\fn template<typename T> YamlObject::getList<T>() const\n> > - * \\brief Parse the YamlObject as a list of \\a T\n> > - *\n> > - * This function parses the value of the YamlObject as a list of \\a T objects,\n> > - * and returns the value as a \\a std::vector<T>. If parsing fails, std::nullopt\n> > - * is returned.\n> > - *\n> > - * \\return The YamlObject value as a std::vector<T>, or std::nullopt if parsing\n> > - * failed\n> > - */\n> > -\n> > -#ifndef __DOXYGEN__\n> > -\n> > -template<typename T,\n> > -\t std::enable_if_t<\n> > -\t\t std::is_same_v<bool, T> ||\n> > -\t\t std::is_same_v<float, T> ||\n> > -\t\t std::is_same_v<double, T> ||\n> > -\t\t std::is_same_v<int8_t, T> ||\n> > -\t\t std::is_same_v<uint8_t, T> ||\n> > -\t\t std::is_same_v<int16_t, T> ||\n> > -\t\t std::is_same_v<uint16_t, T> ||\n> > -\t\t std::is_same_v<int32_t, T> ||\n> > -\t\t std::is_same_v<uint32_t, T> ||\n> > -\t\t std::is_same_v<std::string, T> ||\n> > -\t\t std::is_same_v<Size, T>> *>\n> > -std::optional<std::vector<T>> YamlObject::getList() const\n> > +template<typename T>\n> > +struct YamlObject::Accessor<std::vector<T>, std::enable_if_t<\n> > +\tstd::is_same_v<bool, T> ||\n> > +\tstd::is_same_v<float, T> ||\n> > +\tstd::is_same_v<double, T> ||\n> > +\tstd::is_same_v<int8_t, T> ||\n> > +\tstd::is_same_v<uint8_t, T> ||\n> > +\tstd::is_same_v<int16_t, T> ||\n> > +\tstd::is_same_v<uint16_t, T> ||\n> > +\tstd::is_same_v<int32_t, T> ||\n> > +\tstd::is_same_v<uint32_t, T> ||\n> > +\tstd::is_same_v<std::string, T> ||\n> > +\tstd::is_same_v<Size, T>>>\n> \n> I think the SFINAE check can be removed, no? The \"user\" side has no SFINAE\n> checking, so one gets a linker error either way. If a \"wrong\" type is used\n> here, when explicitly instantiating, then I think either it works or there\n> will be a compilation error.\n\nIndeed. I'll try to drop it.\n\n> Or maybe\n> \n>    std::enable_if_t<std::is_same_v<decltype(std::declval<const YamlObject&>().get<T>), std::optional<T>>>\n> \n> but it is likely an overkill, especially that the instantiations are very much\n> controlled in this file.\n> \n> >   {\n> > -\tif (type_ != Type::List)\n> > -\t\treturn std::nullopt;\n> > -\n> > -\tstd::vector<T> values;\n> > -\tvalues.reserve(list_.size());\n> > -\n> > -\tfor (const YamlObject &entry : asList()) {\n> > -\t\tconst auto value = entry.get<T>();\n> > -\t\tif (!value)\n> > +\tstd::optional<std::vector<T>> get(const YamlObject &obj) const\n> > +\t{\n> > +\t\tif (obj.type_ != Type::List)\n> >   \t\t\treturn std::nullopt;\n> > -\t\tvalues.emplace_back(*value);\n> > +\n> > +\t\tstd::vector<T> values;\n> > +\t\tvalues.reserve(obj.list_.size());\n> > +\n> > +\t\tfor (const YamlObject &entry : obj.asList()) {\n> > +\t\t\tconst auto value = entry.get<T>();\n> > +\t\t\tif (!value)\n> > +\t\t\t\treturn std::nullopt;\n> > +\t\t\tvalues.emplace_back(*value);\n> \n> I think we should take this opportunity to make a small change:\n> \n>    auto value = ...\n>    ...\n>    values.emplace_back(std::move(*value));\n\nAck.\n\n> > +\t\t}\n> > +\n> > +\t\treturn values;\n> >   \t}\n> > +};\n> >   \n> > -\treturn values;\n> > -}\n> > -\n> > -template std::optional<std::vector<bool>> YamlObject::getList<bool>() const;\n> > -template std::optional<std::vector<float>> YamlObject::getList<float>() const;\n> > -template std::optional<std::vector<double>> YamlObject::getList<double>() const;\n> > -template std::optional<std::vector<int8_t>> YamlObject::getList<int8_t>() const;\n> > -template std::optional<std::vector<uint8_t>> YamlObject::getList<uint8_t>() const;\n> > -template std::optional<std::vector<int16_t>> YamlObject::getList<int16_t>() const;\n> > -template std::optional<std::vector<uint16_t>> YamlObject::getList<uint16_t>() const;\n> > -template std::optional<std::vector<int32_t>> YamlObject::getList<int32_t>() const;\n> > -template std::optional<std::vector<uint32_t>> YamlObject::getList<uint32_t>() const;\n> > -template std::optional<std::vector<std::string>> YamlObject::getList<std::string>() const;\n> > -template std::optional<std::vector<Size>> YamlObject::getList<Size>() const;\n> > -\n> > +template struct YamlObject::Accessor<std::vector<bool>>;\n> > +template struct YamlObject::Accessor<std::vector<float>>;\n> > +template struct YamlObject::Accessor<std::vector<double>>;\n> > +template struct YamlObject::Accessor<std::vector<int8_t>>;\n> > +template struct YamlObject::Accessor<std::vector<uint8_t>>;\n> > +template struct YamlObject::Accessor<std::vector<int16_t>>;\n> > +template struct YamlObject::Accessor<std::vector<uint16_t>>;\n> > +template struct YamlObject::Accessor<std::vector<int32_t>>;\n> > +template struct YamlObject::Accessor<std::vector<uint32_t>>;\n> > +template struct YamlObject::Accessor<std::vector<std::string>>;\n> > +template struct YamlObject::Accessor<std::vector<Size>>;\n> >   #endif /* __DOXYGEN__ */\n> >   \n> >   /**\n> > diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\n> > index 1b22c87b72f1..566401afcab6 100644\n> > --- a/test/yaml-parser.cpp\n> > +++ b/test/yaml-parser.cpp\n> > @@ -587,9 +587,9 @@ protected:\n> >   \t\t\treturn TestFail;\n> >   \t\t}\n> >   \n> > -\t\tconst auto &values = firstElement.getList<uint16_t>();\n> > +\t\tconst auto &values = firstElement.get<std::vector<uint16_t>>();\n> >   \t\tif (!values || values->size() != 2 || (*values)[0] != 1 || (*values)[1] != 2) {\n> > -\t\t\tcerr << \"getList() failed to return correct vector\" << std::endl;\n> > +\t\t\tcerr << \"get() failed to return correct vector\" << std::endl;\n> >   \t\t\treturn TestFail;\n> >   \t\t}\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9D6CCBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Jan 2026 20:41:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D30E261FA3;\n\tTue, 13 Jan 2026 21:41:02 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A48FE61FA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Jan 2026 21:41:00 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi\n\t[81.175.209.152])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 25E6F2E0;\n\tTue, 13 Jan 2026 21:40:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RzZX3+2C\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768336834;\n\tbh=FCmaQd8c1UsHmsxIJazkFxIPXAYNzHKfWPzjkX9W4Gw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RzZX3+2CxENmhhHpjnXAxF2afxOOBMGCBgvAYohAk8Ju7iU+CLoaEFmGb0PUZqho4\n\t6NVqtUdf14JydWAGwz4X+RFo9ImBnteuO2YS4G+2qONRJDnQHzfHJmQnony0V0bA6c\n\tfgH0mabZr5B5dRF4fxBbAfvqE0v35kNlnc9rEWw0=","Date":"Tue, 13 Jan 2026 22:40:39 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 11/36] libcamera: yaml_parser: Replace getList() with\n\tget() specializations","Message-ID":"<20260113204039.GD30544@pendragon.ideasonboard.com>","References":"<20260113000808.15395-1-laurent.pinchart@ideasonboard.com>\n\t<20260113000808.15395-12-laurent.pinchart@ideasonboard.com>\n\t<916baf72-e6b1-44fb-a42b-8c5c553f84aa@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<916baf72-e6b1-44fb-a42b-8c5c553f84aa@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]