From patchwork Fri Oct 23 05:14:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10208 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 8BE47C3D3C for ; Fri, 23 Oct 2020 05:14:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5A27E6034E; Fri, 23 Oct 2020 07:14:19 +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="R0tavHqv"; 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 620BC6034E for ; Fri, 23 Oct 2020 07:14:17 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1603430056; bh=eC+gq9Q43EnkJP579KhiBi3Is8d/7X536clIy2smHuE=; h=From:To:Cc:Subject; b=R0tavHqvv7buShWtf+XvnMqj3Ijq29augZE3RruH7Ss692SxsdPE2nXCdUEuNoMgP Akytx6XlJMh27Mrmb27CApKvmJbSNY1RLyqGWYQydoXUAeSrjeOwu+QfWu4rhO5VEl UAyJYQEpYY7/ICHwbK0gH79eWLy3mwR44KqjeBuUhuTU/Yfy00Z3LsvzWt5Gq7fAMl 4CCfOpDz3EVsgEUHmgqnHH8GI9RLnPdNni3pmxT2PAvRioWtsJSv4375Glgv9b3BLJ yHFAxrjaSW35p3sABEgQ5tREdsqawCml6NppebG3vwFZV02Wefr666qHfbuu+RTN29 /QOK2nn4t3E6Q== To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 10:44:10 +0530 Message-Id: <20201023051411.81515-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 are already declared via the function signatures in their respective header files. Signed-off-by: Umang Jain --- 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: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);