From patchwork Thu Oct 15 17:14:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10058 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 60ED3BE905 for ; Thu, 15 Oct 2020 17:15:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 30C2F60E8D; Thu, 15 Oct 2020 19:15:08 +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="JkujqYzL"; 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 4B90460E36 for ; Thu, 15 Oct 2020 19:15:06 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1602782105; bh=U5d5s+uqvZ20yOYM5r4Z4ntu2jEJ9Hr/NgTrBYH88Js=; h=From:To:Cc:Subject:In-Reply-To:References; b=JkujqYzLB0qm3FI0s7YW85v120UV5rXWpSod1Hy/ia/m3uaDgtGOLwsNYEIrpjG4w BozfPKI902AEa86pyLsLvJgCwxaHiDhhm7jSR7iSfMrVjy0f9NPWHiD5x9/H59QjJP b6dFeoWi0+Qm2QDfvsmSAiZL9Gu9YNv+SAwHkh5jks6kcc2yTXLUOP3sVPs/1bTmXk JoVnjQtVpDYPKvX9BQke39A6RrlAft0oHZEyLzcWY12IJ6fkyZFRtxFx6cTg/iMncX 2hQbopGDlusWXDce+u8Mle6U5zSjpVp3h8E+2PR2afRWCxVTUOq4/5PZjRz6hsfVkz mVxGbZWkw7L7Q== To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Oct 2020 22:44:55 +0530 Message-Id: <20201015171457.75678-2-email@uajain.com> In-Reply-To: <20201015171457.75678-1-email@uajain.com> References: <20201015171457.75678-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] 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 --- 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__ */