From patchwork Fri Jan 27 15:43:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18201 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 2E66BBDC71 for ; Fri, 27 Jan 2023 15:43:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B6AA5625EF; Fri, 27 Jan 2023 16:43:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674834218; 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=E6D3sinvRJQkc6Je7MfllTa14o8AnSYRY1tbSu5mmpvwGEK1JjUVFR3TizOFgZi5L VnXYGFG1lW7YS5xSKba7RpyPeRDo++aQHSdgDp4yBpSyL6WOekgwprXqnwcVbQn3XS jOZfXR/0tDe7Jkbw4ODJ3EjJ3oReX4v5x/pJ8TKhFeDv0MnBmHJxZMybVhVKMaAQTE CBR4lZYu8lxoi/EVSdf/DihTjisJMyDQLNUgLHiwz7AWiGX98+j4pHuRZTpEHNwQwv P91CSGT4T6x5zEkMQSBn418pBN60ADpTyQOLGikeSRgjxJ4aMh0eGjCIyXGgUH8sn7 Gnc/0pGde/oSQ== Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C9ED761EFA for ; Fri, 27 Jan 2023 16:43:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="P7KpJQoO"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id j17so3774841wms.0 for ; Fri, 27 Jan 2023 07:43:36 -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=P7KpJQoOjJ2vx0fX3W9dIWcNfi+GU7vxE5Lf5FWj39Ervrpt/rVHOLJU2uTsU1447e 14aGQyfghDdnNW9Jvr427W9wkK0XakGzC1LuWm4tT8giyguxp4Kb+vNuW7K99oxsuEeA SXoerMFy3WpndV8sRsFx+4pNSDvMfJJZgtkoEoxFBboO4VY5GFn6W0qORwT8atEglQxd GF1NwzVCknXl//3RLjnnkb5xMJ9eAFarFqnzy0CKnkRW3I5nt1aaBarV1pLRnyYclE4h SfH1fUXbR8aVXtzm2r1i3QBDItUwizsqTy1ltZtQ0+cppe89voUpWbyQRXFsVGNK8e1K L7Dw== 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=gjyLuNvdq7VVx2lrEuT51T9IrP7swSCrFipGQOBpPhN9Kf54zu24PBdvBtnL+l/Ve7 9+Ek6/awdGIOK9b3kW2+g4Bir/MZek9BKYu+zEVsexOja7P1P9Cz1cKxWJV1Li7Tj+bH WYsAI0Tr9pux9Faik0u5HGiwEPz6qPhSm/igL0+KdFoCXk81RC1iXOro4MMV1rDes8UL P8s0AM93RwZ4reroKFQomravHgzpOS9FVHOxnOKPS7QfvQUgYetA+IW9Qn8r5iIbYbjj YPb2fk9ERfH69cVnBWDP8vcX9W4g95X1inhcKPK/cFoLmeRMPhZMjQyDizatC2BIevTi BOFw== X-Gm-Message-State: AFqh2kp37LO8/yTV4WC0C07o9guZWEVl7wZqAw4nFDCzA8Z60xflCmLf sFxJxefITc2yoi1mZdUuc+Eb+sFYk6k3N1r1I0s= X-Google-Smtp-Source: AMrXdXtzvtOaD+rMRwXG0xawSPbEa1lBz05TMDWpkaYIPvnDWr3l3VBND8ATCZvDyzzDGO4n0swV+Q== X-Received: by 2002:a05:600c:5114:b0:3db:254e:59a9 with SMTP id o20-20020a05600c511400b003db254e59a9mr31104326wms.15.1674834216045; Fri, 27 Jan 2023 07:43:36 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 07:43:35 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 27 Jan 2023 15:43:08 +0000 Message-Id: <20230127154322.29019-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230127154322.29019-1-naush@raspberrypi.com> References: <20230127154322.29019-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 01/15] 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 Reviewed-by: Kieran Bingham --- 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