Patch Detail
Show a patch.
GET /api/1.1/patches/24602/?format=api
{ "id": 24602, "url": "https://patchwork.libcamera.org/api/1.1/patches/24602/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24602/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251013063132.89521-3-uajain@igalia.com>", "date": "2025-10-13T06:31:27", "name": "[2/3] gstreamer: Associate libcamera::Stream with GstPad", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e34fa2897d45e3d6cdce4be899c01ca4e50f485d", "submitter": { "id": 232, "url": "https://patchwork.libcamera.org/api/1.1/people/232/?format=api", "name": "Umang Jain", "email": "uajain@igalia.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24602/mbox/", "series": [ { "id": 5488, "url": "https://patchwork.libcamera.org/api/1.1/series/5488/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5488", "date": "2025-10-13T06:31:25", "name": "gstreamer: some assorted fixes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5488/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24602/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24602/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 C97B0BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Oct 2025 06:31:24 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 80B276045F;\n\tMon, 13 Oct 2025 08:31:23 +0200 (CEST)", "from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 88A9560456\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Oct 2025 08:31:22 +0200 (CEST)", "from [49.36.127.56] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1v8C5Z-008oQ5-8v; Mon, 13 Oct 2025 08:31:21 +0200" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"U4VQxn8o\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=sinmmKyOZNnkWcJXDSqQq/ayHiQE9n4/IUMrWDssnDQ=;\n\tb=U4VQxn8oF2QMM7aGVmkxp+eXgQ\n\t+ypG0SN31SxJh8R8fMUrI9YTeoo+6MfRD5oGkVHW8jveNv+o/z1xbrHwJS83I6E8VatCdG+NNL99O\n\tikV+xZPcxre1MoanQgWUt093Lf3blC//qh1mHBjoRDMTu7Zc8/POMRB0yZ8OnaGpar7hg0cMesprz\n\tQqTttpCqK7JL//6rsEBYOTAEsHw7ob15ffQIPYtpG+momPzmU7fLCU3L1A3Mh7oEpWG6M5KJw5Vqq\n\teAY7rHiXLLX1YcSBup8z7Wld7I6VEsPR5/pj/Qpj93wSeRj7YKArlx3ud8YI8S6AAhugxLMgvaBQD\n\tIqhjb+Eg==;", "From": "Umang Jain <uajain@igalia.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Nicolas Dufresne <nicolas.dufresne@collabora.com>,\n\tUmang Jain <uajain@igalia.com>", "Subject": "[PATCH 2/3] gstreamer: Associate libcamera::Stream with GstPad", "Date": "Mon, 13 Oct 2025 12:01:27 +0530", "Message-ID": "<20251013063132.89521-3-uajain@igalia.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251013063132.89521-1-uajain@igalia.com>", "References": "<20251013063132.89521-1-uajain@igalia.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Instead of trying to figure out which libcamera::Stream, the GstPad\nis configured with (from the libcamera pool), associate the Stream\nwith the GstPad directly using gst_pad_set_element_private().\n\nThe libcamera::Stream can now be obtained using\ngst_pad_get_element_private() hence, drop the getter\ngst_libcamera_pad_get_stream().\n\nAdditionally, drop retrieving the stream configuration\nusing the same index, as of the srcpads_ vector in processRequest().\nThis can break in future, if CameraConfiguration moves away\nfrom vector for storing stream configurations. Hence, retrieve\nthe stream configuration correctly, from GstPad's configured stream.\n\nSigned-off-by: Umang Jain <uajain@igalia.com>\n---\n src/gstreamer/gstlibcamerapad.cpp | 11 -----------\n src/gstreamer/gstlibcamerapad.h | 2 --\n src/gstreamer/gstlibcamerasrc.cpp | 10 +++++++---\n 3 files changed, 7 insertions(+), 16 deletions(-)", "diff": "diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp\nindex 22b96719..7855ef22 100644\n--- a/src/gstreamer/gstlibcamerapad.cpp\n+++ b/src/gstreamer/gstlibcamerapad.cpp\n@@ -189,17 +189,6 @@ void gst_libcamera_pad_set_video_info(GstPad *pad, const GstVideoInfo *info)\n \tself->info = *info;\n }\n \n-Stream *\n-gst_libcamera_pad_get_stream(GstPad *pad)\n-{\n-\tauto *self = GST_LIBCAMERA_PAD(pad);\n-\n-\tif (self->pool)\n-\t\treturn gst_libcamera_pool_get_stream(self->pool);\n-\n-\treturn nullptr;\n-}\n-\n void\n gst_libcamera_pad_set_latency(GstPad *pad, GstClockTime latency)\n {\ndiff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h\nindex f98b8a7f..5f355aa9 100644\n--- a/src/gstreamer/gstlibcamerapad.h\n+++ b/src/gstreamer/gstlibcamerapad.h\n@@ -31,6 +31,4 @@ GstVideoInfo gst_libcamera_pad_get_video_info(GstPad *pad);\n \n void gst_libcamera_pad_set_video_info(GstPad *pad, const GstVideoInfo *info);\n \n-libcamera::Stream *gst_libcamera_pad_get_stream(GstPad *pad);\n-\n void gst_libcamera_pad_set_latency(GstPad *pad, GstClockTime latency);\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex 9ff90d9a..a5dbdfd4 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -195,7 +195,7 @@ int GstLibcameraSrcState::queueRequest()\n \t\tstd::make_unique<RequestWrap>(std::move(request));\n \n \tfor (GstPad *srcpad : srcpads_) {\n-\t\tStream *stream = gst_libcamera_pad_get_stream(srcpad);\n+\t\tStream *stream = (Stream *)gst_pad_get_element_private(srcpad);\n \t\tGstLibcameraPool *pool = gst_libcamera_pad_get_pool(srcpad);\n \t\tGstBuffer *buffer;\n \t\tGstFlowReturn ret;\n@@ -359,11 +359,11 @@ int GstLibcameraSrcState::processRequest()\n \n \tfor (gsize i = 0; i < srcpads_.size(); i++) {\n \t\tGstPad *srcpad = srcpads_[i];\n-\t\tStream *stream = gst_libcamera_pad_get_stream(srcpad);\n+\t\tStream *stream = (Stream *)gst_pad_get_element_private(srcpad);\n \t\tGstBuffer *buffer = wrap->detachBuffer(stream);\n \n \t\tFrameBuffer *fb = gst_libcamera_buffer_get_frame_buffer(buffer);\n-\t\tconst StreamConfiguration &stream_cfg = config_->at(i);\n+\t\tconst StreamConfiguration &stream_cfg = stream->configuration();\n \t\tGstBufferPool *video_pool = gst_libcamera_pad_get_video_pool(srcpad);\n \n \t\tif (video_pool) {\n@@ -698,6 +698,9 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n \t\tgst_libcamera_pad_set_pool(srcpad, pool);\n \t\tgst_libcamera_pad_set_video_pool(srcpad, video_pool);\n \n+\t\t/* Associate the configured stream with the src pad. */\n+\t\tgst_pad_set_element_private(srcpad, (gpointer)stream_cfg.stream());\n+\n \t\t/* Clear all reconfigure flags. */\n \t\tgst_pad_check_reconfigure(srcpad);\n \t}\n@@ -894,6 +897,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,\n \t\tfor (GstPad *srcpad : state->srcpads_) {\n \t\t\tgst_libcamera_pad_set_latency(srcpad, GST_CLOCK_TIME_NONE);\n \t\t\tgst_libcamera_pad_set_pool(srcpad, nullptr);\n+\t\t\tgst_pad_set_element_private(srcpad, nullptr);\n \t\t}\n \t}\n \n", "prefixes": [ "2/3" ] }