Show a patch.

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

{
    "id": 15351,
    "url": "https://patchwork.libcamera.org/api/patches/15351/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15351/",
    "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": "<20220209071917.559993-8-hanlinchen@chromium.org>",
    "date": "2022-02-09T07:19:15",
    "name": "[libcamera-devel,7/9] libcamera: ipu3: Add helper class PipeConfigPreference",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "84719772392c711e82e3b7eb27370db21385e67c",
    "submitter": {
        "id": 98,
        "url": "https://patchwork.libcamera.org/api/people/98/?format=api",
        "name": "Hanlin Chen",
        "email": "hanlinchen@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15351/mbox/",
    "series": [
        {
            "id": 2923,
            "url": "https://patchwork.libcamera.org/api/series/2923/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2923",
            "date": "2022-02-09T07:19:08",
            "name": "Introduce Pipeline configuration preference for IPU3",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2923/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15351/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15351/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 21FCCC3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Feb 2022 07:19:47 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BBE52610DA;\n\tWed,  9 Feb 2022 08:19:42 +0100 (CET)",
            "from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com\n\t[IPv6:2607:f8b0:4864:20::62f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E6C0060202\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  9 Feb 2022 08:19:40 +0100 (CET)",
            "by mail-pl1-x62f.google.com with SMTP id k17so1516594plk.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Feb 2022 23:19:40 -0800 (PST)",
            "from localhost ([2401:fa00:1:10:a5cf:9a43:1c6d:824])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\tc7sm18094412pfp.164.2022.02.08.23.19.37\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 08 Feb 2022 23:19:38 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"X5Fz9p7o\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=BXvbw/qFuh4/mv/AibxotkM+baDpuUOcjWD8E0nJer0=;\n\tb=X5Fz9p7o2v10nwD/Yv/oZkL8s5HINCb4vsc4Cpp7IrS1NDB0jeIQP2LPdmTuvBNFOg\n\tMRocsgb//OiBX70J/UuhUWolk1Fin/PbMhFemGwvneYhA7JPQb9f1J38HGeOs0xG6eDw\n\tflQfYnpltzUZVH3dzuwQn8MHMRSkDaEEYCpjU=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=BXvbw/qFuh4/mv/AibxotkM+baDpuUOcjWD8E0nJer0=;\n\tb=s0BnVde0kq00TQKIV/kNcT4F6u1ry/HO0hg3QOEVlr7HA4kQ9TnqMKOKIX7FNEbT3e\n\tDBl/2DhlGljPvU6v8tfrXQVxXhASz1k5DL004D6SC7WtKLioi5V1UJl7l8OtYLHVTqyC\n\txhh/hvKr1KlkgVPF+5T6na0bXVXq1Pn4xentCR3DtuuEnSM/sg3Lhv31RsrWbFPuOvtW\n\tFZkjSUKGzZIMTMHUlXvnPOMHpNGTN6RRh1EyCFa9+UJnpBNg4Kbz9uWBdgplNRnKt69d\n\trEmUjZDoLQAalSXuZQn/dPMWIMX5vltqP0TgQVr7GvztiETzgwM+ZEKy1/G0Cx0muXkd\n\tejqQ==",
        "X-Gm-Message-State": "AOAM530Bb43XXFth1YOsxUi9F2OdgBv5QVDQKPDDP7tPnka9cR19n7Ms\n\tx3WvqnMuwHkVQmx0iTV1iNvzGk7nYOJfvg==",
        "X-Google-Smtp-Source": "ABdhPJxC0Uty7ZeV42eb0fBswVHFjDiKbb5Ozap1sU/j0O9JsSTDSKNmo88XJ6/Xaco7nLh5EbtmHw==",
        "X-Received": "by 2002:a17:902:ba98:: with SMTP id\n\tk24mr925032pls.44.1644391178659; \n\tTue, 08 Feb 2022 23:19:38 -0800 (PST)",
        "From": "Han-Lin Chen <hanlinchen@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  9 Feb 2022 15:19:15 +0800",
        "Message-Id": "<20220209071917.559993-8-hanlinchen@chromium.org>",
        "X-Mailer": "git-send-email 2.35.0.263.gb82422642f-goog",
        "In-Reply-To": "<20220209071917.559993-1-hanlinchen@chromium.org>",
        "References": "<20220209071917.559993-1-hanlinchen@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 7/9] libcamera: ipu3: Add helper class\n\tPipeConfigPreference",
        "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": "Add helper class PipeConfigPreference to load the caliberated ipu3\npipeline configuration files, and provides query interface for the\npipeline handler.\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n---\n include/libcamera/geometry.h                  |   4 +\n src/libcamera/geometry.cpp                    |  20 ++\n src/libcamera/pipeline/ipu3/meson.build       |   1 +\n .../pipeline/ipu3/pipe_config_pref.cpp        | 285 ++++++++++++++++++\n .../pipeline/ipu3/pipe_config_pref.h          |  80 +++++\n 5 files changed, 390 insertions(+)\n create mode 100644 src/libcamera/pipeline/ipu3/pipe_config_pref.cpp\n create mode 100644 src/libcamera/pipeline/ipu3/pipe_config_pref.h",
    "diff": "diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex 7838b679..ede54981 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -46,6 +46,8 @@ static inline bool operator!=(const Point &lhs, const Point &rhs)\n \treturn !(lhs == rhs);\n }\n \n+std::ostream &operator<<(std::ostream &out, const Point &d);\n+\n class Size\n {\n public:\n@@ -192,6 +194,8 @@ static inline bool operator>=(const Size &lhs, const Size &rhs)\n \treturn !(lhs < rhs);\n }\n \n+std::ostream &operator<<(std::ostream &out, const Size &s);\n+\n class SizeRange\n {\n public:\ndiff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\nindex cb3c2de1..a65f9f2f 100644\n--- a/src/libcamera/geometry.cpp\n+++ b/src/libcamera/geometry.cpp\n@@ -83,6 +83,16 @@ bool operator==(const Point &lhs, const Point &rhs)\n  * \\return True if the two points are not equal, false otherwise\n  */\n \n+/**\n+ * \\brief Insert operation for Point with ostream\n+ * \\return The input std::ostream\n+ */\n+std::ostream &operator<<(std::ostream &out, const Point &p)\n+{\n+\tout << \"(\" << p.x << \", \" << p.y << \")\";\n+\treturn out;\n+}\n+\n /**\n  * \\struct Size\n  * \\brief Describe a two-dimensional size\n@@ -428,6 +438,16 @@ bool operator<(const Size &lhs, const Size &rhs)\n  * \\sa bool operator<(const Size &lhs, const Size &rhs)\n  */\n \n+/**\n+ * \\brief Insert operation for Size with ostream\n+ * \\return The input std::ostream\n+ */\n+std::ostream &operator<<(std::ostream &out, const Size &s)\n+{\n+\tout << s.width << \"x\" << s.height;\n+\treturn out;\n+}\n+\n /**\n  * \\struct SizeRange\n  * \\brief Describe a range of sizes\ndiff --git a/src/libcamera/pipeline/ipu3/meson.build b/src/libcamera/pipeline/ipu3/meson.build\nindex a1b0b31a..dcc450f0 100644\n--- a/src/libcamera/pipeline/ipu3/meson.build\n+++ b/src/libcamera/pipeline/ipu3/meson.build\n@@ -5,4 +5,5 @@ libcamera_sources += files([\n     'frames.cpp',\n     'imgu.cpp',\n     'ipu3.cpp',\n+    'pipe_config_pref.cpp',\n ])\ndiff --git a/src/libcamera/pipeline/ipu3/pipe_config_pref.cpp b/src/libcamera/pipeline/ipu3/pipe_config_pref.cpp\nnew file mode 100644\nindex 00000000..5b4a17c9\n--- /dev/null\n+++ b/src/libcamera/pipeline/ipu3/pipe_config_pref.cpp\n@@ -0,0 +1,285 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * pipe_config_pref.cpp - Helper class for IPU3 pipeline config preference\n+ */\n+\n+#include \"pipe_config_pref.h\"\n+\n+#include <libcamera/base/log.h>\n+\n+#include <libcamera/internal/yaml_parser.h>\n+\n+namespace libcamera {\n+\n+LOG_DECLARE_CATEGORY(IPU3)\n+\n+namespace {\n+\n+std::ostream &operator<<(std::ostream &out,\n+\t\t\t const PipeConfigPreference::PipeConfig &d)\n+{\n+\tout << \"cio2: \" << d.cio2 << \" bds: \" << d.bds\n+\t    << \" gdc: \" << d.gdc << \" iff: \" << d.iff\n+\t    << \" main: \" << d.main << \" viewfinder: \" << d.viewfinder;\n+\treturn out;\n+}\n+\n+int loadPipeConfig(const YamlObject &yamlObject,\n+\t\t   PipeConfigPreference::PipeConfig &pipeConfig)\n+{\n+\tif (!yamlObject.isMember(\"bds\") ||\n+\t    !yamlObject.isMember(\"gdc\") ||\n+\t    !yamlObject.isMember(\"iff\") ||\n+\t    !yamlObject.isMember(\"cio2\") ||\n+\t    !yamlObject.isMember(\"main\") ||\n+\t    !yamlObject.isMember(\"viewfinder\")) {\n+\t\tLOG(IPU3, Error) << \"Missing mandatory attributes in a config\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tpipeConfig.bds = yamlObject.get(\"bds\").asSize();\n+\tpipeConfig.gdc = yamlObject.get(\"gdc\").asSize();\n+\tpipeConfig.iff = yamlObject.get(\"iff\").asSize();\n+\tpipeConfig.cio2 = yamlObject.get(\"cio2\").asSize();\n+\tpipeConfig.main = yamlObject.get(\"main\").asSize();\n+\tpipeConfig.viewfinder = yamlObject.get(\"viewfinder\").asSize();\n+\n+\treturn 0;\n+}\n+\n+int loadPipeConfigs(const YamlObject &yamlPipeConfigs,\n+\t\t    std::vector<PipeConfigPreference::PipeConfig> &pipeConfigs,\n+\t\t    Size &maxResolution, Size &minResolution)\n+{\n+\tfor (int i = 0; i < yamlPipeConfigs.length(); i++) {\n+\t\tconst YamlObject &yamlConfig = yamlPipeConfigs[i];\n+\t\tpipeConfigs.emplace_back();\n+\t\tif (loadPipeConfig(yamlConfig, pipeConfigs.back()))\n+\t\t\treturn -EINVAL;\n+\t}\n+\n+\tif (pipeConfigs.size() == 0)\n+\t\treturn -EINVAL;\n+\n+\tmaxResolution = minResolution = pipeConfigs[0].main;\n+\n+\tfor (const PipeConfigPreference::PipeConfig &config : pipeConfigs) {\n+\t\tmaxResolution.expandTo(config.main);\n+\t\tminResolution.boundTo(config.main);\n+\t}\n+\n+\t/* Sort configs by the size of the cio2 */\n+\tsort(pipeConfigs.begin(), pipeConfigs.end(),\n+\t     [](const auto &a, const auto &b) -> bool {\n+\t\t     return a.cio2 < b.cio2;\n+\t     });\n+\n+\treturn 0;\n+}\n+\n+} /* namespace */\n+\n+PipeConfigPreference::PipeConfigPreference()\n+\t: valid_(false)\n+{\n+}\n+\n+/**\n+ * \\struct PipeConfig\n+ * \\brief Describe a valid ImgU configuration\n+ *\n+ * The ImgU unit processes images through several components, which have\n+ * to be properly configured inspecting the input image size and the desired\n+ * output sizes. This structure collects the ImgU configuration for IF, BDS\n+ * and GDC, and the requested main output, viewfinder and the input (CIO2)\n+ * resolutions.\n+ */\n+\n+/**\n+ * \\brief Parse the configuration file from a path\n+ * \\param[in] path The path to the configuration file\n+ *\n+ * Parse the configuration file from a path and set isValid() to true if\n+ * success.\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int PipeConfigPreference::parsePreferenceFile(const std::string &path)\n+{\n+\tvalid_ = false;\n+\n+\tFILE *fh = fopen(path.c_str(), \"r\");\n+\tif (!fh) {\n+\t\tLOG(IPU3, Error) << \"Fail to open file: \" << path;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tYamlParser yamlParser;\n+\tYamlObject yamlObjectPreference;\n+\n+\tint ret = yamlParser.ParseAsYamlObject(fh, yamlObjectPreference);\n+\tfclose(fh);\n+\n+\tif (ret)\n+\t\treturn -EINVAL;\n+\n+\tret = load(yamlObjectPreference);\n+\n+\tif (ret)\n+\t\treturn -EINVAL;\n+\n+\tvalid_ = true;\n+\treturn 0;\n+}\n+\n+/**\n+ * \\brief Query the valid pipeline configuration for video and still pipe\n+ * \\param[in] videoMain The size of main output from video pipe\n+ * \\param[in] videoViewfinder The size of viewfinder output from video pipe\n+ * \\param[in] stillMain The size of main output from still pipe\n+ * \\param[in] stillViewfinder The size of viewfinder output from still pipe\n+ * \\param[out] videoResult The ImgU setting for video pipe\n+ * \\param[out] stillResult The ImgU setting for still pipe\n+ *\n+ * Helper function to query valid settings for ImgU with the desired\n+ * output resolutions. The query interface is based on the assumption\n+ * that both video and still ImgU might be used together.\n+ * An output can be set disabled if not required. If both main and viewfinder\n+ * are set disabled for a ImgU, video or still, the corresponding pipeConfig\n+ * undefined. For example, a typical usage is to only one video output is\n+ * required, the user may set:\n+ *\n+ * videoMain = [width, height]\n+ * videoViewfinder = Disabled\n+ * stillMain = Disabled\n+ * stillViewfinder = Disabled\n+ *\n+ * In the case, only the videoResult would be valid, since still pipe is not\n+ * used. When both video and still ImgU are used, their cio2 will have the\n+ * same resolution, since they should use the same raw capture.\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int PipeConfigPreference::queryPipeConfig(\n+\tconst Size &videoMain, const Size &videoViewfinder,\n+\tconst Size &stillMain, const Size &stillViewfinder,\n+\tPipeConfig &videoResult, PipeConfig &stillResult) const\n+{\n+\tbool hasVideo = (videoMain != Disabled) && (videoMain >= videoViewfinder);\n+\tbool hasStill = (stillMain != Disabled) && (stillMain >= stillViewfinder);\n+\n+\tif (!hasStill && !hasVideo)\n+\t\treturn -EINVAL;\n+\n+\tstd::vector<PipeConfig> validVideoConfigs;\n+\tstd::vector<PipeConfig> validStillConfigs;\n+\n+\tfor (auto &config : videoPipeConfigs_) {\n+\t\tif (config.main == videoMain && config.viewfinder == videoViewfinder)\n+\t\t\tvalidVideoConfigs.emplace_back(config);\n+\t}\n+\n+\tfor (auto &config : stillPipeConfigs_) {\n+\t\tif (config.main == stillMain && config.viewfinder == stillViewfinder)\n+\t\t\tvalidStillConfigs.emplace_back(config);\n+\t}\n+\n+\t/*\n+\t * Since the configurations are sorted by the size of CIO2, pick\n+\t * the first valid resolution for lower bandwith.\n+\t */\n+\tif (hasVideo && !hasStill) {\n+\t\tif (validVideoConfigs.empty())\n+\t\t\treturn -EINVAL;\n+\t\tvideoResult = validVideoConfigs[0];\n+\t\treturn 0;\n+\t}\n+\n+\tif (hasStill && !hasVideo) {\n+\t\tif (validStillConfigs.empty())\n+\t\t\treturn -EINVAL;\n+\t\tstillResult = validStillConfigs[0];\n+\t\treturn 0;\n+\t}\n+\n+\t/* (hasVideo && hasStill) */\n+\tbool found = false;\n+\tfor (const PipeConfig &videoConfig : validVideoConfigs) {\n+\t\tfor (const PipeConfig &stillConfig : validVideoConfigs) {\n+\t\t\tif (videoConfig.cio2 == stillConfig.cio2) {\n+\t\t\t\tfound = true;\n+\t\t\t\tvideoResult = videoConfig;\n+\t\t\t\tstillResult = stillConfig;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn (found) ? 0 : -EINVAL;\n+}\n+\n+void PipeConfigPreference::dump()\n+{\n+\tLOG(IPU3, Debug) << \"Video Pipe configs: \";\n+\tfor (auto &configs : videoPipeConfigs_) {\n+\t\tLOG(IPU3, Debug) << configs;\n+\t}\n+\n+\tLOG(IPU3, Debug) << \"Still Pipe configs: \";\n+\tfor (auto &configs : stillPipeConfigs_) {\n+\t\tLOG(IPU3, Debug) << configs;\n+\t}\n+}\n+\n+int PipeConfigPreference::load(const YamlObject &configs)\n+{\n+\t/*\n+\t * Load the pipeline configure file properties.\n+\t *\n+\t * Each valid configuration is a list of properties associated\n+\t * with the corresponding IMGU settings and grouped into still\n+\t * and video modes. For each configuration, the main output should\n+\t * be valid, and the viewfinder is optional. If the viewfinder is\n+\t * disabled, its width and height should be set to [0, 0];\n+\t *\n+\t * still_mode:\n+\t * - bds: [width, height]\n+\t *   cio2: [width, height]\n+\t *   gdc: [width, height]\n+\t *   iff: [width, height]\n+\t *   main: [width, height]\n+\t *   viewfinder: [0, 0]\n+\t * ...\n+\t *\n+\t * video_mode:\n+\t * - bds: [width, height]\n+\t *   cio2: [width, height]\n+\t *   gdc: [width, height]\n+\t *   iff: [width, height]\n+\t *   main: [width, height]\n+\t *   viewfinder: [0, 0]\n+\t * ...\n+\t */\n+\n+\tif (!configs.isMember(\"video_mode\") || !configs.isMember(\"still_mode\"))\n+\t\treturn -EINVAL;\n+\n+\tvideoPipeConfigs_.clear();\n+\tstillPipeConfigs_.clear();\n+\n+\tint ret = loadPipeConfigs(configs.get(\"video_mode\"), videoPipeConfigs_,\n+\t\t\t\t  maxVideoResolution_, minVideoResolution_);\n+\tif (ret)\n+\t\treturn -EINVAL;\n+\n+\tret = loadPipeConfigs(configs.get(\"still_mode\"), stillPipeConfigs_,\n+\t\t\t      maxStillResolution_, minStillResolution_);\n+\tif (ret)\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/ipu3/pipe_config_pref.h b/src/libcamera/pipeline/ipu3/pipe_config_pref.h\nnew file mode 100644\nindex 00000000..08626d4e\n--- /dev/null\n+++ b/src/libcamera/pipeline/ipu3/pipe_config_pref.h\n@@ -0,0 +1,80 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * pipe_config_pref.h - Helper class for IPU3 pipeline config preference\n+ */\n+\n+#pragma once\n+\n+#include <vector>\n+\n+#include <libcamera/geometry.h>\n+\n+namespace libcamera {\n+\n+class YamlObject;\n+\n+class PipeConfigPreference final\n+{\n+public:\n+\tconstexpr static Size Disabled = Size(0, 0);\n+\n+\tstruct PipeConfig {\n+\t\tSize cio2;\n+\t\tSize bds;\n+\t\tSize gdc;\n+\t\tSize iff;\n+\t\tSize main;\n+\t\tSize viewfinder;\n+\t};\n+\n+\tPipeConfigPreference();\n+\n+\tint parsePreferenceFile(const std::string &path);\n+\tbool isValid() const\n+\t{\n+\t\treturn valid_;\n+\t}\n+\tbool invalid()\n+\t{\n+\t\treturn valid_ = false;\n+\t}\n+\tSize maxVideoResolution()\n+\t{\n+\t\treturn maxVideoResolution_;\n+\t}\n+\tSize maxStillResolution()\n+\t{\n+\t\treturn maxStillResolution_;\n+\t}\n+\tSize minVideoResolution()\n+\t{\n+\t\treturn minVideoResolution_;\n+\t}\n+\tSize minStillResolution()\n+\t{\n+\t\treturn minStillResolution_;\n+\t}\n+\n+\tint queryPipeConfig(const Size &videoMain, const Size &videoViewfinder,\n+\t\t\t    const Size &stillMain, const Size &stillViewfinder,\n+\t\t\t    PipeConfig &videoPipeConfig,\n+\t\t\t    PipeConfig &stillPipeConfig) const;\n+\tvoid dump();\n+\n+private:\n+\tint load(const YamlObject &object);\n+\tbool valid_;\n+\n+\tstd::vector<PipeConfig> videoPipeConfigs_;\n+\tstd::vector<PipeConfig> stillPipeConfigs_;\n+\n+\tSize maxVideoResolution_;\n+\tSize maxStillResolution_;\n+\n+\tSize minVideoResolution_;\n+\tSize minStillResolution_;\n+};\n+\n+} /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "7/9"
    ]
}