From patchwork Tue May 26 14:22:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 3859 Return-Path: Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D8E560E08 for ; Tue, 26 May 2020 16:19:24 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from localhost.localdomain (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id CADC940002; Tue, 26 May 2020 14:19:23 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 26 May 2020 16:22:29 +0200 Message-Id: <20200526142237.407557-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/8] android: Implament format translation 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: , X-List-Received-Date: Tue, 26 May 2020 14:19:24 -0000 Hello, this series implements a few things, the most relevant of which is the collection and translation of Android supported image formats to libcamera formats. The series begins by providing a camera-identifying log prefix to the CameraDevice class. It then fixes the reported API version, which was curiously hard-coded to 0. Patch 3 replaces the orientation and facing camera side hard-coded information with the actual values reported by the libcamera::Camera instance the CameraDevice wraps. In order to do so, a new CameraDevice::initialize() method is provided, where the collection and inspection of all Camera static properties happens before the CameraDevice::open() method gets called. Building on this foundations, patch 4 builds the image format translation map and the available stream configuration map by testing a set of required and optional image resolutions against the wrapped libcamera::Camera instace. The patch produces an android-format to libcamera-format map and a list of available stream configuration items, to be reported to the Android framework through static metadata. Patch 5 makes the metadata buffer size calculation 'dynamic', by inspecting the number of elements which have been collected in the stream configuration map. Patch 6 and 7 make use of the information collected in patch 5 to, respectively, report to the framework the available stream configuration map, and to translate from Android format to libcamera format at processCaptureRequest time. While I was reading the camera documentation, I spotted a rougue full stop in a \return statement in documentation, and while at there I removed it. Jacopo Mondi (8): android: camera_device: Provide log prefix android: hal_manager: Report supported API version android: hal_manager: Do not hardcode properties android: camera_device: Build stream configuration android: camera_device: Calculate metadata size android: camera_manager: Replace hardcoded stream configuration android: camera_device: Translate Android format libcamera: camera: Drop full stop from \return src/android/camera_device.cpp | 375 ++++++++++++++++++++++++----- src/android/camera_device.h | 29 ++- src/android/camera_hal_manager.cpp | 12 +- src/libcamera/camera.cpp | 2 +- 4 files changed, 352 insertions(+), 66 deletions(-) --- 2.26.2