From patchwork Tue Aug 31 09:34:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13581 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 52559BD87D for ; Tue, 31 Aug 2021 09:34:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E3C06916E; Tue, 31 Aug 2021 11:34:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="GTmQH4F/"; dkim-atps=neutral Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7EE7660288 for ; Tue, 31 Aug 2021 11:34:49 +0200 (CEST) Received: by mail-pg1-x532.google.com with SMTP id 17so16084355pgp.4 for ; Tue, 31 Aug 2021 02:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QVjXR02ZDHCX2y9ypwQuJT+gVqFw+9N0XA4WuPDjA9w=; b=GTmQH4F/TPJSeMnh7rTJgk/dfmuNTRd8JVL7OkemPskmvuPL7uFN4Bfiv1Td5vEcF/ +xtb85CEytccvy6dstWqTzwlmQ0x5yJ460ZDlHcmoHoe/ipy2sj38Vl4VJ1dbX+3MGb1 2QtNEu424BuPr5vt0zPswjEdZ8kyfcRYzymdc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QVjXR02ZDHCX2y9ypwQuJT+gVqFw+9N0XA4WuPDjA9w=; b=jyaYUiKbhjaIRnwanK+8Ivko+BS4oUBvWs9H+1Bk7baiEI0sZu02doQ6LOTY1/OJLo Pxqb3BeCnYhc6A7PoJLphedudMKT4IOHc20zSp88dCxdx4nOxdilZjDvbYg8vdlX+VJR eQpeb/5wemkRTFFW16wvpP8tysLveAQ/5LGRkJ576iihC4i25EpIJ7eGL8QQgI8/zphj KUKE1wCpnZZGsK7gaqBKuNMbYDrokHsHuQKJt7xUOf0WFapzewgIQRukiYQXXhp7gE8+ bzDd5j+JXPldrKpkjEQVFQm+6R2Wfsf5lxN5gt/jEBjqN2KuvVB9kUQiz7LZgK8wG5HS UjNw== X-Gm-Message-State: AOAM532WBLLWslJruqEWjsiGSfd8hslvlDXcmAEEX5CnLALqd94rwUp/ rEusdyq4VS4UrJ0b3pNmP46iMgrHiQSx3A== X-Google-Smtp-Source: ABdhPJyVxYfklA9qdCFXMW3lPnT5L5t6V96EEev/3AuEoz3QeDKblvHxsIh37DqHyc10fQOnFWr0pA== X-Received: by 2002:a62:9288:0:b0:3e1:c44f:a1b7 with SMTP id o130-20020a629288000000b003e1c44fa1b7mr28027543pfd.63.1630402487835; Tue, 31 Aug 2021 02:34:47 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:3c62:aba4:18ea:5441]) by smtp.gmail.com with ESMTPSA id w5sm19787885pgp.79.2021.08.31.02.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 02:34:47 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 31 Aug 2021 18:34:38 +0900 Message-Id: <20210831093439.853586-3-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog In-Reply-To: <20210831093439.853586-1-hiroh@chromium.org> References: <20210831093439.853586-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/3] android: camera_stream: Support PostProcessorYuv in CameraStream 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" CameraStream creates PostProcessorYuv if the destination format is NV12. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/android/camera_stream.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index fb10bf06..49a2e336 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -9,13 +9,15 @@ #include +#include + +#include "jpeg/post_processor_jpeg.h" +#include "yuv/post_processor_yuv.h" + #include "camera_buffer.h" #include "camera_capabilities.h" #include "camera_device.h" #include "camera_metadata.h" -#include "jpeg/post_processor_jpeg.h" - -#include using namespace libcamera; @@ -68,6 +70,12 @@ int CameraStream::configure() StreamConfiguration output = configuration(); output.pixelFormat = outFormat; switch (outFormat) { + case formats::NV12: + postProcessor_ = std::make_unique(); + output.size.width = camera3Stream_->width; + output.size.height = camera3Stream_->height; + break; + case formats::MJPEG: postProcessor_ = std::make_unique(cameraDevice_); break;