From patchwork Sun Aug 14 16:07:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunal Agarwal X-Patchwork-Id: 17120 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 3AE02C3272 for ; Sun, 14 Aug 2022 16:09:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EC89D61FC3; Sun, 14 Aug 2022 18:09:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660493359; bh=XXyEynVdu4y+F579v801F4ppNzP39vH+kn2cB1i9Yis=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KzgqQ1oHi6/7IqiY6XXgVQXYuECZs47ZQDWiVe5oM1SOPpMaFGMuUa6RrzPBVlCjM ZhWyVT8YV+FJhJHRa2Nsue/GV6LONo96XexwgJ7vYQCeo+aT0ndcXnsKUPiaj+YBSl OVJX2B05lYCJwTPnb7wkj6LU+/PExXmvrvIzKTYmYnlntEeF3K3N01MrpUidkw8mQk 98Yq6/hB2pA1l4FdxBn6Cc8Dhd1NLvmU3ULQVn7SPH8nq2iUr+iRLu+2DzXtBaphDj WFxqmU31cvMYeAT6isAJnVVMwuazgcIm5a4AqntVu+JM03htrVs6fjhG6aGsdEgujf 6sRy3UcPw+Kww== Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B794461FBA for ; Sun, 14 Aug 2022 18:09:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MTzFAGB6"; dkim-atps=neutral Received: by mail-pl1-x631.google.com with SMTP id x23so4589491pll.7 for ; Sun, 14 Aug 2022 09:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=FkuiYHjnNT30yQpCOMkDwgtN3xIa8EcKcOneXpSZ+38=; b=MTzFAGB6dFfmEKL4aMJ1IfvgG2bY58d4iifPZ1DrRZddw4gcgtYb8nw+0waALmg4e1 PmZlhWjKbg3uss4xvTkZi3Qa/H5dNYP3TvwTRy847GEqjeDao7X9a8LY9RaULDaPqneJ 5x3uygbP14oH8flw4VyiEc8fAht1eW+p3WiD20k/QEcKq5HxRWFCffiG9N3XrXLW/3KO Sm6xH5U1KbLqjNNjXM1lijoodyeJ/LpPvtPOlhA3jriwJay0KgNRUpGAA1d15Y27a5H3 PgryKwQvfeanLKEKCkCv5oHMAN5s30cnVilEnpolvcrQkO7Q0mPZ2m5A/0jp9KbE4TBQ Wa3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=FkuiYHjnNT30yQpCOMkDwgtN3xIa8EcKcOneXpSZ+38=; b=BNfWaCN8irCWVHN9WD89+7eDkNwfMOKOsWidMWo8bNu3gxZITVvZO15It6elo9ReSw TNR73eyuEODcrW0Xz9zjEMdoUeGNmqUY9dTfT1cRp3RT+mm/v6e5g97fhoEgutLfBRbE x/jqwQGxHlA3Kl8d8lfX9wFRePVYFJJjzlxCbT89V8C/SLf84SW1QNLN2c09qUWOT++v LGCRlX2f/c2JKBkmdI0i+zl6yzgZwNKxb+6SOqnuh0jD9WodE8VXcLf9HjN4cIJn+KbR xBfOIeywXB++LGd7Dc3M0zxZkHeZdWlGZeUss8dCxyMHmniQbuz0POO9/LgwODau/rkb Yx1Q== X-Gm-Message-State: ACgBeo2o2+sH58zQhUfjxaESyGrebl7IRytjGJMRi9HBslyyY7JMuPre SZLWzsOBcns4ePc2V/HrBFNy8Q0hTtM= X-Google-Smtp-Source: AA6agR4w4ukh/d2obgSkZympMGAuP/SNM0AixE9YZBkYQ+SW/hOxGSQPp4ZRb39DZvji2a98tWv6mQ== X-Received: by 2002:a17:90b:4b89:b0:1f5:68b:b14e with SMTP id lr9-20020a17090b4b8900b001f5068bb14emr24544244pjb.30.1660493357121; Sun, 14 Aug 2022 09:09:17 -0700 (PDT) Received: from pop-os.localdomain ([115.96.217.20]) by smtp.googlemail.com with ESMTPSA id j6-20020a170902da8600b001709aea1516sm5576653plx.276.2022.08.14.09.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 09:09:16 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 14 Aug 2022 21:37:46 +0530 Message-Id: <20220814160747.52093-5-kunalagarwal1072002@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220814160747.52093-1-kunalagarwal1072002@gmail.com> References: <20220814160747.52093-1-kunalagarwal1072002@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 5/6] [HACK]pipeline: simple: simple.cpp: Hack to test the GL converter 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: , X-Patchwork-Original-From: Kunal Agarwal via libcamera-devel From: Kunal Agarwal Reply-To: Kunal Agarwal Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Includes converter_gl header file and add unicam to list of supported devices to run on RaspberryPi Removes parameterized constructor call for SimpleConverter, which passed Mediadevice converter Sets Number of streams to 1 when converter is in use Signed-off-by: Kunal Agarwal --- src/libcamera/pipeline/simple/simple.cpp | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index bc0cb1a0..485282fb 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -36,7 +36,7 @@ #include "libcamera/internal/v4l2_subdevice.h" #include "libcamera/internal/v4l2_videodevice.h" -#include "converter.h" +#include "converter_gl.h" namespace libcamera { @@ -187,6 +187,7 @@ static const SimplePipelineInfo supportedDevices[] = { { "imx7-csi", { { "pxp", 1 } } }, { "qcom-camss", {} }, { "sun6i-csi", {} }, + { "unicam", {} }, }; } /* namespace */ @@ -452,18 +453,16 @@ int SimpleCameraData::init() SimplePipelineHandler *pipe = SimpleCameraData::pipe(); int ret; - /* Open the converter, if any. */ - MediaDevice *converter = pipe->converter(); - if (converter) { - converter_ = std::make_unique(converter); - if (!converter_->isValid()) { - LOG(SimplePipeline, Warning) - << "Failed to create converter, disabling format conversion"; - converter_.reset(); - } else { - converter_->inputBufferReady.connect(this, &SimpleCameraData::converterInputDone); - converter_->outputBufferReady.connect(this, &SimpleCameraData::converterOutputDone); - } + /* Open the converter. */ + + converter_ = std::make_unique(); + if (!converter_->isValid()) { + LOG(SimplePipeline, Warning) + << "Failed to create converter, disabling format conversion"; + converter_.reset(); + } else { + converter_->inputBufferReady.connect(this, &SimpleCameraData::converterInputDone); + converter_->outputBufferReady.connect(this, &SimpleCameraData::converterOutputDone); } video_ = pipe->video(entities_.back().entity); @@ -1281,7 +1280,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator) DeviceMatch converterMatch(name); converter_ = acquireMediaDevice(enumerator, converterMatch); if (converter_) { - numStreams = streams; + numStreams = 1; break; } }