From 41767e3bd8dceb9f609fb5cea80e3eb1b1bb7ffe Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Mon, 3 Nov 2025 21:30:13 +0000 Subject: [PATCH] gstreamer: Improve logging for buffer pool activation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the negotiation is going to fail, log the GST_ELEMENT_ERROR in gst_libcamera_src_negotiate(), instead of logging in downstream method chain. Signed-off-by: Umang Jain Reviewed-by: Nicolas Dufresne Reviewed-by: Barnabás Pőcze Signed-off-by: Kieran Bingham --- src/gstreamer/gstlibcamerasrc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index bd79b769..5443b062 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -574,12 +574,8 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad, gst_buffer_pool_set_config(GST_BUFFER_POOL_CAST(pool), config); } - if (!gst_buffer_pool_set_active(pool, true)) { - GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, - ("Failed to active buffer pool"), - ("gst_libcamera_src_negotiate() failed.")); + if (!gst_buffer_pool_set_active(pool, true)) return { nullptr, -EINVAL }; - } return { std::exchange(pool, nullptr), 0 }; } @@ -680,8 +676,12 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self) std::tie(video_pool, ret) = gst_libcamera_create_video_pool(self, srcpad, caps, &info); - if (ret) + if (ret) { + GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, + ("Failed to create video pool: %s", g_strerror(-ret)), + ("gst_libcamera_src_negotiate() failed.")); return false; + } } GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,