From patchwork Tue Oct 5 07:31:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14045 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 617F3BDC71 for ; Tue, 5 Oct 2021 07:31:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2FFE1691BC; Tue, 5 Oct 2021 09:31:28 +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="oIG/GuAf"; dkim-atps=neutral Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F000691AD for ; Tue, 5 Oct 2021 09:31:26 +0200 (CEST) Received: by mail-pg1-x536.google.com with SMTP id e7so18994187pgk.2 for ; Tue, 05 Oct 2021 00:31:26 -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=sD+G4dXPqVKcTTthftsISBS4v0B+kI9t9hVidH3zJz0=; b=oIG/GuAf/BMP+JyGdokQxJjEovg6XKIb49XIZLAzaWCqKbwxNUtYJo3sgCjthPFPQF 5zhcW9gM+ExBRGsn+0c+13KuYYwcxmbGq8PEPz0kkkFmDMkZGZ6pZ4Gp0C+060DmZaZH AyxZMzGqyh63qs7MCem/pKrPyu8SkUrBqYbzc= 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=sD+G4dXPqVKcTTthftsISBS4v0B+kI9t9hVidH3zJz0=; b=w4XTF5DnxdNYUNOmSKaLvP0HMiEjCwcWaM0uriooD4NxdPy1n4Xbnfs3VlVTu5kQh9 IPu/tT0B+DQRJDtdnWOnABMvfmStnwOyRDjIPtdjF+ct3IoXtw/AXSLBP5xDYPDmc30O bTdUCFPKHQclcUCOef88Y3a/UUlSI5mfYUKlZ8gn53NAMWpMJTCmYAbLfX6wGkWaAEe2 GMH0DsbsK0RZo49rjvEDwBDaCd4oMFzhFrFbYqug2AQ+yrbp3PJ1+t6ByYrKhkF8zOEG n2O+3DfnwKeQtiC3USb0Agtr6+b4NTivxw0QTkV9wf2vXo9TIFjuAbMQx3qJ2QCilqgp gIXQ== X-Gm-Message-State: AOAM530PeXmRsf0xS4To7gZej6IU4qBgmldihHviTXvJETotEl54Y+W9 PEXB1Yb4l1CF5tQ5ijpbMGJp8r1mGb235Q== X-Google-Smtp-Source: ABdhPJyQvOTfpLdmNA4QypooDfIPSv+Q7q7/bPE8Ari6xvZ6y42Yd3SwiBSl4+hZvYvVgWU0CUsJrg== X-Received: by 2002:a05:6a00:16cb:b0:44b:bd38:e068 with SMTP id l11-20020a056a0016cb00b0044bbd38e068mr30476151pfc.34.1633419084782; Tue, 05 Oct 2021 00:31:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:24 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Oct 2021 16:31:09 +0900 Message-Id: <20211005073114.3997303-2-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 1/6] ipa: raspberrypi: agc: Remove using namespace in agc.hpp 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 agc.hpp. Signed-off-by: Hirokazu Honda --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 7 +++++++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 289c1fce..f6a9cb0a 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -22,6 +22,7 @@ using namespace RPiController; using namespace libcamera; using libcamera::utils::Duration; +using namespace std::literals::chrono_literals; LOG_DEFINE_CATEGORY(RPiAgc) @@ -159,6 +160,12 @@ void AgcConfig::Read(boost::property_tree::ptree const ¶ms) default_analogue_gain = params.get("default_analogue_gain", 1.0); } +Agc::ExposureValues::ExposureValues() + : shutter(0s), analogue_gain(0), + total_exposure(0s), total_exposure_no_dg(0s) +{ +} + Agc::Agc(Controller *controller) : AgcAlgorithm(controller), metering_mode_(nullptr), exposure_mode_(nullptr), constraint_mode_(nullptr), diff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp index 82063636..c100d312 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.hpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp @@ -24,8 +24,6 @@ namespace RPiController { -using namespace std::literals::chrono_literals; - struct AgcMeteringMode { double weights[AGC_STATS_SIZE]; void Read(boost::property_tree::ptree const ¶ms); @@ -112,8 +110,8 @@ private: uint64_t frame_count_; AwbStatus awb_; struct ExposureValues { - ExposureValues() : shutter(0s), analogue_gain(0), - total_exposure(0s), total_exposure_no_dg(0s) {} + ExposureValues(); + libcamera::utils::Duration shutter; double analogue_gain; libcamera::utils::Duration total_exposure; From patchwork Tue Oct 5 07:31:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14046 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 C5745BDC71 for ; Tue, 5 Oct 2021 07:31:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 896EB691C0; Tue, 5 Oct 2021 09:31:30 +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="ag/d1zN2"; dkim-atps=neutral Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8489C691AD for ; Tue, 5 Oct 2021 09:31:28 +0200 (CEST) Received: by mail-pj1-x102f.google.com with SMTP id np13so3417703pjb.4 for ; Tue, 05 Oct 2021 00:31:28 -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=kL/CgG4PVTmQWbYcC3g4MNyOX0OGDyYjYFMI+Kj5Rzc=; b=ag/d1zN2CBwRbyeSqIHOhUVuMAmXxd21ilbR0QNRsUyx7Xm8XMALIAhACtx8a8zXBq PvAdqvR68hUcx4s/vVLue2pOpVT2AtohFIgpB+Tls2/nqLC+xcrOuID+WVHjbyuZOsOi UFzhiXYQWrye/O+BtCu95tALAUAXihuAwTcsU= 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=kL/CgG4PVTmQWbYcC3g4MNyOX0OGDyYjYFMI+Kj5Rzc=; b=x1DDgQug5SgReTsE4ZqbfxwORblEl9jdPW3v1ZcKNV2bhdugY9qj3AJ+hIA5GxeVrk D0TmMIBhq68CRBtqQIvv4vulfLScmXCwBaDmC+ZEOIIqZ6ezo6e91n5pfquvZofiboxa t2fagk10Mcv/OaraxJ6A0NiCX/6KQu8xOtBObldUmWGno/M0PSHRXtRiw64vkfz8R2Ea Mzmpnt4RqOckrza0XvRh2W9MAVABlkQFzD8d6k9V01omOnwQynF+A92g0cQIa9k8X4mn 8FsFLiBeENI3+kTIQvDCx71MqmSeghbH7oRtweXX4FEAkMFsscKVBMDeAHWL5Xl/VyVZ C7AQ== X-Gm-Message-State: AOAM531L+UwTH9LbjvNBs+v9tHHiq/N+IqwskX7YuxROa4NGvA49gWZb 101d3AYFWIBY9dEtD/FaIhYVStZY4jz1lg== X-Google-Smtp-Source: ABdhPJy3Z7lCQ9CHr6eNPW4DgIvcMWfa1UqA5fwu+OZv2GwJB4YapUf1yIlZipdbceCfwT30+kYHew== X-Received: by 2002:a17:902:8bc4:b029:12b:8470:e29e with SMTP id r4-20020a1709028bc4b029012b8470e29emr3904637plo.2.1633419086572; Tue, 05 Oct 2021 00:31:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:26 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Oct 2021 16:31:10 +0900 Message-Id: <20211005073114.3997303-3-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 2/6] cam: Remove using namespace in stream_options.h 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 stream_options.h Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/cam/stream_options.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cam/stream_options.h b/src/cam/stream_options.h index 577391f0..fbbc13a3 100644 --- a/src/cam/stream_options.h +++ b/src/cam/stream_options.h @@ -11,8 +11,6 @@ #include "options.h" -using namespace libcamera; - class StreamKeyValueParser : public KeyValueParser { public: @@ -20,12 +18,12 @@ public: KeyValueParser::Options parse(const char *arguments) override; - static StreamRoles roles(const OptionValue &values); - static int updateConfiguration(CameraConfiguration *config, + static libcamera::StreamRoles roles(const OptionValue &values); + static int updateConfiguration(libcamera::CameraConfiguration *config, const OptionValue &values); private: - static bool parseRole(StreamRole *role, + static bool parseRole(libcamera::StreamRole *role, const KeyValueParser::Options &options); }; 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__ */ From patchwork Tue Oct 5 07:31:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14048 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 B55BCBDC71 for ; Tue, 5 Oct 2021 07:31:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 828A5691C7; Tue, 5 Oct 2021 09:31:33 +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="HFfNMO3h"; dkim-atps=neutral Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EB9F0684C6 for ; Tue, 5 Oct 2021 09:31:31 +0200 (CEST) Received: by mail-pl1-x630.google.com with SMTP id j15so1709411plh.7 for ; Tue, 05 Oct 2021 00:31:31 -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=J5SlXD3J2Y+dGvxWPtVdYv9GYq+6is/z72T8ERv6K90=; b=HFfNMO3hr3NEWOXKhknOJQSnIAyghm+k4IpkPzbeBzIlwh+6xK2cBtAmZoH3A23Mx3 AkpBXTyuUsGd02vHkrkPahwBZJhr6JwRHhieN2Ul6W6eXi4Gj2IjJ1itBhSb3/ptAbgO k5lgGiWo0YiA5mH4E5C1divfXLzWYEsovmhy0= 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=J5SlXD3J2Y+dGvxWPtVdYv9GYq+6is/z72T8ERv6K90=; b=JFaEtkfSzKVINz4rihvZQWSfidx4nFLixMjufI8VtquKeiNVzOkxPYXHrKjecV4vYb 1w2SbpFEr75V6kHZogss7FT+vYcNvqdSbb+ARaPN9bufVQf+ZldRjlvZ3YTQolCF4GCG 4RBfP+MTvb+Iw9idT/taoiuOkkmUvRvOoT2pwjWrmnamknUKsihLhw0RfG4sw43MP0V5 RIjPHumjRIcjuJ/SxMQD7WofrvYPZyUA9fUyAxCuUa/kDGVqNmPuqPTiZgqlIF15LDZi AsfRknm7DAdm9jCJiskcuzEZqAXJlwqQUyZ0PgIr3aWVKBIVB4dAPyKG0+Kvqcq9HFKV 1gEA== X-Gm-Message-State: AOAM530ZSmTSlyPmDCi3jQZFzcNZNqPN39KjrNWhGMpm2pYGDLf4Vv6u zB/IDZpWUTsLsUmsVvXZd3QQ20Epn4DHnQ== X-Google-Smtp-Source: ABdhPJweZVbj9q8tbAuRww8ZtZ2Z/hBh6HQByBrpYTYTAeqg1bGOV8zNe+dQ9Zipx+/GEq5ICleRyA== X-Received: by 2002:a17:903:230c:b0:13e:d84d:e66 with SMTP id d12-20020a170903230c00b0013ed84d0e66mr3966280plh.25.1633419090231; Tue, 05 Oct 2021 00:31:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:29 -0700 (PDT) From: Hirokazu Honda 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 Subject: [libcamera-devel] [RFC PATCH 4/6] v4l2: 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 v4l2. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera.h | 37 +++++++++++++++++----------------- src/v4l2/v4l2_camera_proxy.h | 15 +++++++------- src/v4l2/v4l2_compat_manager.h | 4 +--- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h index a095f4e2..e81996f2 100644 --- a/src/v4l2/v4l2_camera.h +++ b/src/v4l2/v4l2_camera.h @@ -19,41 +19,40 @@ #include #include -using namespace libcamera; - class V4L2Camera { public: struct Buffer { - Buffer(unsigned int index, const FrameMetadata &data) + Buffer(unsigned int index, const libcamera::FrameMetadata &data) : index_(index), data_(data) { } unsigned int index_; - FrameMetadata data_; + libcamera::FrameMetadata data_; }; - V4L2Camera(std::shared_ptr camera); + V4L2Camera(std::shared_ptr camera); ~V4L2Camera(); - int open(StreamConfiguration *streamConfig); + int open(libcamera::StreamConfiguration *streamConfig); void close(); void bind(int efd); void unbind(); std::vector completedBuffers(); - int configure(StreamConfiguration *streamConfigOut, - const Size &size, const PixelFormat &pixelformat, + int configure(libcamera::StreamConfiguration *streamConfigOut, + const libcamera::Size &size, + const libcamera::PixelFormat &pixelformat, unsigned int bufferCount); - int validateConfiguration(const PixelFormat &pixelformat, - const Size &size, - StreamConfiguration *streamConfigOut); + int validateConfiguration(const libcamera::PixelFormat &pixelformat, + const libcamera::Size &size, + libcamera::StreamConfiguration *streamConfigOut); int allocBuffers(unsigned int count); void freeBuffers(); - FileDescriptor getBufferFd(unsigned int index); + libcamera::FileDescriptor getBufferFd(unsigned int index); int streamOn(); int streamOff(); @@ -66,24 +65,24 @@ public: bool isRunning(); private: - void requestComplete(Request *request); + void requestComplete(libcamera::Request *request); - std::shared_ptr camera_; - std::unique_ptr config_; + std::shared_ptr camera_; + std::unique_ptr config_; bool isRunning_; std::mutex bufferLock_; - FrameBufferAllocator *bufferAllocator_; + libcamera::FrameBufferAllocator *bufferAllocator_; - std::vector> requestPool_; + std::vector> requestPool_; - std::deque pendingRequests_; + std::deque pendingRequests_; std::deque> completedBuffers_; int efd_; - Mutex bufferMutex_; + libcamera::Mutex bufferMutex_; std::condition_variable bufferCV_; unsigned int bufferAvailableCount_; }; diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index f1a8b61c..56a45bb7 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -19,14 +19,12 @@ #include "v4l2_camera.h" -using namespace libcamera; - class V4L2CameraFile; class V4L2CameraProxy { public: - V4L2CameraProxy(unsigned int index, std::shared_ptr camera); + V4L2CameraProxy(unsigned int index, std::shared_ptr camera); int open(V4L2CameraFile *file); void close(V4L2CameraFile *file); @@ -38,8 +36,8 @@ public: private: bool validateBufferType(uint32_t type); bool validateMemoryType(uint32_t memory); - void setFmtFromConfig(const StreamConfiguration &streamConfig); - void querycap(std::shared_ptr camera); + void setFmtFromConfig(const libcamera::StreamConfiguration &streamConfig); + void querycap(std::shared_ptr camera); int tryFormat(struct v4l2_format *arg); enum v4l2_priority maxPriority(); void updateBuffers(); @@ -59,7 +57,8 @@ private: int vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuffers *arg); int vidioc_querybuf(V4L2CameraFile *file, struct v4l2_buffer *arg); int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg); - int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, MutexLocker *locker); + int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, + libcamera::MutexLocker *locker); int vidioc_streamon(V4L2CameraFile *file, int *arg); int vidioc_streamoff(V4L2CameraFile *file, int *arg); @@ -72,7 +71,7 @@ private: unsigned int refcount_; unsigned int index_; - StreamConfiguration streamConfig_; + libcamera::StreamConfiguration streamConfig_; unsigned int bufferCount_; unsigned int currentBuf_; unsigned int sizeimage_; @@ -99,7 +98,7 @@ private: V4L2CameraFile *owner_; /* This mutex is to serialize access to the proxy. */ - Mutex proxyMutex_; + libcamera::Mutex proxyMutex_; }; #endif /* __V4L2_CAMERA_PROXY_H__ */ diff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h index 1ec46162..b11698cc 100644 --- a/src/v4l2/v4l2_compat_manager.h +++ b/src/v4l2/v4l2_compat_manager.h @@ -18,8 +18,6 @@ #include "v4l2_camera_proxy.h" -using namespace libcamera; - class V4L2CompatManager { public: @@ -64,7 +62,7 @@ private: FileOperations fops_; - CameraManager *cm_; + libcamera::CameraManager *cm_; std::vector> proxies_; std::map> files_; From patchwork Tue Oct 5 07:31:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14049 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 79EEDBDC71 for ; Tue, 5 Oct 2021 07:31:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 49A1F691B9; Tue, 5 Oct 2021 09:31:35 +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="OfBuA1sX"; dkim-atps=neutral Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF204691BD for ; Tue, 5 Oct 2021 09:31:33 +0200 (CEST) Received: by mail-pf1-x42c.google.com with SMTP id g2so16646752pfc.6 for ; Tue, 05 Oct 2021 00:31:33 -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=fhp6VldNPONO2CVYik2Y7RItvUuE5jx8y/8HeWR21IQ=; b=OfBuA1sX3PQGl3QdiNV8NjVWfwnwcApdBBC+AVfHSyFfX9resPO1IpeO6YPRBe6jcy XmyamOhvJ5svbwU92y61YTnJ2IMHjeS0RKh5KjJKeOAaYarrk9x1Tp5flP3XEm8lOy9V uulc7uOjL2DAa3j4T5kVw10pi6JNBYIxSiPpw= 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=fhp6VldNPONO2CVYik2Y7RItvUuE5jx8y/8HeWR21IQ=; b=1NlOUfjg9Z9icDul1+OIBFmZEhYj4lkldxr8rqpVqGTY/3qQ6tndsDE6rHwizHGZ6+ jP4r/2wGywFzytro9uVPSkfinBoAmPo13uq3Hoc4Ut0v3ChDkph47ZNYO7clVE7hSogR mlzdVroAKRe4eci2vAahEjWO1zc8v8ZSvIVP0DiI8CdI65Is5uAfIOwlZk9/TsXE5Dvr mgKKPt3OJ3b3meoqavG1shXFNGMuERdrotJArc+qc7LyvhKIrQ3npM8qA9WKE0VE1qRm AQf04IJM6hQmCgFXaFaLky6hsGWJE2AEHImTxMx8flR4SbBIGQ2m7Qp7LkbGxVYcxNoV UkAQ== X-Gm-Message-State: AOAM530xINrWW9kT6LkfvsI2uV/eXBadViLgebg7DHlhZ/XmiZ5iWKwx h9whj/viY+6JThzLPYZdAEFZUPUNlcNEwg== X-Google-Smtp-Source: ABdhPJyQkiylkda9Z/F7U23G9Z03SSfTtgcuo+2j/2bPY/n/Qij4zPF1FEUNaxCqffhp5HuzHDqeDg== X-Received: by 2002:a62:d11e:0:b0:446:d705:7175 with SMTP id z30-20020a62d11e000000b00446d7057175mr29448098pfg.74.1633419091991; Tue, 05 Oct 2021 00:31:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:31 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Oct 2021 16:31:13 +0900 Message-Id: <20211005073114.3997303-6-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 5/6] lc-compliance: 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 lc-compliance. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/lc-compliance/environment.cpp | 2 +- src/lc-compliance/environment.h | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lc-compliance/environment.cpp b/src/lc-compliance/environment.cpp index 9e24b5e3..f4583c8e 100644 --- a/src/lc-compliance/environment.cpp +++ b/src/lc-compliance/environment.cpp @@ -13,7 +13,7 @@ Environment *Environment::get() return &instance; } -void Environment::setup(CameraManager *cm, std::string cameraId) +void Environment::setup(libcamera::CameraManager *cm, std::string cameraId) { cm_ = cm; cameraId_ = cameraId; diff --git a/src/lc-compliance/environment.h b/src/lc-compliance/environment.h index 1c7d9a55..ba308732 100644 --- a/src/lc-compliance/environment.h +++ b/src/lc-compliance/environment.h @@ -9,23 +9,21 @@ #include -using namespace libcamera; - class Environment { public: static Environment *get(); - void setup(CameraManager *cm, std::string cameraId); + void setup(libcamera::CameraManager *cm, std::string cameraId); const std::string &cameraId() const { return cameraId_; } - CameraManager *cm() const { return cm_; } + libcamera::CameraManager *cm() const { return cm_; } private: Environment() = default; std::string cameraId_; - CameraManager *cm_; + libcamera::CameraManager *cm_; }; #endif /* __LC_COMPLIANCE_ENVIRONMENT_H__ */ From patchwork Tue Oct 5 07:31:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14050 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 E3843BDC71 for ; Tue, 5 Oct 2021 07:31:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2B96691BE; Tue, 5 Oct 2021 09:31:37 +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="MNr7jyIz"; dkim-atps=neutral Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C195B691AD for ; Tue, 5 Oct 2021 09:31:35 +0200 (CEST) Received: by mail-pg1-x52b.google.com with SMTP id e7so18994520pgk.2 for ; Tue, 05 Oct 2021 00:31:35 -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=F1tp93JtwZl0N6lNbF8v2MAO1RuA4bBN2LbhDqet+bs=; b=MNr7jyIz2iJNrdwl8xlrrDS0wYbBY5MHq7jOQA/N8UeeUbiuOlWHkZG0PD9CZwWkgh Yom0aA4pmUyjoEDlmq5oHwKu/lIHx4ph64GWtidvxQMBZ6+1Ju+x14hQDdUrzrlR+4JX JcKABKeO2aC+9BSWJcw3EfjbluMsk9CR7Sq+Y= 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=F1tp93JtwZl0N6lNbF8v2MAO1RuA4bBN2LbhDqet+bs=; b=WkPWGheJztdIWVJB0D6gGLKPMa7dtvZqmupl5/aKqS08nRpuITIaop6QWofTLwi1Nl NrYorWIpsjdeT5uB+FQaW9ZYNS1/zC93Tf3ejpwtKJ2gGGD+DgjzDSzwFFKW48+9ccRE 7uLeoSntGMSXrv2bcmhPrqDfAeDaHNwEoiRrN26DMnQNx9VsFymTcn9R0uvyVarcvbgl TOqwycSxpK1Nc9DEMsZmoi/e6ZqHalOJG+3MAZuuD8pgYfFfuE01/IZaV6Kui335wej0 9oBt3fDInVa8lZMVf21pri+9WlT66/PI1pG4qovthnRjR6I/sO+eLvAET+phtAVwdULe x9hg== X-Gm-Message-State: AOAM533vmgLf5jbdOTzbUd+GSgkBc80r/LmwR00bUxbZvRA4h5uCcKNc 9I+QkrhotS5g7cAC6YkhWzwa7b5PU3v9Kg== X-Google-Smtp-Source: ABdhPJzi2Sc5jvknd/TrAQBgI92t7EhJkNMpbIViAqHSuxS4/5DpFYEPtC3apgKzOOjqUMsXcEDSKw== X-Received: by 2002:aa7:8f12:0:b0:44c:833f:9dad with SMTP id x18-20020aa78f12000000b0044c833f9dadmr1355864pfr.35.1633419093936; Tue, 05 Oct 2021 00:31:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 00:31:33 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 5 Oct 2021 16:31:14 +0900 Message-Id: <20211005073114.3997303-7-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 6/6] test: 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 test. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- test/camera/camera_reconfigure.cpp | 1 + test/camera/capture.cpp | 1 + test/camera/configuration_default.cpp | 1 + test/camera/configuration_set.cpp | 1 + test/camera/statemachine.cpp | 1 + test/gstreamer/gstreamer_test.h | 2 -- test/libtest/buffer_source.cpp | 2 ++ test/libtest/buffer_source.h | 10 ++++------ test/libtest/camera_test.h | 6 ++---- test/mapped-buffer.cpp | 1 + test/media_device/media_device_test.h | 6 ++---- test/serialization/serialization_test.h | 10 ++++------ test/v4l2_subdevice/v4l2_subdevice_test.h | 8 +++----- test/v4l2_videodevice/buffer_sharing.cpp | 2 ++ test/v4l2_videodevice/capture_async.cpp | 2 ++ test/v4l2_videodevice/v4l2_videodevice_test.h | 14 ++++++-------- 16 files changed, 33 insertions(+), 35 deletions(-) diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp index 48d61c00..0fd8ab70 100644 --- a/test/camera/camera_reconfigure.cpp +++ b/test/camera/camera_reconfigure.cpp @@ -21,6 +21,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index 238d98db..41ae00d7 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -16,6 +16,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/configuration_default.cpp b/test/camera/configuration_default.cpp index c2b20194..209eb6a5 100644 --- a/test/camera/configuration_default.cpp +++ b/test/camera/configuration_default.cpp @@ -10,6 +10,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/configuration_set.cpp b/test/camera/configuration_set.cpp index a1dc446a..4281a1c4 100644 --- a/test/camera/configuration_set.cpp +++ b/test/camera/configuration_set.cpp @@ -10,6 +10,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp index 26fb5ca1..9c2b0c6a 100644 --- a/test/camera/statemachine.cpp +++ b/test/camera/statemachine.cpp @@ -12,6 +12,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h index 9c50e288..ccfe0b92 100644 --- a/test/gstreamer/gstreamer_test.h +++ b/test/gstreamer/gstreamer_test.h @@ -17,8 +17,6 @@ #include -using namespace std; - class GstreamerTest { public: diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp index 64e7376a..1b261697 100644 --- a/test/libtest/buffer_source.cpp +++ b/test/libtest/buffer_source.cpp @@ -14,6 +14,8 @@ #include "test.h" +using namespace libcamera; + BufferSource::BufferSource() { } diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h index 14b4770e..84e2fa8f 100644 --- a/test/libtest/buffer_source.h +++ b/test/libtest/buffer_source.h @@ -12,20 +12,18 @@ #include "libcamera/internal/media_device.h" #include "libcamera/internal/v4l2_videodevice.h" -using namespace libcamera; - class BufferSource { public: BufferSource(); ~BufferSource(); - int allocate(const StreamConfiguration &config); - const std::vector> &buffers(); + int allocate(const libcamera::StreamConfiguration &config); + const std::vector> &buffers(); private: - std::shared_ptr media_; - std::vector> buffers_; + std::shared_ptr media_; + std::vector> buffers_; }; #endif /* __LIBCAMERA_BUFFER_SOURCE_TEST_H__ */ diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h index f56e343e..23122245 100644 --- a/test/libtest/camera_test.h +++ b/test/libtest/camera_test.h @@ -12,8 +12,6 @@ #include #include -using namespace libcamera; - class CameraTest { public: @@ -21,8 +19,8 @@ public: ~CameraTest(); protected: - CameraManager *cm_; - std::shared_ptr camera_; + libcamera::CameraManager *cm_; + std::shared_ptr camera_; int status_; }; diff --git a/test/mapped-buffer.cpp b/test/mapped-buffer.cpp index 97571945..b4422f7d 100644 --- a/test/mapped-buffer.cpp +++ b/test/mapped-buffer.cpp @@ -14,6 +14,7 @@ #include "camera_test.h" #include "test.h" +using namespace libcamera; using namespace std; namespace { diff --git a/test/media_device/media_device_test.h b/test/media_device/media_device_test.h index 0c8bf9f2..a88de56c 100644 --- a/test/media_device/media_device_test.h +++ b/test/media_device/media_device_test.h @@ -14,8 +14,6 @@ #include "test.h" -using namespace libcamera; - class MediaDeviceTest : public Test { public: @@ -25,10 +23,10 @@ public: protected: int init(); - std::shared_ptr media_; + std::shared_ptr media_; private: - std::unique_ptr enumerator_; + std::unique_ptr enumerator_; }; #endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */ diff --git a/test/serialization/serialization_test.h b/test/serialization/serialization_test.h index f51ae546..d654c7bf 100644 --- a/test/serialization/serialization_test.h +++ b/test/serialization/serialization_test.h @@ -14,8 +14,6 @@ #include "camera_test.h" #include "test.h" -using namespace libcamera; - class SerializationTest : public CameraTest, public Test { public: @@ -24,10 +22,10 @@ public: { } - static bool equals(const ControlInfoMap &lhs, - const ControlInfoMap &rhs); - static bool equals(const ControlList &lhs, - const ControlList &rhs); + static bool equals(const libcamera::ControlInfoMap &lhs, + const libcamera::ControlInfoMap &rhs); + static bool equals(const libcamera::ControlList &lhs, + const libcamera::ControlList &rhs); }; #endif /* __LIBCAMERA_SERIALIZATION_TEST_H__ */ diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.h b/test/v4l2_subdevice/v4l2_subdevice_test.h index e981abf7..83beb6a2 100644 --- a/test/v4l2_subdevice/v4l2_subdevice_test.h +++ b/test/v4l2_subdevice/v4l2_subdevice_test.h @@ -16,8 +16,6 @@ #include "test.h" -using namespace libcamera; - class V4L2SubdeviceTest : public Test { public: @@ -30,9 +28,9 @@ protected: int init() override; void cleanup() override; - std::unique_ptr enumerator_; - std::shared_ptr media_; - V4L2Subdevice *scaler_; + std::unique_ptr enumerator_; + std::shared_ptr media_; + libcamera::V4L2Subdevice *scaler_; }; #endif /* __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ */ diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp index 6af96a98..75ee93ce 100644 --- a/test/v4l2_videodevice/buffer_sharing.cpp +++ b/test/v4l2_videodevice/buffer_sharing.cpp @@ -20,6 +20,8 @@ #include "v4l2_videodevice_test.h" +using namespace libcamera; + class BufferSharingTest : public V4L2VideoDeviceTest { public: diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index 805cb610..3aa4ca0b 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -15,6 +15,8 @@ #include "v4l2_videodevice_test.h" +using namespace libcamera; + class CaptureAsyncTest : public V4L2VideoDeviceTest { public: diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h index d46540d4..e7762294 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.h +++ b/test/v4l2_videodevice/v4l2_videodevice_test.h @@ -19,8 +19,6 @@ #include "test.h" -using namespace libcamera; - class V4L2VideoDeviceTest : public Test { public: @@ -36,12 +34,12 @@ protected: std::string driver_; std::string entity_; - std::unique_ptr enumerator_; - std::shared_ptr media_; - CameraSensor *sensor_; - V4L2Subdevice *debayer_; - V4L2VideoDevice *capture_; - std::vector> buffers_; + std::unique_ptr enumerator_; + std::shared_ptr media_; + libcamera::CameraSensor *sensor_; + libcamera::V4L2Subdevice *debayer_; + libcamera::V4L2VideoDevice *capture_; + std::vector> buffers_; }; #endif /* __LIBCAMERA_V4L2_DEVICE_TEST_H_ */