Show a patch.

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

{
    "id": 14048,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14048/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14048/",
    "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": "<20211005073114.3997303-5-hiroh@chromium.org>",
    "date": "2021-10-05T07:31:12",
    "name": "[libcamera-devel,RFC,4/6] v4l2: Remove using namespace in header files",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f874978900856720dcd3d82d2f64ce7f22920daa",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14048/mbox/",
    "series": [
        {
            "id": 2602,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2602/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2602",
            "date": "2021-10-05T07:31:08",
            "name": "Remove using namespace in header files",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2602/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14048/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14048/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 B55BCBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Oct 2021 07:31:33 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 828A5691C7;\n\tTue,  5 Oct 2021 09:31:33 +0200 (CEST)",
            "from mail-pl1-x630.google.com (mail-pl1-x630.google.com\n\t[IPv6:2607:f8b0:4864:20::630])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EB9F0684C6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Oct 2021 09:31:31 +0200 (CEST)",
            "by mail-pl1-x630.google.com with SMTP id j15so1709411plh.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Oct 2021 00:31:31 -0700 (PDT)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:debc:d0db:3bd8:f961])\n\tby smtp.gmail.com with ESMTPSA id\n\to14sm16761812pfh.145.2021.10.05.00.31.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Oct 2021 00:31:29 -0700 (PDT)"
        ],
        "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=\"HFfNMO3h\"; 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=J5SlXD3J2Y+dGvxWPtVdYv9GYq+6is/z72T8ERv6K90=;\n\tb=HFfNMO3hr3NEWOXKhknOJQSnIAyghm+k4IpkPzbeBzIlwh+6xK2cBtAmZoH3A23Mx3\n\tAkpBXTyuUsGd02vHkrkPahwBZJhr6JwRHhieN2Ul6W6eXi4Gj2IjJ1itBhSb3/ptAbgO\n\tk5lgGiWo0YiA5mH4E5C1divfXLzWYEsovmhy0=",
        "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=J5SlXD3J2Y+dGvxWPtVdYv9GYq+6is/z72T8ERv6K90=;\n\tb=JFaEtkfSzKVINz4rihvZQWSfidx4nFLixMjufI8VtquKeiNVzOkxPYXHrKjecV4vYb\n\t1w2SbpFEr75V6kHZogss7FT+vYcNvqdSbb+ARaPN9bufVQf+ZldRjlvZ3YTQolCF4GCG\n\t4RBfP+MTvb+Iw9idT/taoiuOkkmUvRvOoT2pwjWrmnamknUKsihLhw0RfG4sw43MP0V5\n\tRIjPHumjRIcjuJ/SxMQD7WofrvYPZyUA9fUyAxCuUa/kDGVqNmPuqPTiZgqlIF15LDZi\n\tAsfRknm7DAdm9jCJiskcuzEZqAXJlwqQUyZ0PgIr3aWVKBIVB4dAPyKG0+Kvqcq9HFKV\n\t1gEA==",
        "X-Gm-Message-State": "AOAM530ZSmTSlyPmDCi3jQZFzcNZNqPN39KjrNWhGMpm2pYGDLf4Vv6u\n\tzB/IDZpWUTsLsUmsVvXZd3QQ20Epn4DHnQ==",
        "X-Google-Smtp-Source": "ABdhPJweZVbj9q8tbAuRww8ZtZ2Z/hBh6HQByBrpYTYTAeqg1bGOV8zNe+dQ9Zipx+/GEq5ICleRyA==",
        "X-Received": "by 2002:a17:903:230c:b0:13e:d84d:e66 with SMTP id\n\td12-20020a170903230c00b0013ed84d0e66mr3966280plh.25.1633419090231; \n\tTue, 05 Oct 2021 00:31:30 -0700 (PDT)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  5 Oct 2021 16:31:12 +0900",
        "Message-Id": "<20211005073114.3997303-5-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.33.0.800.g4c38ced690-goog",
        "In-Reply-To": "<20211005073114.3997303-1-hiroh@chromium.org>",
        "References": "<20211005073114.3997303-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 4/6] v4l2: Remove using namespace in\n\theader files",
        "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": "\"using namespace\" in a header file propagates the namespace to\nthe files including the header file. So it should be avoided.\nThis removes \"using namespace\" in header files in v4l2.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/v4l2/v4l2_camera.h         | 37 +++++++++++++++++-----------------\n src/v4l2/v4l2_camera_proxy.h   | 15 +++++++-------\n src/v4l2/v4l2_compat_manager.h |  4 +---\n 3 files changed, 26 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h\nindex a095f4e2..e81996f2 100644\n--- a/src/v4l2/v4l2_camera.h\n+++ b/src/v4l2/v4l2_camera.h\n@@ -19,41 +19,40 @@\n #include <libcamera/framebuffer.h>\n #include <libcamera/framebuffer_allocator.h>\n \n-using namespace libcamera;\n-\n class V4L2Camera\n {\n public:\n \tstruct Buffer {\n-\t\tBuffer(unsigned int index, const FrameMetadata &data)\n+\t\tBuffer(unsigned int index, const libcamera::FrameMetadata &data)\n \t\t\t: index_(index), data_(data)\n \t\t{\n \t\t}\n \n \t\tunsigned int index_;\n-\t\tFrameMetadata data_;\n+\t\tlibcamera::FrameMetadata data_;\n \t};\n \n-\tV4L2Camera(std::shared_ptr<Camera> camera);\n+\tV4L2Camera(std::shared_ptr<libcamera::Camera> camera);\n \t~V4L2Camera();\n \n-\tint open(StreamConfiguration *streamConfig);\n+\tint open(libcamera::StreamConfiguration *streamConfig);\n \tvoid close();\n \tvoid bind(int efd);\n \tvoid unbind();\n \n \tstd::vector<Buffer> completedBuffers();\n \n-\tint configure(StreamConfiguration *streamConfigOut,\n-\t\t      const Size &size, const PixelFormat &pixelformat,\n+\tint configure(libcamera::StreamConfiguration *streamConfigOut,\n+\t\t      const libcamera::Size &size,\n+\t\t      const libcamera::PixelFormat &pixelformat,\n \t\t      unsigned int bufferCount);\n-\tint validateConfiguration(const PixelFormat &pixelformat,\n-\t\t\t\t  const Size &size,\n-\t\t\t\t  StreamConfiguration *streamConfigOut);\n+\tint validateConfiguration(const libcamera::PixelFormat &pixelformat,\n+\t\t\t\t  const libcamera::Size &size,\n+\t\t\t\t  libcamera::StreamConfiguration *streamConfigOut);\n \n \tint allocBuffers(unsigned int count);\n \tvoid freeBuffers();\n-\tFileDescriptor getBufferFd(unsigned int index);\n+\tlibcamera::FileDescriptor getBufferFd(unsigned int index);\n \n \tint streamOn();\n \tint streamOff();\n@@ -66,24 +65,24 @@ public:\n \tbool isRunning();\n \n private:\n-\tvoid requestComplete(Request *request);\n+\tvoid requestComplete(libcamera::Request *request);\n \n-\tstd::shared_ptr<Camera> camera_;\n-\tstd::unique_ptr<CameraConfiguration> config_;\n+\tstd::shared_ptr<libcamera::Camera> camera_;\n+\tstd::unique_ptr<libcamera::CameraConfiguration> config_;\n \n \tbool isRunning_;\n \n \tstd::mutex bufferLock_;\n-\tFrameBufferAllocator *bufferAllocator_;\n+\tlibcamera::FrameBufferAllocator *bufferAllocator_;\n \n-\tstd::vector<std::unique_ptr<Request>> requestPool_;\n+\tstd::vector<std::unique_ptr<libcamera::Request>> requestPool_;\n \n-\tstd::deque<Request *> pendingRequests_;\n+\tstd::deque<libcamera::Request *> pendingRequests_;\n \tstd::deque<std::unique_ptr<Buffer>> completedBuffers_;\n \n \tint efd_;\n \n-\tMutex bufferMutex_;\n+\tlibcamera::Mutex bufferMutex_;\n \tstd::condition_variable bufferCV_;\n \tunsigned int bufferAvailableCount_;\n };\ndiff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\nindex f1a8b61c..56a45bb7 100644\n--- a/src/v4l2/v4l2_camera_proxy.h\n+++ b/src/v4l2/v4l2_camera_proxy.h\n@@ -19,14 +19,12 @@\n \n #include \"v4l2_camera.h\"\n \n-using namespace libcamera;\n-\n class V4L2CameraFile;\n \n class V4L2CameraProxy\n {\n public:\n-\tV4L2CameraProxy(unsigned int index, std::shared_ptr<Camera> camera);\n+\tV4L2CameraProxy(unsigned int index, std::shared_ptr<libcamera::Camera> camera);\n \n \tint open(V4L2CameraFile *file);\n \tvoid close(V4L2CameraFile *file);\n@@ -38,8 +36,8 @@ public:\n private:\n \tbool validateBufferType(uint32_t type);\n \tbool validateMemoryType(uint32_t memory);\n-\tvoid setFmtFromConfig(const StreamConfiguration &streamConfig);\n-\tvoid querycap(std::shared_ptr<Camera> camera);\n+\tvoid setFmtFromConfig(const libcamera::StreamConfiguration &streamConfig);\n+\tvoid querycap(std::shared_ptr<libcamera::Camera> camera);\n \tint tryFormat(struct v4l2_format *arg);\n \tenum v4l2_priority maxPriority();\n \tvoid updateBuffers();\n@@ -59,7 +57,8 @@ private:\n \tint vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuffers *arg);\n \tint vidioc_querybuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n \tint vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n-\tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, MutexLocker *locker);\n+\tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n+\t\t\t libcamera::MutexLocker *locker);\n \tint vidioc_streamon(V4L2CameraFile *file, int *arg);\n \tint vidioc_streamoff(V4L2CameraFile *file, int *arg);\n \n@@ -72,7 +71,7 @@ private:\n \tunsigned int refcount_;\n \tunsigned int index_;\n \n-\tStreamConfiguration streamConfig_;\n+\tlibcamera::StreamConfiguration streamConfig_;\n \tunsigned int bufferCount_;\n \tunsigned int currentBuf_;\n \tunsigned int sizeimage_;\n@@ -99,7 +98,7 @@ private:\n \tV4L2CameraFile *owner_;\n \n \t/* This mutex is to serialize access to the proxy. */\n-\tMutex proxyMutex_;\n+\tlibcamera::Mutex proxyMutex_;\n };\n \n #endif /* __V4L2_CAMERA_PROXY_H__ */\ndiff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h\nindex 1ec46162..b11698cc 100644\n--- a/src/v4l2/v4l2_compat_manager.h\n+++ b/src/v4l2/v4l2_compat_manager.h\n@@ -18,8 +18,6 @@\n \n #include \"v4l2_camera_proxy.h\"\n \n-using namespace libcamera;\n-\n class V4L2CompatManager\n {\n public:\n@@ -64,7 +62,7 @@ private:\n \n \tFileOperations fops_;\n \n-\tCameraManager *cm_;\n+\tlibcamera::CameraManager *cm_;\n \n \tstd::vector<std::unique_ptr<V4L2CameraProxy>> proxies_;\n \tstd::map<int, std::shared_ptr<V4L2CameraFile>> files_;\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "4/6"
    ]
}