From patchwork Tue Oct 5 07:31:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14047 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 592C6BDC71 for ; Tue, 5 Oct 2021 07:31:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 10513691C3; Tue, 5 Oct 2021 09:31:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="amprOg3I"; dkim-atps=neutral Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A749684C6 for ; Tue, 5 Oct 2021 09:31:30 +0200 (CEST) Received: by mail-pj1-x1029.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so1284858pjb.5 for ; Tue, 05 Oct 2021 00:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MyOSdRnxiUA0efFjVE0ibmVnxSRhGcvXrmKap/V3rJ4=; b=amprOg3IFS02CYURMwt8CAFUfHyNYziOVq0U12D00+Ys8FnZuEglA7IEsTjg28USKQ 0qDd9FFNifDpyEmds2L1+NoIDRhX6CU/IkvR+weHO6jsaiBzYbqbe7jhHQpAeO1XmiZo E2MEwAp/qCBwBajO3rq77FY4uGkYXhYhFiR8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MyOSdRnxiUA0efFjVE0ibmVnxSRhGcvXrmKap/V3rJ4=; b=BqkG6bUkzjrGF47g8NF0+txfUHIu0tqBkLxZG3l+kwsl3lvGOJGNF9FKaa9rYa5g18 OQ4Al0HM023l3HoB9Dby8xz2Fir9fnDfZVRRh5vLkKMyGB9hYSIhQiCfxnzgZpPRRJNL krG6ExTuGCqu0CEvFB4rpGRvExxcSVl43WgJG9MY7NFxQpEtlggYXWMa6waU7n56dvHq bLF9SmbkWiQHcch7qmW7oUo4uazVJNrSOHZ2dEfMSCD2gSpanTMuRxtMwMTm0TEG3uhY qEt8nsVc5pHsaNjsyQxnTQHsriaW1nMddrDPtzz9TzloQq83tt13mdONoDGIdPAgBTH+ A66g== X-Gm-Message-State: AOAM531YDv6TX9hh2gH1duk9mb3ZBbUbGige1+ZbPkaTqSNBxRpGKMcH HCI1WtMwmSPDYzukKh7szPjKN4ZieGLu1Q== X-Google-Smtp-Source: ABdhPJz3jVaR3pQBrthjEivo6qHu0A0/kmIfES2HaEPGbDQVrBOhDXISwnr8FPt4esv8UBcAaXzckw== X-Received: by 2002:a17:902:ab93:b0:13d:e3b5:7ec2 with SMTP id f19-20020a170902ab9300b0013de3b57ec2mr3876422plr.26.1633419088357; Tue, 05 Oct 2021 00:31:28 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:debc:d0db:3bd8:f961]) by smtp.gmail.com with ESMTPSA id o14sm16761812pfh.145.2021.10.05.00.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:27 -0700 (PDT) From: Hirokazu Honda 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 Subject: [libcamera-devel] [RFC PATCH 3/6] qcam: Remove using namespace in header files X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" "using namespace" in a header file propagates the namespace to the files including the header file. So it should be avoided. This removes "using namespace" in header files in qcam. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/qcam/dng_writer.h | 10 ++++------ src/qcam/main.cpp | 2 +- src/qcam/main_window.h | 40 ++++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/qcam/dng_writer.h b/src/qcam/dng_writer.h index 20905f37..e4486288 100644 --- a/src/qcam/dng_writer.h +++ b/src/qcam/dng_writer.h @@ -15,15 +15,13 @@ #include #include -using namespace libcamera; - class DNGWriter { public: - static int write(const char *filename, const Camera *camera, - const StreamConfiguration &config, - const ControlList &metadata, - const FrameBuffer *buffer, const void *data); + static int write(const char *filename, const libcamera::Camera *camera, + const libcamera::StreamConfiguration &config, + const libcamera::ControlList &metadata, + const libcamera::FrameBuffer *buffer, const void *data); }; #endif /* HAVE_TIFF */ diff --git a/src/qcam/main.cpp b/src/qcam/main.cpp index 5eff90a3..b5dbf81b 100644 --- a/src/qcam/main.cpp +++ b/src/qcam/main.cpp @@ -66,7 +66,7 @@ int main(int argc, char **argv) sa.sa_handler = &signalHandler; sigaction(SIGINT, &sa, nullptr); - CameraManager *cm = new CameraManager(); + libcamera::CameraManager *cm = new libcamera::CameraManager(); ret = cm->start(); if (ret) { diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index a16bea09..4d8e806b 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -29,8 +29,6 @@ #include "../cam/stream_options.h" #include "viewfinder.h" -using namespace libcamera; - class QAction; class QComboBox; @@ -50,7 +48,8 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(CameraManager *cm, const OptionsParser::Options &options); + MainWindow(libcamera::CameraManager *cm, + const OptionsParser::Options &options); ~MainWindow(); bool event(QEvent *e) override; @@ -64,9 +63,10 @@ private Q_SLOTS: void saveImageAs(); void captureRaw(); - void processRaw(FrameBuffer *buffer, const ControlList &metadata); + void processRaw(libcamera::FrameBuffer *buffer, + const libcamera::ControlList &metadata); - void queueRequest(FrameBuffer *buffer); + void queueRequest(libcamera::FrameBuffer *buffer); private: int createToolbars(); @@ -77,13 +77,13 @@ private: int startCapture(); void stopCapture(); - void addCamera(std::shared_ptr camera); - void removeCamera(std::shared_ptr camera); + void addCamera(std::shared_ptr camera); + void removeCamera(std::shared_ptr camera); - void requestComplete(Request *request); + void requestComplete(libcamera::Request *request); void processCapture(); void processHotplug(HotplugEvent *e); - void processViewfinder(FrameBuffer *buffer); + void processViewfinder(libcamera::FrameBuffer *buffer); /* UI elements */ QToolBar *toolbar_; @@ -102,21 +102,21 @@ private: const OptionsParser::Options &options_; /* Camera manager, camera, configuration and buffers */ - CameraManager *cm_; - std::shared_ptr camera_; - FrameBufferAllocator *allocator_; + libcamera::CameraManager *cm_; + std::shared_ptr camera_; + libcamera::FrameBufferAllocator *allocator_; - std::unique_ptr config_; - std::map> mappedBuffers_; + std::unique_ptr config_; + std::map> mappedBuffers_; /* Capture state, buffers queue and statistics */ bool isCapturing_; bool captureRaw_; - Stream *vfStream_; - Stream *rawStream_; - std::map> freeBuffers_; - QQueue doneQueue_; - QQueue freeQueue_; + libcamera::Stream *vfStream_; + libcamera::Stream *rawStream_; + std::map> freeBuffers_; + QQueue doneQueue_; + QQueue freeQueue_; QMutex mutex_; /* Protects freeBuffers_, doneQueue_, and freeQueue_ */ uint64_t lastBufferTime_; @@ -124,7 +124,7 @@ private: uint32_t previousFrames_; uint32_t framesCaptured_; - std::vector> requests_; + std::vector> requests_; }; #endif /* __QCAM_MAIN_WINDOW__ */