[PATCH v2 6/7] gstreamer: Drop incorrect unref on caps

Nicolas Dufresne nicolas.dufresne at collabora.com
Wed Jun 4 19:13:16 CEST 2025


Le mercredi 04 juin 2025 à 16:07 +0300, Laurent Pinchart a écrit :
> The caps object passeed to the gst_libcamera_create_video_pool()
> function is managed as a g_autoptr() in the caller. The function doesn't
> acquire any new reference, so it shouldn't call gst_caps_unref(). Fix
> it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>

> ---
> I believe this is right (or I wouldn't send it), but a confirmation that
> nothing in gst_libcamera_create_video_pool() acquires a reference to the
> caps would be appreciated.
> ---
>  src/gstreamer/gstlibcamerasrc.cpp | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> index 0be64dd836ca..eec8163e88e7 100644
> --- a/src/gstreamer/gstlibcamerasrc.cpp
> +++ b/src/gstreamer/gstlibcamerasrc.cpp
> @@ -580,7 +580,6 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,
>  	}
>  
>  	if (!gst_buffer_pool_set_active(pool, true)) {
> -		gst_caps_unref(caps);
>  		GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,
>  				  ("Failed to active buffer pool"),
>  				  ("gst_libcamera_src_negotiate() failed."));


More information about the libcamera-devel mailing list