From patchwork Mon Sep 20 17:37:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13864 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 7159FBF01C for ; Mon, 20 Sep 2021 17:38:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8B4E06918A; Mon, 20 Sep 2021 19:38:02 +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="Z2SWahPm"; 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 B02FB69186 for ; Mon, 20 Sep 2021 19:38:00 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.144]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6A24E45E; Mon, 20 Sep 2021 19:37:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1632159480; bh=/k/jx5vOGNAG5QxKXYT2d1XCF3VjKeMqW/MDfqqDijc=; h=From:To:Cc:Subject:Date:From; b=Z2SWahPmztQ7YbTK11tnqXhunoMnh+H9ZDdIc2MwJpUVW5Q1An42NKNSKKDOA0+EL Mq19OXvFq8gUd+5MFt4x1gluG9WCTII6o8qrT8f9sXfLBYCQQ7Vrb3H+7/GHuUUrIw ReDPfkhbyRqlQDmKDP946yZ2vqu2w7nyEhPKB2as= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 20 Sep 2021 23:07:42 +0530 Message-Id: <20210920173752.1346190-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 00/10] Async post processor 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" This series aims to enable async post-processing of streams in the HAL layer. Patch [1,2]/10 transforms the Camera3RequestDescriptor's map to a queue. The queue is helpful and easier to track when operations (like post-processing are running asynchronously). Patch 3/10 is a patch of using pointer instead of reference, since we will be using Object::invokeMethod() for async processing, Patch [4,5,6]/10 expands the breadth of Camera3RequestDescriptor which can be thought as a "context" structure booking-keeping all the data for async post-processing. It also manages the lifetime of source framebuffers. Patch [7,8]/10 introduces a notification mechanism via a Signal to infer if a post-processing has been completed. It shall handle success /error paths accordingly. Patch 9/10 inspects the queue's head and check if descriptor can be offloaded from the queue, if "ready". If yes, it will send the capture results present in the descriptor and drop it from the queue. Patch 10/10 introduces a threading mechanism which will run the post-processor in a separate thread. (It currently runs with ConnectionTypeBlocking, but it should run with ConnectionTypeQueued. There is WIP debugging issue and marked as TODO) Umang Jain (10): android: camera_worker: Use Camera3RequestDescriptor as cookie android: camera_device: Transform descriptors_ map to queue android: camera_stream: Pass FrameBuffer pointer instead of reference camera_device: Remove private scope of Camera3RequestDescriptor android: camera_device: Store results metadata into Camera3RequestDescriptor android: camera_stream: Plumb process() with Camera3RequestDescriptor android: post_processor: Notify post processing completion status android: camera_stream: Drop return value for process() android: camera_device: Send capture results inspecting the descriptor android: camera_stream: Run post processor in a thread src/android/camera_device.cpp | 158 +++++++++++++++-------- src/android/camera_device.h | 52 +++++--- src/android/camera_stream.cpp | 55 +++++--- src/android/camera_stream.h | 16 ++- src/android/camera_worker.cpp | 6 +- src/android/camera_worker.h | 5 +- src/android/jpeg/encoder.h | 2 +- src/android/jpeg/encoder_libjpeg.cpp | 4 +- src/android/jpeg/encoder_libjpeg.h | 2 +- src/android/jpeg/post_processor_jpeg.cpp | 25 ++-- src/android/jpeg/post_processor_jpeg.h | 9 +- src/android/jpeg/thumbnailer.cpp | 4 +- src/android/jpeg/thumbnailer.h | 2 +- src/android/post_processor.h | 16 ++- src/android/yuv/post_processor_yuv.cpp | 43 +++--- src/android/yuv/post_processor_yuv.h | 9 +- 16 files changed, 263 insertions(+), 145 deletions(-)