From patchwork Fri Jan 25 14:39:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 374 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D1BC60B21 for ; Fri, 25 Jan 2019 15:40:17 +0100 (CET) X-Halon-ID: 1e72a053-20af-11e9-9adf-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 1e72a053-20af-11e9-9adf-005056917a89; Fri, 25 Jan 2019 15:40:11 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 25 Jan 2019 15:39:49 +0100 Message-Id: <20190125143951.27992-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190125143951.27992-1-niklas.soderlund@ragnatech.se> References: <20190125143951.27992-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/3] libcamera: pipelines: rename MediaDevice member for UVC and VIMC X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 14:40:17 -0000 The name dev_ do a poor job of representing that it holds a media device, rename it to media_. There is no functional change in this change just s/dev_/media_/. Suggested-by: Laurent Pinchart Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/uvcvideo.cpp | 18 +++++++++--------- src/libcamera/pipeline/vimc.cpp | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index f84fa41515f1a439..5de8a0cb9c3406a8 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -22,34 +22,34 @@ public: bool match(DeviceEnumerator *enumerator); private: - std::shared_ptr dev_; + std::shared_ptr media_; }; PipelineHandlerUVC::PipelineHandlerUVC(CameraManager *manager) - : PipelineHandler(manager), dev_(nullptr) + : PipelineHandler(manager), media_(nullptr) { } PipelineHandlerUVC::~PipelineHandlerUVC() { - if (dev_) - dev_->release(); + if (media_) + media_->release(); } bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) { DeviceMatch dm("uvcvideo"); - dev_ = std::move(enumerator->search(dm)); + media_ = std::move(enumerator->search(dm)); - if (!dev_) + if (!media_) return false; - dev_->acquire(); + media_->acquire(); - std::shared_ptr camera = Camera::create(this, dev_->model()); + std::shared_ptr camera = Camera::create(this, media_->model()); registerCamera(std::move(camera)); - hotplugMediaDevice(dev_.get()); + hotplugMediaDevice(media_.get()); return true; } diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index b714a07688e91a02..f58a97d51619515d 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -22,18 +22,18 @@ public: bool match(DeviceEnumerator *enumerator); private: - std::shared_ptr dev_; + std::shared_ptr media_; }; PipeHandlerVimc::PipeHandlerVimc(CameraManager *manager) - : PipelineHandler(manager), dev_(nullptr) + : PipelineHandler(manager), media_(nullptr) { } PipeHandlerVimc::~PipeHandlerVimc() { - if (dev_) - dev_->release(); + if (media_) + media_->release(); } bool PipeHandlerVimc::match(DeviceEnumerator *enumerator) @@ -50,11 +50,11 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator) dm.add("RGB/YUV Input"); dm.add("Scaler"); - dev_ = std::move(enumerator->search(dm)); - if (!dev_) + media_ = std::move(enumerator->search(dm)); + if (!media_) return false; - dev_->acquire(); + media_->acquire(); std::shared_ptr camera = Camera::create(this, "Dummy VIMC Camera"); registerCamera(std::move(camera));