From 19603248c22243bbbc74992e5e7c878c02ab4679 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 29 Dec 2022 11:02:10 +0200 Subject: [PATCH] gl: Mark `gst_gl_context_new_wrapped()` return value as `nullable` If a GL context is requested for which no API support is compiled in then `NULL` is returned. Also remove a useless `NULL` check: `g_object_new()` can't possibly return `NULL`, ever. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c index a0b1f06..3056a4a 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c @@ -402,7 +402,7 @@ gst_gl_context_new (GstGLDisplay * display) * * @available_apis must not be %GST_GL_API_NONE or %GST_GL_API_ANY * - * Returns: (transfer full): a #GstGLContext wrapping @handle + * Returns: (transfer full) (nullable): a #GstGLContext wrapping @handle * * Since: 1.4 */ @@ -431,13 +431,6 @@ gst_gl_context_new_wrapped (GstGLDisplay * display, guintptr handle, context_wrap = g_object_new (GST_TYPE_GL_WRAPPED_CONTEXT, NULL); gst_object_ref_sink (context_wrap); - if (!context_wrap) { - /* subclass returned a NULL context */ - GST_ERROR ("Could not wrap existing context"); - - return NULL; - } - context = (GstGLContext *) context_wrap; context->display = gst_object_ref (display); -- 2.7.4