{"id":18127,"url":"https://patchwork.libcamera.org/api/1.1/patches/18127/?format=json","web_url":"https://patchwork.libcamera.org/patch/18127/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230118085953.7027-2-naush@raspberrypi.com>","date":"2023-01-18T08:59:42","name":"[libcamera-devel,v5,01/12] libcamera: stream: Add stream hints to StreamConfiguration","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2b0050159f50c31fd4487c2a16b9621a27cda40c","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18127/mbox/","series":[{"id":3713,"url":"https://patchwork.libcamera.org/api/1.1/series/3713/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3713","date":"2023-01-18T08:59:41","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":5,"mbox":"https://patchwork.libcamera.org/series/3713/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18127/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18127/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3A489C3294\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Jan 2023 09:01:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C2F8A625E8;\n\tWed, 18 Jan 2023 10:01:18 +0100 (CET)","from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B4AD7625D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 10:01:16 +0100 (CET)","by mail-wr1-x436.google.com with SMTP id r9so10402228wrw.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 01:01:16 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ti6-20020adfe486000000b002423dc3b1a9sm30312464wrm.52.2023.01.18.01.01.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Jan 2023 01:01:15 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674032478;\n\tbh=QkvgCjnb1SkCZNUezMj93jhzlLB9aGvfY1B1Coe2aPo=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=sl5AWh96R7bBpG3fgvLG2Q27z29758JsMbaHO7XJrOfzD2BJMWFp7Tiuw8o4OaRJ6\n\tK1gcDLe63Pg1NGam5McQ5G0tRToab19ENW9GxEyft2vXbTg1ScesrDvm2cxtGXW7qX\n\tey/TWwL/h9os3ZeqUFnJGWleJ6RWv8IKmf4b4Td5jBPKD7gyR/RPVkHdMYlM2fP++c\n\tbllkz/pwQPW43s1wN+FX4zRe/3cxTpGoCzebjhiZQZXP5oNcH+o4ZIsp/z1ldp8ddA\n\tTXvBjVkrSL90rWqMFAMjW09dfCtqYqUAhD+/9UAqus7SLiLOm7HnUarmnft7Wdwid4\n\tdciZ0Jm0Tc1sg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=xCtV3Pwa506NG4l5A7ynk9d9USDPVq0OwwiiFJsSw4Y=;\n\tb=jpA4+qnEnCrCnw/j/vPMqF8C8a4/sAQ1ch3z8/KNPToySSwj39NmQfsCQTyKJMH5nf\n\t0NPurXaybdYwuzlETUrMtbSSU3UHWFNkkcid48zXbkcbY7LRUwTGhyP46mq4rDv6TE1C\n\t9l/vIwoBd8vj1+vC1QThU5BUeQcAdQPR/EMlGq5XeN7qFfXXZSKMQb4gUogMfu4l3/sa\n\t8BUxdb+EJgs/vTqPyXM/lTBYD10l2d1TU7li/bBdWuEQeLj1RSzO0Db6QK0NHQ/VSx0O\n\tHn8/O1Vr+kVtdI94viyr8ZxwfjLsYWm0ReJUn30Eyu+dF4pWasscghI78PaqyVgXICHM\n\tymeA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"jpA4+qnE\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=xCtV3Pwa506NG4l5A7ynk9d9USDPVq0OwwiiFJsSw4Y=;\n\tb=kiZH6a+au/wO2SIJ8ZY/ToVRvqXHYyT6Wx3COcjnUP/vtkfMriBUxXLa2AL+PPY3sm\n\tbuaA6OlXJZP165oo844KdYngNwsNlKK1oq9mS8VTPDISSlwVHyw5XfV9yhsnGj/JZPsh\n\teUpoenA4GPaixr9FXnIvlnhQx3r+vU1khi98UfFo+CcXmVC1wWcVwUltqyqIncv2fYIr\n\txYcwExc0qEGKLqdlemdVKi5Nr4LpU0oPAwc6mhzAl81OPYrPbYzsplcBTVW+mBX2z+px\n\tVIpkS3CErGp6+KA6R65jch2fx6Omgl44E5/LPCnlDqfBSFZbcf7Qp3XKC6zZauflE40V\n\tc8SA==","X-Gm-Message-State":"AFqh2kpDGpjbkoffU/2swf0fxk2rxIacEubO6Llh2I3P8DC84wvGxTGV\n\ttzbp+skQtoHChVbTBZew3d0Lbdq8o3OdnEy5w+s=","X-Google-Smtp-Source":"AMrXdXsQ/feAZJstXNbNbqLvgIak+ogYMmTSLLOxKQF1Bzev7r0HZ/0z1xOCgYzoZpFZC7hooNlwVQ==","X-Received":"by 2002:a05:6000:98d:b0:25f:8ead:96cc with SMTP id\n\tby13-20020a056000098d00b0025f8ead96ccmr5527753wrb.70.1674032476013; \n\tWed, 18 Jan 2023 01:01:16 -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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 01/12] libcamera: stream: Add stream\n\thints to StreamConfiguration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a new hints flags field in the StreamConfiguration structure to allow the\napplication to specify certain intended behavior when driving libcamera.\nPipeline handlers are expected to look at these hint flags and may optimise\ninternal operations based on them.\n\nCurrently, only one flag is listed, OptionalStream, which the application can\nset to inform the pipeline handler that a buffer may not be provided on every\nRequest for a given stream.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n include/libcamera/stream.h |  8 ++++++++\n src/libcamera/stream.cpp   | 24 ++++++++++++++++++++++++\n 2 files changed, 32 insertions(+)","diff":"diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 29235ddf0d8a..233ff0450451 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -13,6 +13,8 @@\n #include <string>\n #include <vector>\n \n+#include <libcamera/base/flags.h>\n+\n #include <libcamera/color_space.h>\n #include <libcamera/framebuffer.h>\n #include <libcamera/geometry.h>\n@@ -51,6 +53,12 @@ struct StreamConfiguration {\n \n \tstd::optional<ColorSpace> colorSpace;\n \n+\tenum class Hint {\n+\t\tNone = 0,\n+\t\tOptionalStream = (1 << 0),\n+\t};\n+\tFlags<Hint> hints;\n+\n \tStream *stream() const { return stream_; }\n \tvoid setStream(Stream *stream) { stream_ = stream; }\n \tconst StreamFormats &formats() const { return formats_; }\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 67f308157fbf..b7de85f8b9c7 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -349,6 +349,30 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n  * color spaces can be supported and in what combinations.\n  */\n \n+/**\n+ * \\enum StreamConfiguration::Hint\n+ * \\brief List of available hint flags provided by the application for a stream\n+ *\n+ * \\var StreamConfiguration::Hint::None\n+ * No hints for this stream.\n+ * \\var StreamConfiguration::Hint::OptionalStream\n+ * Informs the pipeline handler that the application may not always provide a\n+ * buffer for the configured stream in every Request. This may ensure the\n+ * pipeline handler allocates additional stream buffers for internal use.\n+ */\n+\n+/**\n+ * \\var StreamConfiguration::hints\n+ * \\brief Application provided StreamConfiguration::Hint flags for specific\n+ * stream behavior\n+ *\n+ * Provides hints from the application to the pipeline handlers on how it\n+ * intends on handling a given configured stream. These hints may alter the\n+ * behavior of the pipeline handlers, for example, by allocating additional\n+ * buffers for internal use if an application does not guarantee buffers will be\n+ * provided in every Request for a stream.\n+ */\n+\n /**\n  * \\fn StreamConfiguration::stream()\n  * \\brief Retrieve the stream associated with the configuration\n","prefixes":["libcamera-devel","v5","01/12"]}