From patchwork Wed Jan 18 08:59:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18127 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 3A489C3294 for ; Wed, 18 Jan 2023 09:01:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C2F8A625E8; Wed, 18 Jan 2023 10:01:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674032478; bh=QkvgCjnb1SkCZNUezMj93jhzlLB9aGvfY1B1Coe2aPo=; 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=sl5AWh96R7bBpG3fgvLG2Q27z29758JsMbaHO7XJrOfzD2BJMWFp7Tiuw8o4OaRJ6 K1gcDLe63Pg1NGam5McQ5G0tRToab19ENW9GxEyft2vXbTg1ScesrDvm2cxtGXW7qX ey/TWwL/h9os3ZeqUFnJGWleJ6RWv8IKmf4b4Td5jBPKD7gyR/RPVkHdMYlM2fP++c bllkz/pwQPW43s1wN+FX4zRe/3cxTpGoCzebjhiZQZXP5oNcH+o4ZIsp/z1ldp8ddA TXvBjVkrSL90rWqMFAMjW09dfCtqYqUAhD+/9UAqus7SLiLOm7HnUarmnft7Wdwid4 dciZ0Jm0Tc1sg== Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B4AD7625D8 for ; Wed, 18 Jan 2023 10:01:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="jpA4+qnE"; dkim-atps=neutral Received: by mail-wr1-x436.google.com with SMTP id r9so10402228wrw.4 for ; Wed, 18 Jan 2023 01:01:16 -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=xCtV3Pwa506NG4l5A7ynk9d9USDPVq0OwwiiFJsSw4Y=; b=jpA4+qnEnCrCnw/j/vPMqF8C8a4/sAQ1ch3z8/KNPToySSwj39NmQfsCQTyKJMH5nf 0NPurXaybdYwuzlETUrMtbSSU3UHWFNkkcid48zXbkcbY7LRUwTGhyP46mq4rDv6TE1C 9l/vIwoBd8vj1+vC1QThU5BUeQcAdQPR/EMlGq5XeN7qFfXXZSKMQb4gUogMfu4l3/sa 8BUxdb+EJgs/vTqPyXM/lTBYD10l2d1TU7li/bBdWuEQeLj1RSzO0Db6QK0NHQ/VSx0O Hn8/O1Vr+kVtdI94viyr8ZxwfjLsYWm0ReJUn30Eyu+dF4pWasscghI78PaqyVgXICHM ymeA== 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=xCtV3Pwa506NG4l5A7ynk9d9USDPVq0OwwiiFJsSw4Y=; b=kiZH6a+au/wO2SIJ8ZY/ToVRvqXHYyT6Wx3COcjnUP/vtkfMriBUxXLa2AL+PPY3sm buaA6OlXJZP165oo844KdYngNwsNlKK1oq9mS8VTPDISSlwVHyw5XfV9yhsnGj/JZPsh eUpoenA4GPaixr9FXnIvlnhQx3r+vU1khi98UfFo+CcXmVC1wWcVwUltqyqIncv2fYIr xYcwExc0qEGKLqdlemdVKi5Nr4LpU0oPAwc6mhzAl81OPYrPbYzsplcBTVW+mBX2z+px VIpkS3CErGp6+KA6R65jch2fx6Omgl44E5/LPCnlDqfBSFZbcf7Qp3XKC6zZauflE40V c8SA== X-Gm-Message-State: AFqh2kpDGpjbkoffU/2swf0fxk2rxIacEubO6Llh2I3P8DC84wvGxTGV tzbp+skQtoHChVbTBZew3d0Lbdq8o3OdnEy5w+s= X-Google-Smtp-Source: AMrXdXsQ/feAZJstXNbNbqLvgIak+ogYMmTSLLOxKQF1Bzev7r0HZ/0z1xOCgYzoZpFZC7hooNlwVQ== X-Received: by 2002:a05:6000:98d:b0:25f:8ead:96cc with SMTP id by13-20020a056000098d00b0025f8ead96ccmr5527753wrb.70.1674032476013; Wed, 18 Jan 2023 01:01:16 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b002423dc3b1a9sm30312464wrm.52.2023.01.18.01.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 01:01:15 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Jan 2023 08:59:42 +0000 Message-Id: <20230118085953.7027-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230118085953.7027-1-naush@raspberrypi.com> References: <20230118085953.7027-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 01/12] 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, OptionalStream, which the application can set to inform the pipeline handler that a buffer may not be provided on every Request for a given stream. Signed-off-by: Naushir Patuck --- include/libcamera/stream.h | 8 ++++++++ src/libcamera/stream.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 29235ddf0d8a..233ff0450451 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, + OptionalStream = (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..b7de85f8b9c7 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -349,6 +349,30 @@ 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::OptionalStream + * Informs the pipeline handler that the application may not always provide a + * buffer for the configured stream in every Request. This may ensure the + * pipeline handler allocates additional stream buffers 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 allocating additional + * buffers for internal use if an application does not guarantee buffers will be + * provided in every Request for a stream. + */ + /** * \fn StreamConfiguration::stream() * \brief Retrieve the stream associated with the configuration