From patchwork Fri Oct 23 05:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10211 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 D71E3BDB13 for ; Fri, 23 Oct 2020 05:32:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A1F30615D7; Fri, 23 Oct 2020 07:32:00 +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="Z2rppbHv"; 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 CE24E6034E for ; Fri, 23 Oct 2020 07:31:59 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1603431119; bh=ycyHxIzJlXwml5LUGNNrlNAqjOZxN21PQgWMSvhDU7A=; h=From:To:Cc:Subject:In-Reply-To:References; b=Z2rppbHvJKF2VGjL1z7EHkzuFxkZQYUiM/W9urYaJ89wpEL3qcmJPHaN2SW/phIyi snqdZ9IFe+ivXZ8pd1LtWTet3OhAo5Y3Gej3gsVgIcL6KIJ60gawMdeVEr31Ml+qOE a17rVbKZkdEgOdQEZZnnw98rbg+AWoRPROC8SypAwiX2Ceouds/4hQH/WA4VIfqiKB YxY7d/42moY2IOgPCtRcWldYkkIH4lqnqdHcUoWmVIkAbPrXWXQGbCzMbzi77Fu3l1 jmj7ZkPfISfxRwfI9kLQ14DZEQeQBJdDevnRCTAfaGHNytfh4Skrs9WBUNYYYjIWUp zdONY6ItWBanQ== To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 11:01:50 +0530 Message-Id: <20201023053150.84411-2-email@uajain.com> In-Reply-To: <20201023053150.84411-1-email@uajain.com> References: <20201023053150.84411-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 Reviewed-by: Kieran Bingham --- 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);