From patchwork Mon Oct 11 07:34:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14076 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 F031EC323E for ; Mon, 11 Oct 2021 07:35:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B4FA168F52; Mon, 11 Oct 2021 09:35:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WNVdFcKf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF00760502 for ; Mon, 11 Oct 2021 09:35:16 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.107]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D49C2BD; Mon, 11 Oct 2021 09:35:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1633937716; bh=Wsnd15k7VoYwcNktwsbFqnIlixJ3Rcv1vtOYlIgZeoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNVdFcKf8rZZtJmrx+HEcOHVYosh6cby9ydjnLW+kMAGEe7yziiBZ1vTwZmXL4N08 UF/OThMQj5/frE0hZI+yABifCQjbiZJOGvktqEeXhPPUuae4tVpHoQ+vtgacgrDfoo tvPex9/Co6TZQtVcN0kWgEyrPvDTu3rcBcJt4oNU= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 11 Oct 2021 13:04:59 +0530 Message-Id: <20211011073505.243864-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211011073505.243864-1-umang.jain@ideasonboard.com> References: <20211011073505.243864-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/7] camera_device: Remove private scope of Camera3RequestDescriptor 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" Camera3RequestDescriptor is a utility structure that groups information about a capture request. It can be and will be extended to preserve the context of a capture overall. Since the context of a capture needs to be shared among other classes (for e.g. CameraStream) having a private definition of the struct doesn't help. Hence, de-scope the structure so that it can be shared with other components (through references or pointers). Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda --- src/android/camera_device.cpp | 2 +- src/android/camera_device.h | 51 ++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index ef4fbab8..48a96d0c 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -220,7 +220,7 @@ bool validateCropRotate(const camera3_stream_configuration_t &streamList) * later re-used at request complete time to notify the framework. */ -CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor( +Camera3RequestDescriptor::Camera3RequestDescriptor( Camera *camera, const camera3_capture_request_t *camera3Request) { frameNumber_ = camera3Request->frame_number; diff --git a/src/android/camera_device.h b/src/android/camera_device.h index b7d774fe..26d1c6de 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -34,6 +34,32 @@ #include "jpeg/encoder.h" struct CameraConfigData; + +struct Camera3RequestDescriptor { + enum class Status { + Pending, + Success, + Error, + }; + + Camera3RequestDescriptor() = default; + ~Camera3RequestDescriptor() = default; + Camera3RequestDescriptor(libcamera::Camera *camera, + const camera3_capture_request_t *camera3Request); + Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; + + bool isPending() const { return status_ == Status::Pending; } + + uint32_t frameNumber_ = 0; + std::vector buffers_; + std::vector> frameBuffers_; + CameraMetadata settings_; + std::unique_ptr request_; + + camera3_capture_result_t captureResult_ = {}; + Status status_ = Status::Pending; +}; + class CameraDevice : protected libcamera::Loggable { public: @@ -73,31 +99,6 @@ private: CameraDevice(unsigned int id, std::shared_ptr camera); - struct Camera3RequestDescriptor { - enum class Status { - Pending, - Success, - Error, - }; - - Camera3RequestDescriptor() = default; - ~Camera3RequestDescriptor() = default; - Camera3RequestDescriptor(libcamera::Camera *camera, - const camera3_capture_request_t *camera3Request); - Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; - - bool isPending() const { return status_ == Status::Pending; } - - uint32_t frameNumber_ = 0; - std::vector buffers_; - std::vector> frameBuffers_; - CameraMetadata settings_; - std::unique_ptr request_; - - camera3_capture_result_t captureResult_ = {}; - Status status_ = Status::Pending; - }; - enum class State { Stopped, Flushing,