Patch Detail
Show a patch.
GET /api/1.1/patches/14047/?format=api
{ "id": 14047, "url": "https://patchwork.libcamera.org/api/1.1/patches/14047/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14047/", "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-4-hiroh@chromium.org>", "date": "2021-10-05T07:31:11", "name": "[libcamera-devel,RFC,3/6] qcam: Remove using namespace in header files", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7c312477523c085ecc769dfd674c22f51cdf2b1d", "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/14047/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/14047/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14047/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 592C6BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 5 Oct 2021 07:31:32 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 10513691C3;\n\tTue, 5 Oct 2021 09:31:32 +0200 (CEST)", "from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A749684C6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 5 Oct 2021 09:31:30 +0200 (CEST)", "by mail-pj1-x1029.google.com with SMTP id\n\tpf6-20020a17090b1d8600b0019fa884ab85so1284858pjb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Oct 2021 00:31:30 -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.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Oct 2021 00:31:27 -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=\"amprOg3I\"; 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=MyOSdRnxiUA0efFjVE0ibmVnxSRhGcvXrmKap/V3rJ4=;\n\tb=amprOg3IFS02CYURMwt8CAFUfHyNYziOVq0U12D00+Ys8FnZuEglA7IEsTjg28USKQ\n\t0qDd9FFNifDpyEmds2L1+NoIDRhX6CU/IkvR+weHO6jsaiBzYbqbe7jhHQpAeO1XmiZo\n\tE2MEwAp/qCBwBajO3rq77FY4uGkYXhYhFiR8k=", "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=MyOSdRnxiUA0efFjVE0ibmVnxSRhGcvXrmKap/V3rJ4=;\n\tb=BqkG6bUkzjrGF47g8NF0+txfUHIu0tqBkLxZG3l+kwsl3lvGOJGNF9FKaa9rYa5g18\n\tOQ4Al0HM023l3HoB9Dby8xz2Fir9fnDfZVRRh5vLkKMyGB9hYSIhQiCfxnzgZpPRRJNL\n\tkrG6ExTuGCqu0CEvFB4rpGRvExxcSVl43WgJG9MY7NFxQpEtlggYXWMa6waU7n56dvHq\n\tbLF9SmbkWiQHcch7qmW7oUo4uazVJNrSOHZ2dEfMSCD2gSpanTMuRxtMwMTm0TEG3uhY\n\tqEt8nsVc5pHsaNjsyQxnTQHsriaW1nMddrDPtzz9TzloQq83tt13mdONoDGIdPAgBTH+\n\tA66g==", "X-Gm-Message-State": "AOAM531YDv6TX9hh2gH1duk9mb3ZBbUbGige1+ZbPkaTqSNBxRpGKMcH\n\tHCI1WtMwmSPDYzukKh7szPjKN4ZieGLu1Q==", "X-Google-Smtp-Source": "ABdhPJz3jVaR3pQBrthjEivo6qHu0A0/kmIfES2HaEPGbDQVrBOhDXISwnr8FPt4esv8UBcAaXzckw==", "X-Received": "by 2002:a17:902:ab93:b0:13d:e3b5:7ec2 with SMTP id\n\tf19-20020a170902ab9300b0013de3b57ec2mr3876422plr.26.1633419088357; \n\tTue, 05 Oct 2021 00:31:28 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 5 Oct 2021 16:31:11 +0900", "Message-Id": "<20211005073114.3997303-4-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 3/6] qcam: 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 qcam.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/qcam/dng_writer.h | 10 ++++------\n src/qcam/main.cpp | 2 +-\n src/qcam/main_window.h | 40 ++++++++++++++++++++--------------------\n 3 files changed, 25 insertions(+), 27 deletions(-)", "diff": "diff --git a/src/qcam/dng_writer.h b/src/qcam/dng_writer.h\nindex 20905f37..e4486288 100644\n--- a/src/qcam/dng_writer.h\n+++ b/src/qcam/dng_writer.h\n@@ -15,15 +15,13 @@\n #include <libcamera/framebuffer.h>\n #include <libcamera/stream.h>\n \n-using namespace libcamera;\n-\n class DNGWriter\n {\n public:\n-\tstatic int write(const char *filename, const Camera *camera,\n-\t\t\t const StreamConfiguration &config,\n-\t\t\t const ControlList &metadata,\n-\t\t\t const FrameBuffer *buffer, const void *data);\n+\tstatic int write(const char *filename, const libcamera::Camera *camera,\n+\t\t\t const libcamera::StreamConfiguration &config,\n+\t\t\t const libcamera::ControlList &metadata,\n+\t\t\t const libcamera::FrameBuffer *buffer, const void *data);\n };\n \n #endif /* HAVE_TIFF */\ndiff --git a/src/qcam/main.cpp b/src/qcam/main.cpp\nindex 5eff90a3..b5dbf81b 100644\n--- a/src/qcam/main.cpp\n+++ b/src/qcam/main.cpp\n@@ -66,7 +66,7 @@ int main(int argc, char **argv)\n \tsa.sa_handler = &signalHandler;\n \tsigaction(SIGINT, &sa, nullptr);\n \n-\tCameraManager *cm = new CameraManager();\n+\tlibcamera::CameraManager *cm = new libcamera::CameraManager();\n \n \tret = cm->start();\n \tif (ret) {\ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex a16bea09..4d8e806b 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -29,8 +29,6 @@\n #include \"../cam/stream_options.h\"\n #include \"viewfinder.h\"\n \n-using namespace libcamera;\n-\n class QAction;\n class QComboBox;\n \n@@ -50,7 +48,8 @@ class MainWindow : public QMainWindow\n \tQ_OBJECT\n \n public:\n-\tMainWindow(CameraManager *cm, const OptionsParser::Options &options);\n+\tMainWindow(libcamera::CameraManager *cm,\n+\t\t const OptionsParser::Options &options);\n \t~MainWindow();\n \n \tbool event(QEvent *e) override;\n@@ -64,9 +63,10 @@ private Q_SLOTS:\n \n \tvoid saveImageAs();\n \tvoid captureRaw();\n-\tvoid processRaw(FrameBuffer *buffer, const ControlList &metadata);\n+\tvoid processRaw(libcamera::FrameBuffer *buffer,\n+\t\t\tconst libcamera::ControlList &metadata);\n \n-\tvoid queueRequest(FrameBuffer *buffer);\n+\tvoid queueRequest(libcamera::FrameBuffer *buffer);\n \n private:\n \tint createToolbars();\n@@ -77,13 +77,13 @@ private:\n \tint startCapture();\n \tvoid stopCapture();\n \n-\tvoid addCamera(std::shared_ptr<Camera> camera);\n-\tvoid removeCamera(std::shared_ptr<Camera> camera);\n+\tvoid addCamera(std::shared_ptr<libcamera::Camera> camera);\n+\tvoid removeCamera(std::shared_ptr<libcamera::Camera> camera);\n \n-\tvoid requestComplete(Request *request);\n+\tvoid requestComplete(libcamera::Request *request);\n \tvoid processCapture();\n \tvoid processHotplug(HotplugEvent *e);\n-\tvoid processViewfinder(FrameBuffer *buffer);\n+\tvoid processViewfinder(libcamera::FrameBuffer *buffer);\n \n \t/* UI elements */\n \tQToolBar *toolbar_;\n@@ -102,21 +102,21 @@ private:\n \tconst OptionsParser::Options &options_;\n \n \t/* Camera manager, camera, configuration and buffers */\n-\tCameraManager *cm_;\n-\tstd::shared_ptr<Camera> camera_;\n-\tFrameBufferAllocator *allocator_;\n+\tlibcamera::CameraManager *cm_;\n+\tstd::shared_ptr<libcamera::Camera> camera_;\n+\tlibcamera::FrameBufferAllocator *allocator_;\n \n-\tstd::unique_ptr<CameraConfiguration> config_;\n-\tstd::map<FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_;\n+\tstd::unique_ptr<libcamera::CameraConfiguration> config_;\n+\tstd::map<libcamera::FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_;\n \n \t/* Capture state, buffers queue and statistics */\n \tbool isCapturing_;\n \tbool captureRaw_;\n-\tStream *vfStream_;\n-\tStream *rawStream_;\n-\tstd::map<const Stream *, QQueue<FrameBuffer *>> freeBuffers_;\n-\tQQueue<Request *> doneQueue_;\n-\tQQueue<Request *> freeQueue_;\n+\tlibcamera::Stream *vfStream_;\n+\tlibcamera::Stream *rawStream_;\n+\tstd::map<const libcamera::Stream *, QQueue<libcamera::FrameBuffer *>> freeBuffers_;\n+\tQQueue<libcamera::Request *> doneQueue_;\n+\tQQueue<libcamera::Request *> freeQueue_;\n \tQMutex mutex_; /* Protects freeBuffers_, doneQueue_, and freeQueue_ */\n \n \tuint64_t lastBufferTime_;\n@@ -124,7 +124,7 @@ private:\n \tuint32_t previousFrames_;\n \tuint32_t framesCaptured_;\n \n-\tstd::vector<std::unique_ptr<Request>> requests_;\n+\tstd::vector<std::unique_ptr<libcamera::Request>> requests_;\n };\n \n #endif /* __QCAM_MAIN_WINDOW__ */\n", "prefixes": [ "libcamera-devel", "RFC", "3/6" ] }