From patchwork Thu Oct 23 14:48:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24731 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 88DF0C3332 for ; Thu, 23 Oct 2025 14:48:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C9AF607F6; Thu, 23 Oct 2025 16:48:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bID/xZNh"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CD152606DE for ; Thu, 23 Oct 2025 16:48:54 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:7328:357b:4ce1:72b6]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D94861AA6; Thu, 23 Oct 2025 16:47:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761230830; bh=H0nNmAan3FzGqsERM4FnQaO71k5GY1eNHpOgMviD1Wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bID/xZNhDFBDwncCx1ul2zy/6CvHzXcEMBLf0mi6Q44BWPzuM0bgcZSbI3G0vr9CN d1A7Bpt5y7mQz1Sy/R2NcxOdkeaRn/sWdLsCPn8cnXMJtp5673ZSV41XGcSKZlnhKC WelyeEmCq8kUCMYrGdgBWnfJxRKF8wGKN/f+mRy8= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham , Paul Elder Subject: [PATCH v2 03/35] libcamera: v4l2: Remove fromEntityName(MediaDevice*) Date: Thu, 23 Oct 2025 16:48:04 +0200 Message-ID: <20251023144841.403689-4-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251023144841.403689-1-stefan.klug@ideasonboard.com> References: <20251023144841.403689-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" From: Kieran Bingham Now that all users of the fromEntityName() helpers use the shared_ptr variant, remove the original functions that are no longer used. Signed-off-by: Kieran Bingham Signed-off-by: Paul Elder --- include/libcamera/internal/v4l2_subdevice.h | 2 -- include/libcamera/internal/v4l2_videodevice.h | 2 -- src/libcamera/v4l2_subdevice.cpp | 17 +---------------- src/libcamera/v4l2_videodevice.cpp | 17 +---------------- 4 files changed, 2 insertions(+), 36 deletions(-) diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index d1c8b838d49b..b4b41806638c 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -161,8 +161,6 @@ public: const std::string &model(); const V4L2SubdeviceCapability &caps() const { return caps_; } - static std::unique_ptr - fromEntityName(const MediaDevice *media, const std::string &entity); static std::unique_ptr fromEntityName(std::shared_ptr, const std::string &entity); diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index 4f80f7176174..5a7dcfdda118 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -226,8 +226,6 @@ public: void setDequeueTimeout(utils::Duration timeout); Signal<> dequeueTimeout; - static std::unique_ptr - fromEntityName(const MediaDevice *media, const std::string &entity); static std::unique_ptr fromEntityName(std::shared_ptr, const std::string &entity); diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 1825e9e55ca4..643d63ea18bd 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -1758,7 +1758,7 @@ const std::string &V4L2Subdevice::model() * \return A newly created V4L2Subdevice on success, nullptr otherwise */ std::unique_ptr -V4L2Subdevice::fromEntityName(const MediaDevice *media, +V4L2Subdevice::fromEntityName(std::shared_ptr media, const std::string &entity) { MediaEntity *mediaEntity = media->getEntityByName(entity); @@ -1768,21 +1768,6 @@ V4L2Subdevice::fromEntityName(const MediaDevice *media, return std::make_unique(mediaEntity); } -/** - * \brief Create a new video subdevice instance from \a entity in media device - * \a media - * \param[in] media The media device where the entity is registered - * \param[in] entity The media entity name - * - * \return A newly created V4L2Subdevice on success, nullptr otherwise - */ -std::unique_ptr -V4L2Subdevice::fromEntityName(std::shared_ptr media, - const std::string &entity) -{ - return fromEntityName(media.get(), entity); -} - std::string V4L2Subdevice::logPrefix() const { return "'" + entity_->name() + "'"; diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 9be5cfbc0395..bb57c1b76a5b 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2104,7 +2104,7 @@ void V4L2VideoDevice::watchdogExpired() * \return A newly created V4L2VideoDevice on success, nullptr otherwise */ std::unique_ptr -V4L2VideoDevice::fromEntityName(const MediaDevice *media, +V4L2VideoDevice::fromEntityName(std::shared_ptr media, const std::string &entity) { MediaEntity *mediaEntity = media->getEntityByName(entity); @@ -2114,21 +2114,6 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media, return std::make_unique(mediaEntity); } -/** - * \brief Create a new video device instance from \a entity in media device - * \a media - * \param[in] media The media device where the entity is registered - * \param[in] entity The media entity name - * - * \return A newly created V4L2VideoDevice on success, nullptr otherwise - */ -std::unique_ptr -V4L2VideoDevice::fromEntityName(std::shared_ptr media, - const std::string &entity) -{ - return fromEntityName(media.get(), entity); -} - /** * \brief Convert \a PixelFormat to a V4L2PixelFormat supported by the device * \param[in] pixelFormat The PixelFormat to convert