Patch Detail
Show a patch.
GET /api/patches/23424/?format=api
{ "id": 23424, "url": "https://patchwork.libcamera.org/api/patches/23424/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23424/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20250522125521.6465-2-laurent.pinchart@ideasonboard.com>", "date": "2025-05-22T12:55:18", "name": "[1/4] gstreamer: Document improvements when updating minimum GStreamer version", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a674d68f0ac37f8379bc1c7bf9217e4557f344b8", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23424/mbox/", "series": [ { "id": 5190, "url": "https://patchwork.libcamera.org/api/series/5190/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5190", "date": "2025-05-22T12:55:17", "name": "gstreamer: Miscellaneous cleanups + one fix", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5190/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23424/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23424/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 8AA92C331D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 May 2025 12:55:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7CFE968D9B;\n\tThu, 22 May 2025 14:55:30 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D410268D8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 May 2025 14:55:28 +0200 (CEST)", "from pendragon.ideasonboard.com\n\t(179.218-130-109.adsl-dyn.isp.belgacom.be [109.130.218.179])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C62E98FA;\n\tThu, 22 May 2025 14:55:06 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XKyu+sLw\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747918506;\n\tbh=pCyYnfuO70/q7Y5sf/HRiFY3Jem04POwIJ89+/5GT/c=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XKyu+sLwcv41NCkBOuB1q6BsfXci1/VPGsMbt/SiP1LAbMZbGNI2bn+z6V9Ry7w1I\n\tBFNNeHqzOswNWttpeBNj9tjLlysiaG5L1+29ZCBJKHsGstvy1BO4G3yzo0k6nYHG9Z\n\tPfW1zXU9cxK/gDjVChaknqemfEwJMLYLmEqI1wCU=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Hou Qi <qi.hou@nxp.com>,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>", "Subject": "[PATCH 1/4] gstreamer: Document improvements when updating minimum\n\tGStreamer version", "Date": "Thu, 22 May 2025 14:55:18 +0200", "Message-ID": "<20250522125521.6465-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.49.0", "In-Reply-To": "<20250522125521.6465-1-laurent.pinchart@ideasonboard.com>", "References": "<20250522125521.6465-1-laurent.pinchart@ideasonboard.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": "A const_cast<> was recently added to fix a compilation issue with older\nGStreamer versions. Add a comment to indicate it can be removed when\nbumping the minimum GStreamer version requirement. While at it, also\ndocument a possible future improvement in the same function, and wrap\nlong lines.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex b34f089778ec..70bb0606c72c 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -285,10 +285,17 @@ gst_libcamera_extrapolate_info(GstVideoInfo *info, guint32 stride)\n }\n \n static GstFlowReturn\n-gst_libcamera_video_frame_copy(GstBuffer *src, GstBuffer *dest, const GstVideoInfo *dest_info, guint32 stride)\n+gst_libcamera_video_frame_copy(GstBuffer *src, GstBuffer *dest,\n+\t\t\t const GstVideoInfo *dest_info, guint32 stride)\n {\n-\tGstVideoInfo src_info = *dest_info;\n+\t/*\n+\t * When dropping support for versions earlier than v1.22.0, use\n+\t *\n+\t * g_auto (GstVideoFrame) src_frame = GST_VIDEO_FRAME_INIT;\n+\t * g_auto (GstVideoFrame) dest_frame = GST_VIDEO_FRAME_INIT;\n+\t */\n \tGstVideoFrame src_frame, dest_frame;\n+\tGstVideoInfo src_info = *dest_info;\n \n \tgst_libcamera_extrapolate_info(&src_info, stride);\n \tsrc_info.size = gst_buffer_get_size(src);\n@@ -298,7 +305,12 @@ gst_libcamera_video_frame_copy(GstBuffer *src, GstBuffer *dest, const GstVideoIn\n \t\treturn GST_FLOW_ERROR;\n \t}\n \n-\tif (!gst_video_frame_map(&dest_frame, const_cast<GstVideoInfo *>(dest_info), dest, GST_MAP_WRITE)) {\n+\t/*\n+\t * When dropping support for versions earlier than 1.20.0, drop the\n+\t * const_cast<>().\n+\t */\n+\tif (!gst_video_frame_map(&dest_frame, const_cast<GstVideoInfo *>(dest_info),\n+\t\t\t\t dest, GST_MAP_WRITE)) {\n \t\tGST_ERROR(\"Could not map dest buffer\");\n \t\tgst_video_frame_unmap(&src_frame);\n \t\treturn GST_FLOW_ERROR;\n", "prefixes": [ "1/4" ] }