From patchwork Wed Oct 9 19:58:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 21578 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 3A901C32E7 for ; Wed, 9 Oct 2024 20:01:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E02EE65371; Wed, 9 Oct 2024 22:01:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DT+PzoMc"; dkim-atps=neutral Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 34599618C5 for ; Wed, 9 Oct 2024 22:01:52 +0200 (CEST) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20c5a7b2908so1058775ad.1 for ; Wed, 09 Oct 2024 13:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1728504110; x=1729108910; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dEOyYZLtMlIrWbCLSXaCKiqq1mB/bN8VsxFFN4jSrqw=; b=DT+PzoMc9cXyXtmsU9i9+0x7KyV8hQrD2uHGx8sK/96QUWrSc6EPaVMqlIs18Pe0NL X+SHFZ83Eycj5+Yy/0cOACUNOGLq2/QQ9Cwi74+LTzkrkf6T61TClJ06NzKOQBrBwvKy 6lJZXgJIcHyvzCN6HYJnCPKzEnJXokoEJjlkM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728504110; x=1729108910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dEOyYZLtMlIrWbCLSXaCKiqq1mB/bN8VsxFFN4jSrqw=; b=dHwZmetxg9v/ZjLMm3drl9mrQZts6k7pyxOzDXqRaf9SuW5KbUrQPWPxPw7VXCSnVO Sy95CT5zmsCYB5+bUjmT387bfgAMgS5cJH+oJesy1gPE/JlCsYc4HWARDCACVH8FH1w7 DKfsxlAVN7O3/fTBnBaJLSvq7UDpllWUSzyYZf14aQeAAa37a/ispKF3DlxozdJLtjuU Hd7XVDEnXdd8Nv8pEPKEzv3fUIhQolUqKm/uIHFHSqFegvqZBNIKdI7fcPRGKpFaCpc9 pHPJ1awtfgImTeNhAjxjEBcUjzunB2x1NaaJc4dZTbxBTG0hL8ym5fkFU6/DmaOVUcLx eOhw== X-Gm-Message-State: AOJu0YwUIImmJnIKqildZZTIcFKzLS4jkyI1zno3bVukx9kvw6drCOMg hzlJCgmLgeVBCKmTR4Un5ribPekYpuFmJPfVBIBNEBq0ZK6SH8JTh4VgbOWDmg4lnj8iAwd6n6M = X-Google-Smtp-Source: AGHT+IGIOWeuJqxPqJ5NjZPNMtHAlmMlG1+IgKTXlUi9tR11zEDnxK/c0MkVTaWVTpHy0IxIHrDzoQ== X-Received: by 2002:a17:902:ea12:b0:20c:6023:c02a with SMTP id d9443c01a7336-20c6378fc21mr60598065ad.57.1728504110336; Wed, 09 Oct 2024 13:01:50 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (199.211.81.34.bc.googleusercontent.com. [34.81.211.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c54056b07sm30370205ad.64.2024.10.09.13.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 13:01:49 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH 2/2] libcamera: Add V4L2VideoDevice::getCachedFormat Date: Wed, 9 Oct 2024 19:58:51 +0000 Message-ID: <20241009200142.3213065-3-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009200142.3213065-1-chenghaoyang@chromium.org> References: <20241009200142.3213065-1-chenghaoyang@chromium.org> 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" In the upcoming mtkisp7 pipeline handler, it needs to access the cached format from a derived class. This patch adds a protected getter to allow that. Signed-off-by: Harvey Yang --- include/libcamera/internal/v4l2_videodevice.h | 2 ++ src/libcamera/v4l2_videodevice.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index 9f53e37cd..389276302 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -241,6 +241,8 @@ public: protected: std::string logPrefix() const override; + V4L2DeviceFormat getCachedFormat() { return format_; } + private: LIBCAMERA_DISABLE_COPY(V4L2VideoDevice) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 1110fb535..1f6ad96c1 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2113,6 +2113,11 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media, return std::make_unique(mediaEntity); } +/** + * \fn V4L2VideoDevice::getCachedFormat() + * \return Cached \a V4L2VideoDevice::format_ + */ + /** * \brief Convert \a PixelFormat to a V4L2PixelFormat supported by the device * \param[in] pixelFormat The PixelFormat to convert