From patchwork Mon Sep 21 18:23:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9681 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 C5D3FC3B5B for ; Mon, 21 Sep 2020 18:23:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 37E0E62FD3; Mon, 21 Sep 2020 20:23:38 +0200 (CEST) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7960362B90 for ; Mon, 21 Sep 2020 20:23:36 +0200 (CEST) X-Halon-ID: 8cd0b5cb-fc37-11ea-a39b-005056917f90 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 8cd0b5cb-fc37-11ea-a39b-005056917f90; Mon, 21 Sep 2020 20:23:35 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 21 Sep 2020 20:23:25 +0200 Message-Id: <20200921182325.2508256-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: stream: Rename StillCaptureRaw to Raw 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" With the buffer copy removed from all pipelines for the raw capture rename the StillCaptureRaw to Raw to better represent the role. Signed-off-by: Niklas Söderlund Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- include/libcamera/stream.h | 2 +- src/android/camera_device.cpp | 4 ++-- src/cam/stream_options.cpp | 4 ++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +- src/libcamera/stream.cpp | 5 ++--- src/qcam/main_window.cpp | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index f502b35957fc250c..bb47c390f8a12387 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -59,8 +59,8 @@ private: }; enum StreamRole { + Raw, StillCapture, - StillCaptureRaw, VideoRecording, Viewfinder, }; diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 70d77a17ef43cf48..751699cd21138245 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -313,7 +313,7 @@ std::vector CameraDevice::getYUVResolutions(CameraConfiguration *cameraCon std::vector CameraDevice::getRawResolutions(const libcamera::PixelFormat &pixelFormat) { std::unique_ptr cameraConfig = - camera_->generateConfiguration({ StillCaptureRaw }); + camera_->generateConfiguration({ StreamRole::Raw }); StreamConfiguration &cfg = cameraConfig->at(0); const StreamFormats &formats = cfg.formats(); std::vector supportedResolutions = formats.sizes(pixelFormat); @@ -895,7 +895,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() /* Report if camera supports RAW. */ std::unique_ptr cameraConfig = - camera_->generateConfiguration({ StillCaptureRaw }); + camera_->generateConfiguration({ StreamRole::Raw }); if (cameraConfig && !cameraConfig->empty()) { const PixelFormatInfo &info = PixelFormatInfo::info(cameraConfig->at(0).pixelFormat); diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp index 4168e5d2d1deff9b..27cc39122989f256 100644 --- a/src/cam/stream_options.cpp +++ b/src/cam/stream_options.cpp @@ -119,8 +119,8 @@ bool StreamKeyValueParser::parseRole(StreamRole *role, } else if (name == "still") { *role = StreamRole::StillCapture; return true; - } else if (name == "stillraw") { - *role = StreamRole::StillCaptureRaw; + } else if (name == "raw") { + *role = StreamRole::Raw; return true; } diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 221259c7fe61df03..17ffed2b0e2ff0a6 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -343,7 +343,7 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera, break; - case StreamRole::StillCaptureRaw: { + case StreamRole::Raw: { StreamConfiguration cio2Config = data->cio2_.generateConfiguration(sensorResolution); pixelFormat = cio2Config.pixelFormat; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 50f07182457046ff..fe46dbd386d2a5ea 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -376,7 +376,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera, unsigned int outCount = 0; for (const StreamRole role : roles) { switch (role) { - case StreamRole::StillCaptureRaw: + case StreamRole::Raw: size = data->sensor_->resolution(); fmts = data->unicam_[Unicam::Image].dev()->formats(); sensorFormat = findBestMode(fmts, size); diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 4d0ab90d73f96e0f..6d51e5da794f9f87 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -380,12 +380,11 @@ std::string StreamConfiguration::toString() const * are specified by applications and passed to cameras, that then select the * most appropriate streams and their default configurations. * + * \var Raw + * The stream is intended to capture high-resolution raw images. * \var StillCapture * The stream is intended to capture high-resolution, high-quality still images * with low frame rate. The captured frames may be exposed with flash. - * \var StillCaptureRaw - * The stream is intended to capture high-resolution, raw still images with low - * frame rate. * \var VideoRecording * The stream is intended to capture video for the purpose of recording or * streaming. The video stream may produce a high frame rate and may be diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 985743f3233405d0..ecb9dd6642400697 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -380,7 +380,7 @@ int MainWindow::startCapture() break; case 2: if (roles[0] != StreamRole::Viewfinder || - roles[1] != StreamRole::StillCaptureRaw) { + roles[1] != StreamRole::Raw) { qWarning() << "Only viewfinder + raw supported for dual streams"; return -EINVAL; }