From patchwork Wed Oct 28 09:50:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 10285 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 16C44BDB1E for ; Wed, 28 Oct 2020 09:50:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C85062390; Wed, 28 Oct 2020 10:50:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GTq3Q2cf"; dkim-atps=neutral Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E8CBF62067 for ; Wed, 28 Oct 2020 10:50:33 +0100 (CET) Received: by mail-pj1-x102e.google.com with SMTP id m3so2199862pjf.4 for ; Wed, 28 Oct 2020 02:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bLkHLnV8q68/sx9Q6XEgYitTeMG/ymIiiObsKiDa7Ts=; b=GTq3Q2cfVlRpC64X21BuZWPIeVdaLx2FnhDvqAJGnpcLjNYvpcndDWoLHTeaWZfbzE H6hqpY0u29+Noxh3J+lkLmDDRUoIwl32rBbyR6n/2I4j2hTfmf4gd6b/jCP0xZZOFJl5 0iKKy6ph297bPiTQqd2a9EaU4agQtcKVOy+y8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bLkHLnV8q68/sx9Q6XEgYitTeMG/ymIiiObsKiDa7Ts=; b=U60fzuCyfmLkNsn3f22VsCuawdEPcgbc9IW7N2ZZnCm766ioscLAPIkkVF0plJ18Tu inw6K6i8jgnNQIwIMc/21VWBJRBqxUkZOLfgpMP2wRX7xFOFMM0O3S9HbIfmqhW0njcT qudX+TWSNseujlIMXzzKuaw3mydFwe2hKi9GggMnIqERscaqr7SGPCAJvudpp5c76ts0 4cAI8eezsv4TZKDbg3PSVivzMQxMPHwEb7A4suGbD76mnt4Mp70I6CILYYXaXe2TiOyv Pj4yMGcerzk8uaa+Pa9V6VwPeXSti5/vs7EtRqca2fPFFrPeFonEILTSX7hCFZiXTdfS E4tw== X-Gm-Message-State: AOAM532Hrsbf83O9U1sTcCK25+enmoZZer+DA7DCBEzJytPZfaiDUaNv c1MNOSZouqdCe7G+kwF/oyP/pZ8gQd2F5A== X-Google-Smtp-Source: ABdhPJzAhDVhfXTC8gE+lXP1JAze8eBrMhv2MUKCAnfpMZpMUS/OAM7Krl57qkgbvyKiwYTsITu/cw== X-Received: by 2002:a17:90a:318d:: with SMTP id j13mr6180029pjb.209.1603878632248; Wed, 28 Oct 2020 02:50:32 -0700 (PDT) Received: from hiroh.tok.corp.google.com ([2401:fa00:8f:2:de4a:3eff:fe7d:f78f]) by smtp.gmail.com with ESMTPSA id y5sm2110690pfq.79.2020.10.28.02.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 02:50:31 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Oct 2020 18:50:23 +0900 Message-Id: <20201028095023.3004701-1-hiroh@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: camera_device: Mark ToPixelFormat() a const function 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" CameraDevice::ToPixelFormat() doesn't change the state of the CameraDevice. Marks it a const function so that it can be called in const functions. Signed-off-by: Hirokazu Honda Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- src/android/camera_device.cpp | 2 +- src/android/camera_device.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.29.0.rc2.309.g374f81d7ae-goog diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index ca60f51..6369d49 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1188,7 +1188,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type) return requestTemplate->get(); } -PixelFormat CameraDevice::toPixelFormat(int format) +PixelFormat CameraDevice::toPixelFormat(int format) const { /* Translate Android format code to libcamera pixel format. */ auto it = formatsMap_.find(format); diff --git a/src/android/camera_device.h b/src/android/camera_device.h index fd08738..45efcf4 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -104,7 +104,7 @@ private: void notifyShutter(uint32_t frameNumber, uint64_t timestamp); void notifyError(uint32_t frameNumber, camera3_stream_t *stream); CameraMetadata *requestTemplatePreview(); - libcamera::PixelFormat toPixelFormat(int format); + libcamera::PixelFormat toPixelFormat(int format) const; std::unique_ptr getResultMetadata(int frame_number, int64_t timestamp);