From patchwork Fri Oct 23 05:14:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10209 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 D2233C3D3C for ; Fri, 23 Oct 2020 05:14:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2CE1615D9; Fri, 23 Oct 2020 07:14:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="LRg/yoCo"; dkim-atps=neutral Received: from mail.uajain.com (static.126.159.217.95.clients.your-server.de [95.217.159.126]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CC644615D3 for ; Fri, 23 Oct 2020 07:14:19 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1603430059; bh=WWJRqGWEisSX7a+DKokU3Hs2tKqPMLtdllVbxFFGvoI=; h=From:To:Cc:Subject:In-Reply-To:References; b=LRg/yoCoApHL3rq4iRYFSc2sUyHg5cazeGjKvp+tW2E7HnU+7LVk7ANFo050yM/S4 YxF1TRyRJIKW0157bxWBDSKK5ZDxZMcm/vRi50nZPPTgZrlJS5qQwbzP1TPEo92+8X PgO6RCo+PgysxQEAujVvMxHgMO+hLJubI0MNddQKovKhsz3GJfwFWox16mnPzTDWA+ AcBiz/8uBxXRH34Nqg4wU28D0e7K9Wv3c7FimoIMzovcWUHzteYkGvAaLjopzrMP5a VPmKdj8HB64xfFgBPOT0D/6ujyE5UTwFtO2qLx4P0OI7yC4QUi6/w74yt570EE8HNP 1OSJs4ui4BSNQ== To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 10:44:11 +0530 Message-Id: <20201023051411.81515-2-email@uajain.com> In-Reply-To: <20201023051411.81515-1-email@uajain.com> References: <20201023051411.81515-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] android: jpeg: encoder: Use pass-by-value for Exif parameter 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" Following the reasoning of pass-by-value for libcamera::Span parameters from 90c193f2a700("android: Modify Encoder interface") i.e. they are easy to copy/move/construct, align the Exif parameter passing to the encoder interface in this consistent way. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/android/jpeg/encoder.h | 2 +- src/android/jpeg/encoder_libjpeg.cpp | 2 +- src/android/jpeg/encoder_libjpeg.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/jpeg/encoder.h b/src/android/jpeg/encoder.h index 270ea60..94b3340 100644 --- a/src/android/jpeg/encoder.h +++ b/src/android/jpeg/encoder.h @@ -19,7 +19,7 @@ public: virtual int configure(const libcamera::StreamConfiguration &cfg) = 0; virtual int encode(const libcamera::FrameBuffer &source, libcamera::Span destination, - const libcamera::Span &exifData) = 0; + libcamera::Span exifData) = 0; }; #endif /* __ANDROID_JPEG_ENCODER_H__ */ diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp index 4bea10c..cfa5332 100644 --- a/src/android/jpeg/encoder_libjpeg.cpp +++ b/src/android/jpeg/encoder_libjpeg.cpp @@ -180,7 +180,7 @@ void EncoderLibJpeg::compressNV(const MappedBuffer *frame) } int EncoderLibJpeg::encode(const FrameBuffer &source, Span dest, - const Span &exifData) + Span exifData) { MappedFrameBuffer frame(&source, PROT_READ); if (!frame.isValid()) { diff --git a/src/android/jpeg/encoder_libjpeg.h b/src/android/jpeg/encoder_libjpeg.h index 391a53c..40505dd 100644 --- a/src/android/jpeg/encoder_libjpeg.h +++ b/src/android/jpeg/encoder_libjpeg.h @@ -23,7 +23,7 @@ public: int configure(const libcamera::StreamConfiguration &cfg) override; int encode(const libcamera::FrameBuffer &source, libcamera::Span destination, - const libcamera::Span &exifData) override; + libcamera::Span exifData) override; private: void compressRGB(const libcamera::MappedBuffer *frame);