From patchwork Fri Oct 23 05:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10210 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 72870BDB13 for ; Fri, 23 Oct 2020 05:31:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 40312615D4; Fri, 23 Oct 2020 07:31:58 +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="X5uaAZ24"; 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 04A366034E for ; Fri, 23 Oct 2020 07:31:57 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1603431116; bh=6sFyZy4MzQctWuztX9/htBFqsV/X1hyGwnxBWwlz8OI=; h=From:To:Cc:Subject; b=X5uaAZ244xLxEJdHv3Aqd/txMyvClqSfGE6G5Nj+E/TI4Tc0imgTgYfvn+KD3KGOw v1vZAH7kIUW6VdXIWGagwbnm615TOT2JUXP9hkaFp6N8jf5aR6hegN/NiF8vPsSksz 2AUAhotWOq7NheP15RZ9/Ze/n42TGyjiMYKI719tmNPi4NtsSp1ngIf8F3UT8Xix0e 7zdM+xGKzL5rO32TzekD2rLk5vqS3YpU8MNrNckXTutm54LjbSfhi7hz/HLpmzbxC/ kD+UigvVtklA7dxR5MNUoYcTa+fwLdhEyDFn2ubxFOBn7Mp6cUwiMoIgRB11AJPkGO StyUijpH7c1Bw== To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 11:01:49 +0530 Message-Id: <20201023053150.84411-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] android: jpeg: Drop "libcamera::" namespace from functions' arguments 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" Drop "libcamera::" from functions' arguments for *.cpp files as they have using namespace libcamera; directive in the beginning. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- src/android/jpeg/encoder_libjpeg.cpp | 9 ++++----- src/android/jpeg/post_processor_jpeg.cpp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp index 5a2f88f..4bea10c 100644 --- a/src/android/jpeg/encoder_libjpeg.cpp +++ b/src/android/jpeg/encoder_libjpeg.cpp @@ -104,7 +104,7 @@ int EncoderLibJpeg::configure(const StreamConfiguration &cfg) return 0; } -void EncoderLibJpeg::compressRGB(const libcamera::MappedBuffer *frame) +void EncoderLibJpeg::compressRGB(const MappedBuffer *frame) { unsigned char *src = static_cast(frame->maps()[0].data()); /* \todo Stride information should come from buffer configuration. */ @@ -122,7 +122,7 @@ void EncoderLibJpeg::compressRGB(const libcamera::MappedBuffer *frame) * Compress the incoming buffer from a supported NV format. * This naively unpacks the semi-planar NV12 to a YUV888 format for libjpeg. */ -void EncoderLibJpeg::compressNV(const libcamera::MappedBuffer *frame) +void EncoderLibJpeg::compressNV(const MappedBuffer *frame) { uint8_t tmprowbuf[compress_.image_width * 3]; @@ -179,9 +179,8 @@ void EncoderLibJpeg::compressNV(const libcamera::MappedBuffer *frame) } } -int EncoderLibJpeg::encode(const FrameBuffer &source, - libcamera::Span dest, - const libcamera::Span &exifData) +int EncoderLibJpeg::encode(const FrameBuffer &source, Span dest, + const Span &exifData) { MappedFrameBuffer frame(&source, PROT_READ); if (!frame.isValid()) { diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp index fd1c7be..93acfe5 100644 --- a/src/android/jpeg/post_processor_jpeg.cpp +++ b/src/android/jpeg/post_processor_jpeg.cpp @@ -44,8 +44,8 @@ int PostProcessorJpeg::configure(const StreamConfiguration &inCfg, return encoder_->configure(inCfg); } -int PostProcessorJpeg::process(const libcamera::FrameBuffer &source, - libcamera::Span destination, +int PostProcessorJpeg::process(const FrameBuffer &source, + Span destination, CameraMetadata *metadata) { if (!encoder_) 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);