Show a patch.

GET /api/patches/26614/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 26614,
    "url": "https://patchwork.libcamera.org/api/patches/26614/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26614/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260504140646.1455101-2-laurent.pinchart@ideasonboard.com>",
    "date": "2026-05-04T14:06:46",
    "name": "[v2,2/2] treewide: Use utils::defopt",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d7298d42e2effb95a9d4c789649a94826d47f7c4",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26614/mbox/",
    "series": [
        {
            "id": 5902,
            "url": "https://patchwork.libcamera.org/api/series/5902/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5902",
            "date": "2026-05-04T14:06:45",
            "name": "[v2,1/2] libcamera: base: Restore defopt",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5902/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26614/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26614/checks/",
    "tags": {},
    "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 0254FC32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 14:06:52 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B9D636302A;\n\tMon,  4 May 2026 16:06:51 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ADFFA62FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 16:06:49 +0200 (CEST)",
            "from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AFB67175\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 16:06:47 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fnxahQuI\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1777903607;\n\tbh=gAnc+LB9NAyd344hLkNLd8b4JgiNMJk/M4SZqtwWaKA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=fnxahQuIko/DOVQasW+/WnwRFQqxAG1MqKPhIz89uAY4vpK+5fpf0oDAuo9zxWMwe\n\tF1LyrftBt+CT6PL3wV0PB939AVlPzjTbLmpXa5H8ezKnlLLIAhwTpi/j6GB3m9ry98\n\t7m+uvHttLwsUN66E0vqaYO9V7fdKDTDz3i2tPCV8=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v2 2/2] treewide: Use utils::defopt",
        "Date": "Mon,  4 May 2026 17:06:46 +0300",
        "Message-ID": "<20260504140646.1455101-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260504140646.1455101-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20260504140646.1455101-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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>"
    },
    "content": "Calling std::optional::value_or() constructs the value passed as an\nargument to the function, even if the std::optional already contains a\nvalus. This can be fairly inefficient when using values whose default\nconstructor is expensive. Fix it by using utils::defopt.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/android/camera_capabilities.cpp      | 5 +++--\n src/ipa/libipa/agc_mean_luminance.cpp    | 6 ++++--\n src/ipa/libipa/awb_bayes.cpp             | 6 ++++--\n src/ipa/mali-c55/algorithms/lsc.cpp      | 8 +++++---\n src/ipa/rkisp1/algorithms/agc.cpp        | 2 +-\n src/ipa/rkisp1/algorithms/dpf.cpp        | 7 ++++---\n src/ipa/rkisp1/algorithms/gsl.cpp        | 8 ++++----\n src/ipa/rkisp1/algorithms/lsc.cpp        | 4 ++--\n src/libcamera/ipa_manager.cpp            | 2 +-\n src/libcamera/ipa_proxy.cpp              | 4 ++--\n src/libcamera/pipeline/rpi/pisp/pisp.cpp | 2 +-\n src/v4l2/v4l2_compat_manager.cpp         | 2 +-\n test/value-node.cpp                      | 4 ++--\n 13 files changed, 34 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex b161bc6b3ed6..6b58dd554873 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -17,6 +17,7 @@\n #include <hardware/camera3.h>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n \n #include <libcamera/control_ids.h>\n #include <libcamera/controls.h>\n@@ -1064,7 +1065,7 @@ int CameraCapabilities::initializeStaticMetadata()\n \t/* Sensor static metadata. */\n \tstd::array<int32_t, 2> pixelArraySize;\n \t{\n-\t\tconst Size &size = properties.get(properties::PixelArraySize).value_or(Size{});\n+\t\tconst Size &size = properties.get(properties::PixelArraySize).value_or(utils::defopt);\n \t\tpixelArraySize[0] = size.width;\n \t\tpixelArraySize[1] = size.height;\n \t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,\n@@ -1083,7 +1084,7 @@ int CameraCapabilities::initializeStaticMetadata()\n \n \t{\n \t\tconst Span<const Rectangle> rects =\n-\t\t\tproperties.get(properties::PixelArrayActiveAreas).value_or(Span<const Rectangle>{});\n+\t\t\tproperties.get(properties::PixelArrayActiveAreas).value_or(utils::defopt);\n \t\tstd::vector<int32_t> data{\n \t\t\tstatic_cast<int32_t>(rects[0].x),\n \t\t\tstatic_cast<int32_t>(rects[0].y),\ndiff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\nindex 1d385551adc6..c226dd23552c 100644\n--- a/src/ipa/libipa/agc_mean_luminance.cpp\n+++ b/src/ipa/libipa/agc_mean_luminance.cpp\n@@ -11,6 +11,8 @@\n #include <cmath>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n+\n #include <libcamera/control_ids.h>\n \n #include \"exposure_mode_helper.h\"\n@@ -288,9 +290,9 @@ int AgcMeanLuminance::parseExposureModes(const ValueNode &tuningData)\n \t\t\t}\n \n \t\t\tstd::vector<uint32_t> exposureTimes =\n-\t\t\t\tmodeValues[\"exposureTime\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n+\t\t\t\tmodeValues[\"exposureTime\"].get<std::vector<uint32_t>>().value_or(utils::defopt);\n \t\t\tstd::vector<double> gains =\n-\t\t\t\tmodeValues[\"gain\"].get<std::vector<double>>().value_or(std::vector<double>{});\n+\t\t\t\tmodeValues[\"gain\"].get<std::vector<double>>().value_or(utils::defopt);\n \n \t\t\tif (exposureTimes.size() != gains.size()) {\n \t\t\t\tLOG(AgcMeanLuminance, Error)\ndiff --git a/src/ipa/libipa/awb_bayes.cpp b/src/ipa/libipa/awb_bayes.cpp\nindex a1412c8bd2b5..9fd85e5a4505 100644\n--- a/src/ipa/libipa/awb_bayes.cpp\n+++ b/src/ipa/libipa/awb_bayes.cpp\n@@ -16,6 +16,8 @@\n #include <vector>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n+\n #include <libcamera/control_ids.h>\n \n #include \"colours.h\"\n@@ -211,9 +213,9 @@ int AwbBayes::readPriors(const ValueNode &tuningData)\n \t\t}\n \n \t\tstd::vector<uint32_t> temperatures =\n-\t\t\tp[\"ct\"].get<std::vector<uint32_t>>().value_or(std::vector<uint32_t>{});\n+\t\t\tp[\"ct\"].get<std::vector<uint32_t>>().value_or(utils::defopt);\n \t\tstd::vector<double> probabilities =\n-\t\t\tp[\"probability\"].get<std::vector<double>>().value_or(std::vector<double>{});\n+\t\t\tp[\"probability\"].get<std::vector<double>>().value_or(utils::defopt);\n \n \t\tif (temperatures.size() != probabilities.size()) {\n \t\t\tLOG(Awb, Error)\ndiff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\nindex fe230fdff418..36e50163aecc 100644\n--- a/src/ipa/mali-c55/algorithms/lsc.cpp\n+++ b/src/ipa/mali-c55/algorithms/lsc.cpp\n@@ -7,6 +7,8 @@\n \n #include \"lsc.h\"\n \n+#include <libcamera/base/utils.h>\n+\n #include \"libcamera/internal/value_node.h\"\n \n namespace libcamera {\n@@ -48,11 +50,11 @@ int Lsc::init([[maybe_unused]] IPAContext &context, const ValueNode &tuningData)\n \t\t}\n \n \t\tstd::vector<uint8_t> rTable =\n-\t\t\tyamlSet[\"r\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\t\t\tyamlSet[\"r\"].get<std::vector<uint8_t>>().value_or(utils::defopt);\n \t\tstd::vector<uint8_t> gTable =\n-\t\t\tyamlSet[\"g\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\t\t\tyamlSet[\"g\"].get<std::vector<uint8_t>>().value_or(utils::defopt);\n \t\tstd::vector<uint8_t> bTable =\n-\t\t\tyamlSet[\"b\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\t\t\tyamlSet[\"b\"].get<std::vector<uint8_t>>().value_or(utils::defopt);\n \n \t\t/*\n \t\t * Some validation to do; only 16x16 and 32x32 tables of\ndiff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex 523930488a3b..9bb9d943163f 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 ValueNode &tuningData)\n \t\t}\n \n \t\tstd::vector<uint8_t> weights =\n-\t\t\tvalue.get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\t\t\tvalue.get<std::vector<uint8_t>>().value_or(utils::defopt);\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 << \"'\";\ndiff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nindex 5c5b539f1ee8..b2c9ec568b97 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -12,6 +12,7 @@\n #include <vector>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n \n #include <libcamera/control_ids.h>\n \n@@ -72,7 +73,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\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\tvalues = dFObject[\"g\"].get<std::vector<uint8_t>>().value_or(utils::defopt);\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 +109,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\"].get<std::vector<uint8_t>>().value_or(std::vector<uint8_t>{});\n+\tvalues = dFObject[\"rb\"].get<std::vector<uint8_t>>().value_or(utils::defopt);\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 +138,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,\n \tconst ValueNode &rFObject = tuningData[\"NoiseLevelFunction\"];\n \n \tstd::vector<uint16_t> nllValues;\n-\tnllValues = rFObject[\"coeff\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\tnllValues = rFObject[\"coeff\"].get<std::vector<uint16_t>>().value_or(utils::defopt);\n \tif (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {\n \t\tLOG(RkISP1Dpf, Error)\n \t\t\t<< \"Invalid 'RangeFilter:coeff': expected \"\ndiff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\nindex d6272f3a39ef..d83aab8506f3 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 ValueNode &tuningData)\n {\n \tstd::vector<uint16_t> xIntervals =\n-\t\ttuningData[\"x-intervals\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\t\ttuningData[\"x-intervals\"].get<std::vector<uint16_t>>().value_or(utils::defopt);\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\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\tcurveYr_ = yObject[\"red\"].get<std::vector<uint16_t>>().value_or(utils::defopt);\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\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\tcurveYg_ = yObject[\"green\"].get<std::vector<uint16_t>>().value_or(utils::defopt);\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\"].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\tcurveYb_ = yObject[\"blue\"].get<std::vector<uint16_t>>().value_or(utils::defopt);\n \tif (curveYb_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {\n \t\tLOG(RkISP1Gsl, Error)\n \t\t\t<< \"Invalid 'y:blue' coordinates: expected \"\ndiff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\nindex 54e374bd9c3c..25f7c512b35c 100644\n--- a/src/ipa/rkisp1/algorithms/lsc.cpp\n+++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n@@ -317,7 +317,7 @@ std::vector<uint16_t> LscTableLoader::parseTable(const ValueNode &tuningData,\n \t\tRKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n \n \tstd::vector<uint16_t> table =\n-\t\ttuningData[prop].get<std::vector<uint16_t>>().value_or(std::vector<uint16_t>{});\n+\t\ttuningData[prop].get<std::vector<uint16_t>>().value_or(utils::defopt);\n \tif (table.size() != kLscNumSamples) {\n \t\tLOG(RkISP1Lsc, Error)\n \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n@@ -333,7 +333,7 @@ std::vector<double> parseSizes(const ValueNode &tuningData,\n \t\t\t       const char *prop)\n {\n \tstd::vector<double> sizes =\n-\t\ttuningData[prop].get<std::vector<double>>().value_or(std::vector<double>{});\n+\t\ttuningData[prop].get<std::vector<double>>().value_or(utils::defopt);\n \tif (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n \t\tLOG(RkISP1Lsc, Error)\n \t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\ndiff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp\nindex a351f4f7b581..41918e4c2934 100644\n--- a/src/libcamera/ipa_manager.cpp\n+++ b/src/libcamera/ipa_manager.cpp\n@@ -123,7 +123,7 @@ IPAManager::IPAManager(const CameraManager &cm)\n \t/* User-specified paths take precedence. */\n \tconst auto modulePaths =\n \t\tconfiguration.listOption({ \"ipa\", \"module_paths\" })\n-\t\t\t.value_or(std::vector<std::string>());\n+\t\t\t.value_or(utils::defopt);\n \tfor (const auto &dir : modulePaths) {\n \t\tif (dir.empty())\n \t\t\tcontinue;\ndiff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\nindex bc8ff090fa86..83efe1dc6368 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -125,9 +125,9 @@ IPAProxy::IPAProxy(IPAModule *ipam, const CameraManager &cm)\n \tconst GlobalConfiguration &configuration = cm._d()->configuration();\n \n \tconfigPaths_ = configuration.listOption({ \"ipa\", \"config_paths\" })\n-\t\t\t\t    .value_or(std::vector<std::string>());\n+\t\t\t\t    .value_or(utils::defopt);\n \texecPaths_ = configuration.listOption({ \"ipa\", \"proxy_paths\" })\n-\t\t\t\t  .value_or(std::vector<std::string>());\n+\t\t\t\t  .value_or(utils::defopt);\n }\n \n IPAProxy::~IPAProxy()\ndiff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\nindex c7799f2b4bd9..cc7e32c32337 100644\n--- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n+++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n@@ -2190,7 +2190,7 @@ int PiSPCameraData::configureEntities(V4L2SubdeviceFormat sensorFormat,\n \t};\n \tconst V4L2Subdevice::Stream embeddedDataStream{\n \t\tcsiVideoSinkPad,\n-\t\tsensor_->embeddedDataStream().value_or(V4L2Subdevice::Stream{}).stream\n+\t\tsensor_->embeddedDataStream().value_or(utils::defopt).stream\n \t};\n \n \tV4L2Subdevice::Routing routing;\ndiff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp\nindex a92f2e2944fc..1a0ba5fef3ca 100644\n--- a/src/v4l2/v4l2_compat_manager.cpp\n+++ b/src/v4l2/v4l2_compat_manager.cpp\n@@ -117,7 +117,7 @@ int V4L2CompatManager::getCameraIndex(int fd)\n \tfor (auto [index, camera] : utils::enumerate(cameras)) {\n \t\tSpan<const int64_t> devices = camera->properties()\n \t\t\t\t\t\t      .get(properties::SystemDevices)\n-\t\t\t\t\t\t      .value_or(Span<int64_t>{});\n+\t\t\t\t\t\t      .value_or(utils::defopt);\n \n \t\t/*\n \t\t * While there may be multiple cameras that could reference the\ndiff --git a/test/value-node.cpp b/test/value-node.cpp\nindex 3b6466e75b13..a6977d5429c8 100644\n--- a/test/value-node.cpp\n+++ b/test/value-node.cpp\n@@ -509,7 +509,7 @@ protected:\n \t\t\t\t},\n \n \t\t\t\t[&](const Size &arg) -> int {\n-\t\t\t\t\tif (node.get<Size>().value_or(Size{}) != arg ||\n+\t\t\t\t\tif (node.get<Size>().value_or(utils::defopt) != arg ||\n \t\t\t\t\t    node.get<Size>(Size{}) != arg) {\n \t\t\t\t\t\tstd::cerr\n \t\t\t\t\t\t\t<< \"Invalid node size value\"\n@@ -521,7 +521,7 @@ protected:\n \t\t\t\t},\n \n \t\t\t\t[&](const std::string &arg) -> int {\n-\t\t\t\t\tif (node.get<std::string>().value_or(std::string{}) != arg ||\n+\t\t\t\t\tif (node.get<std::string>().value_or(utils::defopt) != arg ||\n \t\t\t\t\t    node.get<std::string>(std::string{}) != arg) {\n \t\t\t\t\t\tstd::cerr\n \t\t\t\t\t\t\t<< \"Invalid node string value\"\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}