{"id":23898,"url":"https://patchwork.libcamera.org/api/patches/23898/?format=json","web_url":"https://patchwork.libcamera.org/patch/23898/","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":"<20250722105627.11961-3-jaslo@ziska.de>","date":"2025-07-22T10:39:29","name":"[v2,2/3] gstreamer: Log and check adjusted camera configuration","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"485df99a2f127b5dd025b5e3e79388345a7a386c","submitter":{"id":173,"url":"https://patchwork.libcamera.org/api/people/173/?format=json","name":"Jaslo Ziska","email":"jaslo@ziska.de"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23898/mbox/","series":[{"id":5311,"url":"https://patchwork.libcamera.org/api/series/5311/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5311","date":"2025-07-22T10:39:27","name":"gstreamer: Miscellaneous fixes","version":2,"mbox":"https://patchwork.libcamera.org/series/5311/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23898/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23898/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 16D17BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jul 2025 10:57:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C454969037;\n\tTue, 22 Jul 2025 12:57:20 +0200 (CEST)","from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de\n\t[85.215.255.24])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 947E169030\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jul 2025 12:57:18 +0200 (CEST)","from archlinux.fritz.box by smtp.strato.de (RZmta 52.1.2 AUTH)\n\twith ESMTPSA id z685ee16MAvFHgZ\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits))\n\t(Client did not present a certificate);\n\tTue, 22 Jul 2025 12:57:15 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ziska.de header.i=@ziska.de header.b=\"GIBZJ3mF\";\n\tdkim=permerror (0-bit key) header.d=ziska.de header.i=@ziska.de\n\theader.b=\"GRAAWw46\"; dkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1753181835; cv=none;\n\td=strato.com; s=strato-dkim-0002;\n\tb=mhBQGHcNKt7ozxlChGYYV8t1DmcVPRo7nPNeJDjk1tkFiCQTzoQ5QpaJGVD8i7OKgh\n\t5ocPNZTBLu/zC+cpKUOurOO0aZnjpuTq8qngiZHIS8g8Sf/dDZTZyqkwx3VhFKLQdi2M\n\tDI96JUgS9ZuRIfiG/A+WBjV1Jz+gYs1s4ATzjOymVyZcHELuTNAoZ1KYnQOrffXn0+KY\n\t0QnTeZ6/BEbXc2TFFsXBRS1YAwxUNOxgWf5GacBtyJmmDkRpWIfz8Bh0ZRN35BcFcRWT\n\tnAsldlXZ/gPA/0Ho/E7KjDhhPJ/q0ckO68BXjAmEAOlm1173b71IUmYTtxvty+wKt5lI\n\tNcPA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; t=1753181835;\n\ts=strato-dkim-0002; d=strato.com;\n\th=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date:\n\tFrom:Subject:Sender;\n\tbh=uAE5TKYpSwi8OZn439sRZrIo2ufj+EvR+7N8E2PXpUY=;\n\tb=gF6kbCasNgWJsysuvA13G5I5IxyQn5rCING6k6C9vqv+XEJnHl4CeJ3INR5kJubICW\n\tbI2WsDYiBc7Hk3mJxLZANqGhniMVYgCekqR6mnsfEqB3t91g8u4wdBcerRKArfqxxrAy\n\tzCGCOGH18ef6rw8YMjLKUgVr1G6l5ds8rCyJty/FCRXYkntorjcv9pME94/2Hi1ybGjY\n\tRXPpTJRb/+p5C5+YfJ3kuia/w//ab6DrTOBasuFtSPwLAZpFACyfdGBdoQKOu/OQ4h8o\n\tH+5LADH/+8wL4RHtcF3U+6mLQQSO2EJ4XejlED7nOC2D/9dMffolWCE+C6/Im1YdpsUL\n\tjdDg==","ARC-Authentication-Results":"i=1; strato.com;\n    arc=none;\n    dkim=none","X-RZG-CLASS-ID":"mo00","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; t=1753181835;\n\ts=strato-dkim-0002; d=ziska.de;\n\th=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date:\n\tFrom:Subject:Sender;\n\tbh=uAE5TKYpSwi8OZn439sRZrIo2ufj+EvR+7N8E2PXpUY=;\n\tb=GIBZJ3mFXwUeOPzB4k+FGpS/PyYCj2LqMkM3fJ2ewLYH/VOxaCv7ZLyB+9sWdDTiHq\n\t6xIHwMP+yrbE6qFm+kxd0tKPIzMPbMlmQutrkjpGhLvIJVdry5s55JAwzKn//f7/oLSd\n\tvMfq/rjlvCxYd7Lrl/+GLHIl2LViQ1cjSmVR9a+mV8dK4mqyjCTu7PVrDySCZQb5sJq0\n\tdLhctFRhWnU+08mkyHyE0rg/+jVc1uYRz9dfCihb4NvbojqgfNlqJwaZaBjflhAO65k+\n\tDfE3Vg+xbFvTHs1XMfnBWxeq9UI61bsNdObmCXPEx4PjzWoD7a04RrQqizuTJM9lZ+r3\n\ty5Sw==","v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1753181835;\n\ts=strato-dkim-0003; d=ziska.de;\n\th=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date:\n\tFrom:Subject:Sender;\n\tbh=uAE5TKYpSwi8OZn439sRZrIo2ufj+EvR+7N8E2PXpUY=;\n\tb=GRAAWw46CkFinckzCfsRtPrz4siKA4nqNLENsfIlfn6+YK7WRWDXCYQk55wKbFdxD4\n\tkWcAHnekDjX5fdb1ENBw=="],"X-RZG-AUTH":"\":Jm0XeU+IYfb0x77LHmrjN5Wlb7TBwusDqIM6Hizy8VdfzvKi4yoFC9cF0Yq5V/JaauwvHLbqWsUkNwDmHGDXQ5TkbZSP\"","From":"Jaslo Ziska <jaslo@ziska.de>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jaslo Ziska <jaslo@ziska.de>,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Subject":"[PATCH v2 2/3] gstreamer: Log and check adjusted camera\n\tconfiguration","Date":"Tue, 22 Jul 2025 12:39:29 +0200","Message-ID":"<20250722105627.11961-3-jaslo@ziska.de>","X-Mailer":"git-send-email 2.50.0","In-Reply-To":"<20250722105627.11961-1-jaslo@ziska.de>","References":"<20250722105627.11961-1-jaslo@ziska.de>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"us-ascii\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"As CameraConfiguration::validate() might alter the configuration\npreviously negotiated with downstream, log an info when this happens as\nGStreamer source elements are not supposed to do that.\n\nAlso check if downstream can accept this new stream configuration and if\nnot, return a not-negotiated error.\n\nSigned-off-by: Jaslo Ziska <jaslo@ziska.de>\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)","diff":"diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex 7f4a39ec..79a025a5 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -617,8 +617,13 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n \t}\n \n \t/* Validate the configuration. */\n-\tif (state->config_->validate() == CameraConfiguration::Invalid)\n+\tCameraConfiguration::Status status = state->config_->validate();\n+\tif (status == CameraConfiguration::Invalid)\n \t\treturn false;\n+\telse if (status == CameraConfiguration::Adjusted)\n+\t\tGST_ELEMENT_INFO(self, RESOURCE, SETTINGS,\n+\t\t\t\t (\"Configuration was adjusted\"),\n+\t\t\t\t (\"CameraConfiguration::validate() returned CameraConfiguration::Adjusted\"));\n \n \tint ret = state->cam_->configure(state->config_.get());\n \tif (ret) {\n@@ -643,6 +648,10 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n \t\tg_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg, transfer[i]);\n \t\tgst_libcamera_framerate_to_caps(caps, element_caps);\n \n+\t\tif (status == CameraConfiguration::Adjusted &&\n+\t\t    !gst_pad_peer_query_accept_caps(srcpad, caps))\n+\t\t\treturn false;\n+\n \t\tif (!gst_pad_push_event(srcpad, gst_event_new_caps(caps)))\n \t\t\treturn false;\n \t}\n","prefixes":["v2","2/3"]}