From patchwork Mon Aug 3 16:18:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9140 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 6DD77BD86F for ; Mon, 3 Aug 2020 16:18:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BDBE961813; Mon, 3 Aug 2020 18:18:22 +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="BXDDy6hS"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DCB0160396 for ; Mon, 3 Aug 2020 18:18:21 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 96273543; Mon, 3 Aug 2020 18:18:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1596471500; bh=H6mKE2gfdwkV55Cj7guGS20Hr/pMNCmX8cVrZuBsKuw=; h=From:To:Cc:Subject:Date:From; b=BXDDy6hSoR5ePThloohDzZeK/4qNBLdhqLC2hE4wVsWoXDyrV6wMsykUPDpcMmOkb 2f7OtL8CUz99Y2iPDEcpPkATN7BUYSQT37ZPi4cW49fBD0H31DGSHkJXNlIuCp7tn1 oX1PvUYcqhn6Ilu+jjcnwAWf22XTsFsLOgDv8ZBg= From: Kieran Bingham To: libcamera devel Date: Mon, 3 Aug 2020 17:18:04 +0100 Message-Id: <20200803161816.107113-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/12] android: jpeg 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" Hi all, Here is my current 'work-in-progres' for JPEG. With just these patches applied, the CCA application runs and can capture an image successfully. There is still plenty to do on top however (and still some untidy code left in these patches, which I'm aware of but posting regardless): - The JPEG compression does not run in a separate thread - Added streams do not have buffering - (I think I'll remove 'adding streams' and only support compressing existing streams initially) - RAW API could be used for JPEG compression - This could be a performance improvement, but it will be difficult to handle NV swap generically, so we may want to further limit the input formats for that. - EXIF tag support is started but not included in this series. - No rescaler is supported yet Kieran Bingham (12): libcamera: FrameBuffer: Correct Buffer references libcamera: formats: add planeCount helper libcamera: buffer: Create a MappedBuffer libcamera: buffer: Convert copyFrom to use MappedFrameBuffer android: camera_device: Fix trivial spelling android: camera_device: Report an error in notifyError() android: camera_device: Only construct required planes android: camera_device: Query plane length android: camera_device: Report configuration changes from validate() android: camera_device: Generate ResultMetadata earlier android: Introduce JPEG compression android: camera_device: Support MJPEG stream construction include/libcamera/internal/buffer.h | 46 +++++ include/libcamera/internal/formats.h | 2 + src/android/camera_device.cpp | 268 ++++++++++++++++++++++++--- src/android/camera_device.h | 8 + src/android/jpeg/compressor.h | 28 +++ src/android/jpeg/compressor_jpeg.cpp | 215 +++++++++++++++++++++ src/android/jpeg/compressor_jpeg.h | 46 +++++ src/android/meson.build | 1 + src/libcamera/buffer.cpp | 177 +++++++++++++++--- src/libcamera/formats.cpp | 18 ++ src/libcamera/meson.build | 2 + 11 files changed, 759 insertions(+), 52 deletions(-) create mode 100644 include/libcamera/internal/buffer.h create mode 100644 src/android/jpeg/compressor.h create mode 100644 src/android/jpeg/compressor_jpeg.cpp create mode 100644 src/android/jpeg/compressor_jpeg.h