From patchwork Fri Feb 3 09:44:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18246 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 922CFC3243 for ; Fri, 3 Feb 2023 09:44:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4AC5A625EB; Fri, 3 Feb 2023 10:44:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675417470; bh=1NQfkm46gkmlgegsWn0lnrEGMhw+21+M3ZnxqhkEqek=; 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=MJMAWdoB9XlLnvxPSB8FP9fYUXe+mp/LsGmmqY0q5OFIxPYBnrp6L/TgqkMlMsGtV 0g+Gk7xSx3VnsQU7yU0gZa1oy9VXnS7D8Hq5dAWk0D7C8/olKbih9Ll4qMKLxwS/zE 9N0dH1QROEfYQO8snhiWUvFPaXiBGS9VKvHiozrXyu1ASCfMjnkcKRV7o+EgwFpoZI QQpcIjsIBU1ZlfEzkj/J06XOn0MpVEn3uG4tUBP4kPUCQp6TxBjVePXaFnrkQcKsoq F3cdTdM53FfZW6cxyhIjX6xhVhvaeEX7/NehqokCSmkZ+il9b5hsdXS75ju88xjSQy 2LOSYTSDJ8M3w== Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 71AA661EF4 for ; Fri, 3 Feb 2023 10:44:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="crDRBVLY"; dkim-atps=neutral Received: by mail-wr1-x42e.google.com with SMTP id a2so3825606wrd.6 for ; Fri, 03 Feb 2023 01:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/Puf9MTPyfFZF0uns/wRRwCfjTobp9ecB2pODryenMo=; b=crDRBVLYdCn1zaQETs2AOz3gG/uoK/KQMv4pygtjKfqb3GlXa7WyidXkIXVBHiefVA E3HEI6hEDcMwWsiNr4Q0guMKbGt/n4h8733wcR1zqtGGsfS+fzxc9xnPtNoW2jO2ELuH bUSZiNmwqjIIQdXLsyFcPSCPohdSNGpJa6S5D8Vah9Dxx6E6L92eLYbC5KyvWDorvmy7 O06S1yIh4OuQW/79bXVmYCven0safP5mogvnuoSDgJ11MXPoGDGkW1E5DI6iA02/XBNu srL0JgsIoyJHmmQokhC7ZJmGhBJowvSk2HWkmQyaMsUKQT5ZmOvzeDZccfiNR7sAUos4 HJCQ== 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 :subject:date:message-id:reply-to; bh=/Puf9MTPyfFZF0uns/wRRwCfjTobp9ecB2pODryenMo=; b=phBqpOPt4i+AGzldmvfr+9ur5itMflgKcZTXi14OJ/7qwxRS608xTc/FE7bey97ble D+m1eEkmceyQlC/oepSbOBQfF5cmuFvJqlCWh+0m1vG2CjoChQJszS6oyAUdFadXWPRI /f3OGSiCl6/EFRtl7Qw4QOkzBVK03EX+mj7wpdzRx4fo+KVrq2jHL0LAWbS38KDDy/kl kypqYueD8TXapyrBcOdvy2cUKrsKMmIj0Go1ZLm8HBqMrmf1ZwIbtVkcTAh+8fRshDmo 8l1l1V0vT0JkJ1E4ect96zYvM3NXk/Ek6KM51YI6cqMA3mZourW+QgQIMWsSOk9DIO0N TSrA== X-Gm-Message-State: AO0yUKVQ/XbZhfa65bH1P+qrLx+C9qM/7Prv/a77aIkHbG2N1yvfG/WN +dHtO27h8cvUAzp1tkdn27Vy7YklIs67m3Zlup+YRg== X-Google-Smtp-Source: AK7set/wXMmExU+hil82JZOZ4jXdrTMad8/PT6mwOJIRj2OPp0vhbO6XixVcAmTbAd+kbrjbDpmsCA== X-Received: by 2002:adf:dc03:0:b0:2bf:f2f2:7d64 with SMTP id t3-20020adfdc03000000b002bff2f27d64mr8415689wri.33.1675417467848; Fri, 03 Feb 2023 01:44:27 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id f17-20020a5d50d1000000b002bfe266d710sm1562503wrt.90.2023.02.03.01.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 01:44:27 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Feb 2023 09:44:17 +0000 Message-Id: <20230203094424.25243-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230203094424.25243-1-naush@raspberrypi.com> References: <20230203094424.25243-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream hints to StreamConfiguration 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new hints flags field in the StreamConfiguration structure to allow the application to specify certain intended behavior when driving libcamera. Pipeline handlers are expected to look at these hint flags and may optimise internal operations based on them. Currently, only one flag is listed, MandatoryStream, which the application can set to inform the pipeline handler that a buffer will always be provided on every Request for a given stream. Signed-off-by: Naushir Patuck --- include/libcamera/stream.h | 8 ++++++++ src/libcamera/stream.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 29235ddf0d8a..56e5a74b2aab 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -13,6 +13,8 @@ #include #include +#include + #include #include #include @@ -51,6 +53,12 @@ struct StreamConfiguration { std::optional colorSpace; + enum class Hint { + None = 0, + MandatoryStream = (1 << 0), + }; + Flags hints; + Stream *stream() const { return stream_; } void setStream(Stream *stream) { stream_ = stream; } const StreamFormats &formats() const { return formats_; } diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 67f308157fbf..9b0e8dd548cf 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -349,6 +349,31 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) * color spaces can be supported and in what combinations. */ +/** + * \enum StreamConfiguration::Hint + * \brief List of available hint flags provided by the application for a stream + * + * \var StreamConfiguration::Hint::None + * No hints for this stream. + * \var StreamConfiguration::Hint::MandatoryStream + * Informs the pipeline handler that the application will always provide a + * buffer for the configured stream in every Request. This may ensure the + * pipeline handler does not need any additional stream buffer allocations for + * internal use. + */ + +/** + * \var StreamConfiguration::hints + * \brief Application provided StreamConfiguration::Hint flags for specific + * stream behavior + * + * Provides hints from the application to the pipeline handlers on how it + * intends on handling a given configured stream. These hints may alter the + * behavior of the pipeline handlers, for example, by not allocating additional + * buffers for internal use if an application guarantees buffers will be + * provided in every Request for a stream. + */ + /** * \fn StreamConfiguration::stream() * \brief Retrieve the stream associated with the configuration