From patchwork Thu Aug 19 20:12:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13406 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 E7C79BD87C for ; Thu, 19 Aug 2021 20:12:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B05B768892; Thu, 19 Aug 2021 22:12:28 +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="f7kct3tp"; dkim-atps=neutral Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6491568886 for ; Thu, 19 Aug 2021 22:12:27 +0200 (CEST) Received: by mail-pj1-x1035.google.com with SMTP id n5so5753614pjt.4 for ; Thu, 19 Aug 2021 13:12:27 -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=IItZONdRsf6myZue/Zxd9Ah1tuvheEbNbYCkrjA/rIQ=; b=f7kct3tpiivcKOmqU6EtaN95Asg/UvUPtjYNVqc2Qaeb1bx+eeHi43FVQlySGhREKl +iJOW4UrsmOM32WgS8IIhtJs0wpY6DCnuYsafsqZpJJCS7yjI9MocR3o0VM8txUUUrE3 SKRR/Azls6/KmX/afU3CV0Mu9QVywhdEjlkXU= 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=IItZONdRsf6myZue/Zxd9Ah1tuvheEbNbYCkrjA/rIQ=; b=lp6tJa5QgmIu7LTa6X3SS8zDgv4uAKCduNfblpoUjsk9N0gHCgSHAFn/cAeIvjBsWE gb5XznCcGpXR5vh62ju4p2Qr58xDzYtebh8SIio37hmU7iu/2KlvI2Xle2sjnSC9Xsn3 011qNzskZM14WZfgmKK2FFFUwmAUgXoKh2e+ezkRM1L3aTdSNTPBChdXATCfRx5A0s/F h6oTUl6692apgitzZsTJV8e4n3sE6/bMJiShcc2P4Ooq8D/BCnvsuFQ42yzEJY3ZqHB+ 8aZLjJ9CCMGY39kAVvT4Ae4YO7k0RByx2rBFswj8+rmOwGWpkzcIBKmjjuC1c7LbeyS/ 6EbQ== X-Gm-Message-State: AOAM5315H4SzJuF6lKbWmg0UNMDmhoOOMy/+rvjiSYQEL2X6Cle+doAW m/g+0jPbkguqTQsi2HfZ6HtrjtHLxahU1A== X-Google-Smtp-Source: ABdhPJzYDYToDFoJl/ZsmQtmit3Q6HEo0G6ih/W1rMsFfr32pz1bnq38Y3rtMHh+trDUbcANhrjjcA== X-Received: by 2002:a17:90b:e87:: with SMTP id fv7mr503617pjb.85.1629403945687; Thu, 19 Aug 2021 13:12:25 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:4298:71ae:6ebb:72eb]) by smtp.gmail.com with ESMTPSA id i11sm4303695pfo.29.2021.08.19.13.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 13:12:24 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 20 Aug 2021 05:12:13 +0900 Message-Id: <20210819201214.1554322-3-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog In-Reply-To: <20210819201214.1554322-1-hiroh@chromium.org> References: <20210819201214.1554322-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 --- 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 c205cd7a..c728051f 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;