From patchwork Fri Oct 16 05:37:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10074 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 5FB63BE174 for ; Fri, 16 Oct 2020 05:38:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D42460E5A; Fri, 16 Oct 2020 07:38:06 +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="HTDZhIxF"; 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 531EB60354 for ; Fri, 16 Oct 2020 07:38:04 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1602826683; bh=KTlKugmAmfObqwGs37aWbkUtA/JAOec/2eR28mqa27c=; h=From:To:Cc:Subject:In-Reply-To:References; b=HTDZhIxFxjzREwaQ8dNYPmzinKUObaXkrSQAKlpa8u82y5Q9tOPSCZGz5vrjERDfv ZBKiAg+6fNwH+flcGWhh3eZtSrb6ksxBpfdK4hPDIZykaff5SNd0awBaniVia/jhID IeuJayPzjdwpQXtbYK5pqyiTB/FhWzyDVphtbcKjRVOQ5RLFflmHLzNSQkYNdUZFIR jLN/wUm3gz1J1mpZ7rlultfWVV3tD/G6FHcInYsxexwdqOWnzjPU6JiYSk/E8m59je fy46LdmCjWWEBNBvEUrvawMUr9ScNYIps1dk+NYEgM3jtg2l99i5IkUodffgfHJa2b /orSq2curNyRA== To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Oct 2020 11:07:53 +0530 Message-Id: <20201016053754.17251-2-email@uajain.com> In-Reply-To: <20201016053754.17251-1-email@uajain.com> References: <20201016053754.17251-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] android: post_processor: Introduce a PostProcessor interface 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" Introduce a PostProcessor interface for the streams that require any kind of processing (refer to CameraStream::Type) for their consumption by the HAL layer. The PostProcessor interface can be configured via configure() and the actual processing can be initiated using process(). The post-processing layer can be extended to have multiple post processors for various stream configurations. As of now, we only have one post processor (JPEG), hence the subsequent commit will port its function to this interface. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda --- src/android/post_processor.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/android/post_processor.h diff --git a/src/android/post_processor.h b/src/android/post_processor.h new file mode 100644 index 0000000..a891c43 --- /dev/null +++ b/src/android/post_processor.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * post_processor.h - CameraStream Post Processing Interface + */ +#ifndef __ANDROID_POST_PROCESSOR_H__ +#define __ANDROID_POST_PROCESSOR_H__ + +#include +#include +#include + +class CameraMetadata; + +class PostProcessor +{ +public: + virtual ~PostProcessor() {} + + virtual int configure(const libcamera::StreamConfiguration &inCfg, + const libcamera::StreamConfiguration &outCfg) = 0; + virtual int process(const libcamera::FrameBuffer *source, + const libcamera::Span &destination, + CameraMetadata *metadata) = 0; +}; + +#endif /* __ANDROID_POST_PROCESSOR_H__ */