From patchwork Tue Jul 27 11:05:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13127 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 ECC4FC322D for ; Tue, 27 Jul 2021 11:04:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B8ED1687CD; Tue, 27 Jul 2021 13:04:39 +0200 (CEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B7C5B687C3 for ; Tue, 27 Jul 2021 13:04:36 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 026EC20003; Tue, 27 Jul 2021 11:04:35 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 27 Jul 2021 13:05:18 +0200 Message-Id: <20210727110519.11587-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727110519.11587-1-jacopo@jmondi.org> References: <20210727110519.11587-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/3] android: capabilties: Rationalize get[YUV|Raw]Resolution names 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" The getYUVResolutions() and getRawResolutions() functions are called from the initializeStreamConfigurations() function, which is called by initialize(). Rationalize the function naming scheme by renaming the two functions to initializeYUVResolutions() and initializeRawResolution(). Cosmetic change only. Signed-off-by: Jacopo Mondi Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/android/camera_capabilities.cpp | 14 ++++++++------ src/android/camera_capabilities.h | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 6543c2bbc6c3..15e54192adff 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -138,8 +138,9 @@ int CameraCapabilities::initialize(std::shared_ptr camera, return initializeStaticMetadata(); } -std::vector CameraCapabilities::getYUVResolutions(const PixelFormat &pixelFormat, - const std::vector &resolutions) +std::vector +CameraCapabilities::initializeYUVResolutions(const PixelFormat &pixelFormat, + const std::vector &resolutions) { std::vector supportedResolutions; std::unique_ptr cameraConfig = @@ -164,7 +165,8 @@ std::vector CameraCapabilities::getYUVResolutions(const PixelFormat &pixel return supportedResolutions; } -std::vector CameraCapabilities::getRawResolutions(const libcamera::PixelFormat &pixelFormat) +std::vector +CameraCapabilities::initializeRawResolutions(const libcamera::PixelFormat &pixelFormat) { std::unique_ptr cameraConfig = camera_->generateConfiguration({ StreamRole::Raw }); @@ -323,10 +325,10 @@ int CameraCapabilities::initializeStreamConfigurations() std::vector resolutions; const PixelFormatInfo &info = PixelFormatInfo::info(mappedFormat); if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) - resolutions = getRawResolutions(mappedFormat); + resolutions = initializeRawResolutions(mappedFormat); else - resolutions = getYUVResolutions(mappedFormat, - cameraResolutions); + resolutions = initializeYUVResolutions(mappedFormat, + cameraResolutions); for (const Size &res : resolutions) { streamConfigurations_.push_back({ res, androidFormat }); diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index e72bf084cd65..e7aa46c0a689 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -43,10 +43,10 @@ private: }; std::vector - getYUVResolutions(const libcamera::PixelFormat &pixelFormat, - const std::vector &resolutions); + initializeYUVResolutions(const libcamera::PixelFormat &pixelFormat, + const std::vector &resolutions); std::vector - getRawResolutions(const libcamera::PixelFormat &pixelFormat); + initializeRawResolutions(const libcamera::PixelFormat &pixelFormat); int initializeStreamConfigurations(); int initializeStaticMetadata();