Patch Detail
Show a patch.
GET /api/1.1/patches/3241/?format=api
{ "id": 3241, "url": "https://patchwork.libcamera.org/api/1.1/patches/3241/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3241/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200323084430.GA7565@kaaira-HP-Pavilion-Notebook>", "date": "2020-03-23T08:44:53", "name": "[libcamera-devel,v3] libcamera: rkisp1: Use parametered constructor instead of default", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "36f84b856c305df06c7e1a6baa47c6a76b65d594", "submitter": { "id": 39, "url": "https://patchwork.libcamera.org/api/1.1/people/39/?format=api", "name": "Kaaira Gupta", "email": "kgupta@es.iitr.ac.in" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3241/mbox/", "series": [ { "id": 758, "url": "https://patchwork.libcamera.org/api/1.1/series/758/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=758", "date": "2020-03-23T08:44:53", "name": "[libcamera-devel,v3] libcamera: rkisp1: Use parametered constructor instead of default", "version": 3, "mbox": "https://patchwork.libcamera.org/series/758/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3241/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3241/checks/", "tags": {}, "headers": { "Return-Path": "<kgupta@es.iitr.ac.in>", "Received": [ "from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com\n\t[IPv6:2607:f8b0:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4049A60412\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Mar 2020 09:45:02 +0100 (CET)", "by mail-pf1-x42c.google.com with SMTP id z25so2843087pfa.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Mar 2020 01:45:02 -0700 (PDT)", "from kaaira-HP-Pavilion-Notebook ([103.113.213.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ts19sm12956408pfh.218.2020.03.23.01.44.57\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 23 Mar 2020 01:44:59 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:subject:message-id:mime-version:content-disposition\n\t:user-agent; bh=ENR2ZXbULvslVVT/YEa7TVoYRuaNKidlflmuKf7SFHo=;\n\tb=b6oGt/dXc7qmS83x5eXHuQ+lIWN5cXjP+yc5beE7DfMSziqTaHHvVFi7IW96aAEj3L\n\t3kqCH73WurMR0ialJ6PRG4X1w+Y0yiwC5j3K19RmIQG0oS/v/Rd19xLGb16qvVV7bQ+P\n\tnm9EaT9IXbqe+/KlTienysHzHGTNUqbP69j08hOHMpJsSUkctqQDTkgq4EC9nabK/zTi\n\tu10poAV/tzQAJHymnt/r3v1ghttykNDMeVV0Q5A2xoPyQm8fbg6+WTsA9FtQfWjFaiHT\n\tuESY8mFGjCeA0x8GDL6C5vk8ls3d8NMMdrJ1k3zN7Pk8tstA8/RLaA0FAtFo9qbGY0+b\n\tOXXg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:subject:message-id:mime-version\n\t:content-disposition:user-agent;\n\tbh=ENR2ZXbULvslVVT/YEa7TVoYRuaNKidlflmuKf7SFHo=;\n\tb=M71pd4sfMtO8oiEFmwxg8ot6gJA4LyZvE5IsGWfifLCcu0gjeirKamN1mJl+9TuZiN\n\tqb8f4BwhSSx33kt0ghPJ3cNFpmdimLb3rrYWDOycZN6q3sM/vEVm3xJIn0MigT3EJzKg\n\tpWePH6Uhva5aBy9aYw4eHwx09zxNCBRmQhWoRNl+dChFVkY9xR3OpEdvosBqDGpmqq61\n\tYQlLiF64ci4NhvY14iFtJOCAWgpGeTgj0w2WRYiLOxcpyqBQIseFJhzm/F6L5pKXvxIQ\n\tfOUrQoWwGStmTRFCMT+RxlBNXpb7LGBFtqTJKS9RhNdz/ND8F+B21TMbqPQ9M/SRX4NU\n\t3FLw==", "X-Gm-Message-State": "ANhLgQ1HKJofHEpiBgmR3Xk1cAqpuYsR/HuEeHNw71LN96OTPTPIqHz9\n\tAUvsRjO0yJfrnVtI7sqXeiwgvX2vsldjcQ==", "X-Google-Smtp-Source": "ADFU+vvJP81QrtTtrGqjdpbgbiRsx4IF5uNFSZvZ/NPakdDka0f7P31Kz5u5x2n7HcQoQ35PWttjIg==", "X-Received": "by 2002:a62:447:: with SMTP id 68mr22814466pfe.174.1584953100252;\n\tMon, 23 Mar 2020 01:45:00 -0700 (PDT)", "Date": "Mon, 23 Mar 2020 14:14:53 +0530", "From": "Kaaira Gupta <kgupta@es.iitr.ac.in>", "To": "libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com,\n\tHelen Koike <helen.koike@collabora.com>,\n\tVaishali Thakkar <vthakkar@vaishalithakkar.in>", "Message-ID": "<20200323084430.GA7565@kaaira-HP-Pavilion-Notebook>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "User-Agent": "Mutt/1.9.4 (2018-02-28)", "Subject": "[libcamera-devel] [PATCH LIBCAMERA v3] libcamera: rkisp1: Use\n\tparametered constructor instead of default", "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>", "X-List-Received-Date": "Mon, 23 Mar 2020 08:45:03 -0000" }, "content": "Use of default constructor StreamConfiguration() is deprecated, hence\nmake it private. Make Stream class a friend of StreamConfiguration as it\nuses the default constructor.\n\nReplace default constructor StreamConfiguration() by it's parametered\ncounterpart by using StreamFormats in generateConfiguration() in rkisp1\n\nAlso, use erase(), instead of replace() in validate() to prevent it from\ncreating a new instance with empty constructor.\n\nSigned-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n---\n\nChanges since v1:\n\t- replace resize() by erase() in validate() to prevent it from\ncreating a new instance with empty constructor.\nChanges since v2:\n\t- Rearaange the order of declaration of friend class.\n\t- Add constructor implementation again to stream.cpp\n\t- Corrections in range of erase()\n\ninclude/libcamera/stream.h | 4 ++-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 39 ++++++++++++++++--------\n src/libcamera/stream.cpp | 6 ++--\n 3 files changed, 32 insertions(+), 17 deletions(-)", "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex b1441f8..a379ebb 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -37,7 +37,6 @@ private:\n };\n \n struct StreamConfiguration {\n-\tStreamConfiguration();\n \tStreamConfiguration(const StreamFormats &formats);\n \n \tPixelFormat pixelFormat;\n@@ -52,6 +51,9 @@ struct StreamConfiguration {\n \tstd::string toString() const;\n \n private:\n+\tfriend class Stream;\n+\tStreamConfiguration();\n+\n \tStream *stream_;\n \tStreamFormats formats_;\n };\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 2f909ce..6839e3c 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -218,6 +218,21 @@ private:\n \tCamera *activeCamera_;\n };\n \n+namespace {\n+\n+static const std::array<PixelFormat, 8> formats{\n+\tPixelFormat(DRM_FORMAT_YUYV),\n+\tPixelFormat(DRM_FORMAT_YVYU),\n+\tPixelFormat(DRM_FORMAT_VYUY),\n+\tPixelFormat(DRM_FORMAT_NV16),\n+\tPixelFormat(DRM_FORMAT_NV61),\n+\tPixelFormat(DRM_FORMAT_NV21),\n+\tPixelFormat(DRM_FORMAT_NV12),\n+\t/* \\todo Add support for 8-bit greyscale to DRM formats */\n+};\n+\n+} /* namespace */\n+\n RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)\n \t: pipe_(dynamic_cast<PipelineHandlerRkISP1 *>(pipe))\n {\n@@ -430,17 +445,6 @@ RkISP1CameraConfiguration::RkISP1CameraConfiguration(Camera *camera,\n \n CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n {\n-\tstatic const std::array<PixelFormat, 8> formats{\n-\t\tPixelFormat(DRM_FORMAT_YUYV),\n-\t\tPixelFormat(DRM_FORMAT_YVYU),\n-\t\tPixelFormat(DRM_FORMAT_VYUY),\n-\t\tPixelFormat(DRM_FORMAT_NV16),\n-\t\tPixelFormat(DRM_FORMAT_NV61),\n-\t\tPixelFormat(DRM_FORMAT_NV21),\n-\t\tPixelFormat(DRM_FORMAT_NV12),\n-\t\t/* \\todo Add support for 8-bit greyscale to DRM formats */\n-\t};\n-\n \tconst CameraSensor *sensor = data_->sensor_;\n \tStatus status = Valid;\n \n@@ -449,7 +453,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > 1) {\n-\t\tconfig_.resize(1);\n+\t\tconfig_.erase(config_.begin() + 1, config_.end());\n \t\tstatus = Adjusted;\n \t}\n \n@@ -537,7 +541,16 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera\n \tif (roles.empty())\n \t\treturn config;\n \n-\tStreamConfiguration cfg{};\n+\tstd::map<PixelFormat, std::vector<SizeRange>> pixelformats;\n+\n+\tfor (PixelFormat pixelformat : formats) {\n+\t\tstd::vector<SizeRange> sizes{\n+\t\t\tSizeRange{ { 32, 16 }, { 4416, 3312 } }\n+\t\t};\n+\t\tpixelformats[pixelformat] = sizes;\n+\t}\n+\tStreamFormats format(pixelformats);\n+\tStreamConfiguration cfg(format);\n \tcfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);\n \tcfg.size = data->sensor_->resolution();\n \ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex ea3d214..7e41378 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -275,9 +275,9 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n */\n \n /**\n- * \\todo This method is deprecated and should be removed once all pipeline\n- * handlers provied StreamFormats.\n- */\n+* \\todo This method is deprecated and should be removed once all pipeline\n+* handlers provied StreamFormats.\n+*/\n StreamConfiguration::StreamConfiguration()\n \t: pixelFormat(0), stream_(nullptr)\n {\n", "prefixes": [ "libcamera-devel", "v3" ] }