{"id":18249,"url":"https://patchwork.libcamera.org/api/patches/18249/?format=json","web_url":"https://patchwork.libcamera.org/patch/18249/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20230203094424.25243-5-naush@raspberrypi.com>","date":"2023-02-03T09:44:20","name":"[libcamera-devel,v1,4/8] libcamera: camera: Validate MandatoryStream in queueRequest()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e3d5d076fb233b3908ebc626a5b79db1031e316a","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18249/mbox/","series":[{"id":3739,"url":"https://patchwork.libcamera.org/api/series/3739/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3739","date":"2023-02-03T09:44:16","name":"Stream hints","version":1,"mbox":"https://patchwork.libcamera.org/series/3739/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18249/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18249/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 5E2DCC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Feb 2023 09:44:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19497625EC;\n\tFri,  3 Feb 2023 10:44:34 +0100 (CET)","from mail-wr1-x429.google.com (mail-wr1-x429.google.com\n\t[IPv6:2a00:1450:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 659ED625E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Feb 2023 10:44:30 +0100 (CET)","by mail-wr1-x429.google.com with SMTP id y1so4119786wru.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Feb 2023 01:44:30 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf17-20020a5d50d1000000b002bfe266d710sm1562503wrt.90.2023.02.03.01.44.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Feb 2023 01:44:29 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1675417474;\n\tbh=e22OhAuSZ6QaESVtJ12ytzqvo4NrIJzbJGLoYQg+cPE=;\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=Qdyoumh0N3Loe78jjRvTMeBdCxGSe7za/fUBAXMZkbuGSIr4fbtuhMNuYFOhWKBvo\n\tSUonlvn31u+A1KQp/pKobU21VIRMsLkCwxDVFYvU/ptAYkqA5o4rfIo9gGwOoOeSXa\n\tTyLbCd/a+L1RRn+tcv4zG0yIpTBHWUsH2bqpkl/VieK8wkBB6XMpdv/Pu4H3rr6rrm\n\tXaRJF95GYekbAteAPWDk/dC+X2jGxi9xxWQ1xnmo9sTnK6Sl//M/8IG9xcPb48caRV\n\t5TO/3oqAZQeI5OjFLD24J6vYKuNTyFn42sBXoNW1a9Sve5FoCW3kutYcJiyJgNaMKP\n\tmCkEEZdOKksug==","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=CGZwAAnS7t1YLpDptrdLrTgq6Xa1I7+cWVR6KStCMIA=;\n\tb=ZsuqgAtW4Xsm0KdKbXJhY64IVZZJpx+MOsUxXJV5IFIwl64oWep2kIWlNPEQTe2fpS\n\t4RHvjXJTPTHocLpLtqGMr49GJ1gtrdpr7jaaMVMZ/GEy4z1YaP8cvu3iVctqvT8eSYhf\n\tIfD83tAKlRM9m5TJcgYPAQ1Egt82eB/1+bxF7lK9LAaptMw0oLfptxn0PgOF+gkNjeyo\n\tyoMVEFqmQnOaxcW4gXi+PEUum02k92vxp8Z06nUEoVB/3ZenBVIAvEyDivJRndl9my30\n\t4W5e1Nwo4KYg3BeSTjFXuCVezwEH8/9I/tXjqkdKUIhQI/137KAsA1Hy46lUmoNZ/LXk\n\t1J0Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ZsuqgAtW\"; 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=CGZwAAnS7t1YLpDptrdLrTgq6Xa1I7+cWVR6KStCMIA=;\n\tb=n7z9l4Ga/t7x1Nclumk/IlOnKACLPINYzzF5I2zkvXrSWlnic9Rgtep4Q+a/e/31ge\n\tz8Dju4WcdZCnNujeMawRwgMYR/eqZTzTF2kJFsCNHx0BFcI0r2mXBIGrZXzq38r1+tgT\n\t31wdDZxIWeCa+6msCmxsaGpIMk+lNqoKvZa0LrU788HgdSJAJAdIvXcaCB3122EsduTu\n\tpveVHRHg7TZ33AYVaeUSK6b/2Qtfg83nt83bhssLy7k4qSjE1/KcsfqyB3nNnc7PGI9+\n\tf8CNetvfLdx1BbZ/L6VoyLe+uBRPV9en8ycK5e5HboGu/nRr/NUc8gndrM8LECG5XGi1\n\tAmMg==","X-Gm-Message-State":"AO0yUKUt6EB7lEoAPrTM9M26nhtk5wtWaKn/Mlx47QUl7fDDlEVYqA0k\n\toQljC+hyvrUhBRDX3ypzja6WoO048mwA4SxhX4HiyQ==","X-Google-Smtp-Source":"AK7set8kEEqjGGc2jkZs7WeGuKpJSDSkKgR/3isVn1h3pJDHP/Pf7h+tJxRLQM9s3oqROupjp0roNA==","X-Received":"by 2002:a05:6000:18cd:b0:2c3:da85:ad7e with SMTP id\n\tw13-20020a05600018cd00b002c3da85ad7emr361409wrq.36.1675417469708; \n\tFri, 03 Feb 2023 01:44:29 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  3 Feb 2023 09:44:20 +0000","Message-Id":"<20230203094424.25243-5-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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 4/8] libcamera: camera: Validate\n\tMandatoryStream in queueRequest()","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 some validation in queueRequest() to ensure that a frame buffer is\nprovided in a Request if the MandatoryStream flag has been set in the\nStreamConfiguration for every active stream.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/camera.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 0da167a7bc51..c0a368c1e66c 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -1146,6 +1146,18 @@ int Camera::queueRequest(Request *request)\n \t\t}\n \t}\n \n+\tfor (auto const stream : d->activeStreams_) {\n+\t\tconst StreamConfiguration &config = stream->configuration();\n+\t\tFrameBuffer *buffer = request->findBuffer(stream);\n+\n+\t\tif (!buffer && config.hints & StreamConfiguration::Hint::MandatoryStream) {\n+\t\t\tLOG(Camera, Error)\n+\t\t\t\t<< \"No buffer provided for mandatory stream\";\n+\t\t\trequest->_d()->reset();\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t}\n+\n \td->pipe_->invokeMethod(&PipelineHandler::queueRequest,\n \t\t\t       ConnectionTypeQueued, request);\n \n","prefixes":["libcamera-devel","v1","4/8"]}