From patchwork Mon Jul 26 15:30:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13121 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 62636C322C for ; Mon, 26 Jul 2021 15:30:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DB725687C3; Mon, 26 Jul 2021 17:30:21 +0200 (CEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 678A5687AF for ; Mon, 26 Jul 2021 17:30:19 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 42C2A1C000D; Mon, 26 Jul 2021 15:30:18 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 26 Jul 2021 17:30:59 +0200 Message-Id: <20210726153100.27856-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153100.27856-1-jacopo@jmondi.org> References: <20210726153100.27856-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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();