From patchwork Wed Sep 9 11:14:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9548 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 D99AFBDB1D for ; Wed, 9 Sep 2020 11:14:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5AE4B62CBA; Wed, 9 Sep 2020 13:14:54 +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="gneY5s8B"; 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 20F7960534 for ; Wed, 9 Sep 2020 13:14:53 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1599650092; bh=DDvXNdZwACGSJVQI2KoKjnAOmFamfyKR6VCQzfoBrMY=; h=From:To:Cc:Subject; b=gneY5s8BEXStcUBFeKeCoCMWWfyP3zhpY7hmQzzhKgFvyp7TwR93RVEur5mQ6VXV5 YfxUO2QLzYXIO8tXsENVsyi0Obp30qHjFTlo2iaIGemXU7lI6kPeIW66VMKjPTiRVB bvtpKW+rga6vctY4wUTiH4+MTfKsfsmL/TJNVthf83QoPImr7/yWR8m7T7pPBZdG5F cZ+b7rIO3H6A4Fz2a1gcdEfWkHBGc8WBnoMp50RsUZLiokaFlFMyV/xfTfwYUO37Vs OYnLKMvKABlluZ6gbNkH8vz88U6ZG8dryL5TzttlobT2wJlWHp9bgRTtFHO9/QcezN yYfZ3AB2pV85w== To: libcamera-devel@lists.libcamera.org Date: Wed, 9 Sep 2020 16:44:43 +0530 Message-Id: <20200909111445.2908-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 0/2] android: jpeg: Add EXIF infrastructure 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" Changes in v7: - Patch 1/2 unchanged. - Fix orientation value for Android orientation metadata. See https://lists.libcamera.org/pipermail/libcamera-devel/2020-September/012678.html Series should land after the above patch lands first, in my opinion. Changes in v6: - Fix a bad rebase function declaration Exif::generate() which didn't get caughted in the net by compile-test. - Fix use of [[nodiscard]] syntax and make sure the value is checked. - Other small fixes. Changes in v5: - Drop return type 'int' of setString, setShort, setLong helpers because of improved error handling and exif validity check in createEntry(). - Check if EXIF instance is acutally valid before generate(). - Document API usage briefly. Changes in v4: - No major changes expect few alphabetically sort fixes, commit amend, fix coding/variable style etc. Changes in v3: - setTimestamp() now follows the EXIF standard format "YYYY:MM:DD hh:mm:ss" - Strip re-use of EXIF object for every frame. A new EXIF object is created and each tag is set for it, for each frame while encoding. - Exif::generate() returns a int code and Exif::data() will now return a const libcamera::Span of { exif_data_, size_ }. - Null terminate strings in Exif::setString(). - Make setLong, setShort, setString etc. helpers private. Changes in v2: - Patch 2/3 and 3/3 in v1 are merged. - We ignore the Frame Metadata timestamp, instead use the 'time of encoding' as the frame timestamp for EXIF data. Since the resolution is only 1s, this seems to be fine (consensus over IRC). - EXIF data placeholder is now wrapper inside CameraStream. This prevents setting static metadata repeatedly in v1, like Make/Model etc. - Jpeg Encoder encodes the EXIF generated Span<> directly into the image. This avoids JPEG encoder dealing with EXIF specifics inside itself. - Orientation tag value is rectified and is similar to how it's done in Chrome HAL. - Exif::setWidth() and Exif::setHeight() are merged to achieve common Exif::setSize(libcamera::Size) for setting frame sizes. Kieran Bingham (1): android: jpeg: Add EXIF infrastructure Umang Jain (1): android: jpeg: Support an initial set of EXIF metadata tags src/android/camera_device.cpp | 19 ++- src/android/jpeg/encoder.h | 3 +- src/android/jpeg/encoder_libjpeg.cpp | 9 +- src/android/jpeg/encoder_libjpeg.h | 3 +- src/android/jpeg/exif.cpp | 238 +++++++++++++++++++++++++++ src/android/jpeg/exif.h | 54 ++++++ src/android/meson.build | 2 + 7 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 src/android/jpeg/exif.cpp create mode 100644 src/android/jpeg/exif.h