Show a patch.

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

{
    "id": 3139,
    "url": "https://patchwork.libcamera.org/api/patches/3139/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3139/",
    "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": "<20200317035239.2697679-9-niklas.soderlund@ragnatech.se>",
    "date": "2020-03-17T03:52:39",
    "name": "[libcamera-devel,v2,8/8] libcamera: PixelFormat: Mark all function arguments of type PixelFormat as const reference",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a806ce2e0844e70b3458e0b6f429797252336e10",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3139/mbox/",
    "series": [
        {
            "id": 726,
            "url": "https://patchwork.libcamera.org/api/series/726/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=726",
            "date": "2020-03-17T03:52:31",
            "name": "libcamera: PixelFormat: Turn into a class",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/726/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3139/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3139/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 13210629CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Mar 2020 04:53:42 +0100 (CET)",
            "from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid dd1a5ddf-6802-11ea-aa6d-005056917f90;\n\tTue, 17 Mar 2020 04:53:29 +0100 (CET)"
        ],
        "X-Halon-ID": "dd1a5ddf-6802-11ea-aa6d-005056917f90",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 17 Mar 2020 04:52:39 +0100",
        "Message-Id": "<20200317035239.2697679-9-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200317035239.2697679-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200317035239.2697679-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 8/8] libcamera: PixelFormat: Mark all\n\tfunction arguments of type PixelFormat as const reference",
        "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": "Tue, 17 Mar 2020 03:53:42 -0000"
    },
    "content": "PixelFormat was previously an alias for unsigned int but are now a\nclass. Make all functions taking PixelFormat do so as a const reference.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/stream.h               | 4 ++--\n src/libcamera/include/v4l2_videodevice.h | 5 +++--\n src/libcamera/stream.cpp                 | 4 ++--\n src/libcamera/v4l2_videodevice.cpp       | 5 +++--\n src/qcam/format_converter.cpp            | 4 ++--\n src/qcam/format_converter.h              | 2 +-\n src/qcam/viewfinder.cpp                  | 4 ++--\n src/qcam/viewfinder.h                    | 2 +-\n src/v4l2/v4l2_camera.cpp                 | 2 +-\n src/v4l2/v4l2_camera.h                   | 2 +-\n src/v4l2/v4l2_camera_proxy.cpp           | 2 +-\n src/v4l2/v4l2_camera_proxy.h             | 2 +-\n 12 files changed, 20 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 29a8030dff71d58f..b1441f8ec6749fda 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -28,9 +28,9 @@ public:\n \tStreamFormats(const std::map<PixelFormat, std::vector<SizeRange>> &formats);\n \n \tstd::vector<PixelFormat> pixelformats() const;\n-\tstd::vector<Size> sizes(PixelFormat pixelformat) const;\n+\tstd::vector<Size> sizes(const PixelFormat &pixelformat) const;\n \n-\tSizeRange range(PixelFormat pixelformat) const;\n+\tSizeRange range(const PixelFormat &pixelformat) const;\n \n private:\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats_;\ndiff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\nindex 62e6a657fc7eedb0..252820cba3fdc7a3 100644\n--- a/src/libcamera/include/v4l2_videodevice.h\n+++ b/src/libcamera/include/v4l2_videodevice.h\n@@ -206,8 +206,9 @@ public:\n \t\t\t\t\t       const std::string &entity);\n \n \tstatic PixelFormat toPixelFormat(uint32_t v4l2Fourcc);\n-\tuint32_t toV4L2Fourcc(PixelFormat pixelFormat);\n-\tstatic uint32_t toV4L2Fourcc(PixelFormat pixelFormat, bool multiplanar);\n+\tuint32_t toV4L2Fourcc(const PixelFormat &pixelFormat);\n+\tstatic uint32_t toV4L2Fourcc(const PixelFormat &pixelFormat,\n+\t\t\t\t     bool multiplanar);\n \n protected:\n \tstd::string logPrefix() const;\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 0716de388bd81d80..e61484caf7157da5 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -127,7 +127,7 @@ std::vector<PixelFormat> StreamFormats::pixelformats() const\n  *\n  * \\return A list of frame sizes or an empty list on error\n  */\n-std::vector<Size> StreamFormats::sizes(PixelFormat pixelformat) const\n+std::vector<Size> StreamFormats::sizes(const PixelFormat &pixelformat) const\n {\n \t/*\n \t * Sizes to try and extract from ranges.\n@@ -240,7 +240,7 @@ std::vector<Size> StreamFormats::sizes(PixelFormat pixelformat) const\n  *\n  * \\return A range of valid image sizes or an empty range on error\n  */\n-SizeRange StreamFormats::range(PixelFormat pixelformat) const\n+SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n {\n \tauto const it = formats_.find(pixelformat);\n \tif (it == formats_.end())\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex d8d711a951d666e9..40f431abb0dba721 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1623,7 +1623,7 @@ PixelFormat V4L2VideoDevice::toPixelFormat(uint32_t v4l2Fourcc)\n  *\n  * \\return The V4L2_PIX_FMT_* pixel format code corresponding to \\a pixelFormat\n  */\n-uint32_t V4L2VideoDevice::toV4L2Fourcc(PixelFormat pixelFormat)\n+uint32_t V4L2VideoDevice::toV4L2Fourcc(const PixelFormat &pixelFormat)\n {\n \treturn V4L2VideoDevice::toV4L2Fourcc(pixelFormat, caps_.isMultiplanar());\n }\n@@ -1641,7 +1641,8 @@ uint32_t V4L2VideoDevice::toV4L2Fourcc(PixelFormat pixelFormat)\n  *\n  * \\return The V4L2_PIX_FMT_* pixel format code corresponding to \\a pixelFormat\n  */\n-uint32_t V4L2VideoDevice::toV4L2Fourcc(PixelFormat pixelFormat, bool multiplanar)\n+uint32_t V4L2VideoDevice::toV4L2Fourcc(const PixelFormat &pixelFormat,\n+\t\t\t\t       bool multiplanar)\n {\n \tswitch (pixelFormat.fourcc()) {\n \t/* RGB formats. */\ndiff --git a/src/qcam/format_converter.cpp b/src/qcam/format_converter.cpp\nindex c071ea9b4022750c..b72e8342135d3c39 100644\n--- a/src/qcam/format_converter.cpp\n+++ b/src/qcam/format_converter.cpp\n@@ -27,8 +27,8 @@\n #define CLIP(x)\t\t\tCLAMP(x,0,255)\n #endif\n \n-int FormatConverter::configure(libcamera::PixelFormat format, unsigned int width,\n-\t\t\t       unsigned int height)\n+int FormatConverter::configure(const libcamera::PixelFormat &format,\n+\t\t\t       unsigned int width, unsigned int height)\n {\n \tswitch (format.fourcc()) {\n \tcase DRM_FORMAT_NV12:\ndiff --git a/src/qcam/format_converter.h b/src/qcam/format_converter.h\nindex ff488b994ade3c3e..96bde2384ddfecc9 100644\n--- a/src/qcam/format_converter.h\n+++ b/src/qcam/format_converter.h\n@@ -16,7 +16,7 @@ class QImage;\n class FormatConverter\n {\n public:\n-\tint configure(libcamera::PixelFormat format, unsigned int width,\n+\tint configure(const libcamera::PixelFormat &format, unsigned int width,\n \t\t      unsigned int height);\n \n \tvoid convert(const unsigned char *src, size_t size, QImage *dst);\ndiff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp\nindex 0ebb8edd49efd1b1..e9d5cc1e014b048b 100644\n--- a/src/qcam/viewfinder.cpp\n+++ b/src/qcam/viewfinder.cpp\n@@ -44,8 +44,8 @@ QImage ViewFinder::getCurrentImage()\n \treturn image_->copy();\n }\n \n-int ViewFinder::setFormat(libcamera::PixelFormat format, unsigned int width,\n-\t\t\t  unsigned int height)\n+int ViewFinder::setFormat(const libcamera::PixelFormat &format,\n+\t\t\t  unsigned int width, unsigned int height)\n {\n \tint ret;\n \ndiff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h\nindex 2668aa4457657ef9..0549f038edd6c3b5 100644\n--- a/src/qcam/viewfinder.h\n+++ b/src/qcam/viewfinder.h\n@@ -22,7 +22,7 @@ public:\n \tViewFinder(QWidget *parent);\n \t~ViewFinder();\n \n-\tint setFormat(libcamera::PixelFormat format, unsigned int width,\n+\tint setFormat(const libcamera::PixelFormat &format, unsigned int width,\n \t\t      unsigned int height);\n \tvoid display(const unsigned char *rgb, size_t size);\n \ndiff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\nindex f0b9f1804c94378a..ecbb70acfb8eeb52 100644\n--- a/src/v4l2/v4l2_camera.cpp\n+++ b/src/v4l2/v4l2_camera.cpp\n@@ -88,7 +88,7 @@ void V4L2Camera::requestComplete(Request *request)\n }\n \n int V4L2Camera::configure(StreamConfiguration *streamConfigOut,\n-\t\t\t  const Size &size, PixelFormat pixelformat,\n+\t\t\t  const Size &size, const PixelFormat &pixelformat,\n \t\t\t  unsigned int bufferCount)\n {\n \tStreamConfiguration &streamConfig = config_->at(0);\ndiff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h\nindex 37bd358462db190d..130995d95eb4bd4c 100644\n--- a/src/v4l2/v4l2_camera.h\n+++ b/src/v4l2/v4l2_camera.h\n@@ -43,7 +43,7 @@ public:\n \tstd::vector<Buffer> completedBuffers();\n \n \tint configure(StreamConfiguration *streamConfigOut,\n-\t\t      const Size &size, PixelFormat pixelformat,\n+\t\t      const Size &size, const PixelFormat &pixelformat,\n \t\t      unsigned int bufferCount);\n \n \tint allocBuffers(unsigned int count);\ndiff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 55dd69d37bd65897..d519af85a9e0b300 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -599,7 +599,7 @@ PixelFormat V4L2CameraProxy::v4l2ToDrm(uint32_t format)\n \treturn info->format;\n }\n \n-uint32_t V4L2CameraProxy::drmToV4L2(PixelFormat format)\n+uint32_t V4L2CameraProxy::drmToV4L2(const PixelFormat &format)\n {\n \tauto info = std::find_if(pixelFormatInfo.begin(), pixelFormatInfo.end(),\n \t\t\t\t [format](const PixelFormatInfo &info) {\ndiff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\nindex c8e61adf80f1b93b..e15b230d5f23f119 100644\n--- a/src/v4l2/v4l2_camera_proxy.h\n+++ b/src/v4l2/v4l2_camera_proxy.h\n@@ -60,7 +60,7 @@ private:\n \t\t\t\t      unsigned int height);\n \n \tstatic PixelFormat v4l2ToDrm(uint32_t format);\n-\tstatic uint32_t drmToV4L2(PixelFormat format);\n+\tstatic uint32_t drmToV4L2(const PixelFormat &format);\n \n \tunsigned int refcount_;\n \tunsigned int index_;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "8/8"
    ]
}