And fix a memory leaks in gst_gl_display_egl_new() error cases.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
*
* Create a new #GstGLDisplayCocoa.
*
- * Returns: (transfer full): a new #GstGLDisplayCocoa or %NULL
+ * Returns: (transfer full): a new #GstGLDisplayCocoa
*/
GstGLDisplayCocoa *
gst_gl_display_cocoa_new (void)
* @gl_mem: a #GstGLMemory
* @attribs: additional attributes to add to the `eglCreateImage`() call.
*
- * Returns: (transfer full): a #GstEGLImage wrapping @gl_mem or %NULL on failure
+ * Returns: (transfer full) (nullable): a #GstEGLImage wrapping @gl_mem or %NULL on failure
*/
GstEGLImage *
gst_egl_image_from_texture (GstGLContext * context, GstGLMemory * gl_mem,
* With NV12, two EGL images are created, one with R format, one
* with RG format etc.
*
- * Returns: a #GstEGLImage wrapping @dmabuf or %NULL on failure
+ * Returns: (nullable): a #GstEGLImage wrapping @dmabuf or %NULL on failure
*/
GstEGLImage *
gst_egl_image_from_dmabuf (GstGLContext * context,
* is that this function creates one EGL image for all planes, not one for
* a single plane.
*
- * Returns: a #GstEGLImage wrapping @dmabuf or %NULL on failure
+ * Returns: (nullable): a #GstEGLImage wrapping @dmabuf or %NULL on failure
*
* Since: 1.18
*/
* is that this function creates one EGL image for all planes, not one for
* a single plane.
*
- * Returns: a #GstEGLImage wrapping @dmabuf or %NULL on failure
+ * Returns: (nullable): a #GstEGLImage wrapping @dmabuf or %NULL on failure
*/
GstEGLImage *
gst_egl_image_from_dmabuf_direct (GstGLContext * context,
* %GST_GL_DISPLAY_TYPE_ANY, then @display must be 0. @type must not be
* %GST_GL_DISPLAY_TYPE_NONE.
*
- * Returns: A `EGLDisplay` or `EGL_NO_DISPLAY`
+ * Returns: (nullable): A `EGLDisplay` or `EGL_NO_DISPLAY`
*
* Since: 1.12
*/
*
* Create a new #GstGLDisplayEGL using the default EGL_DEFAULT_DISPLAY.
*
- * Returns: (transfer full): a new #GstGLDisplayEGL or %NULL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayEGL or %NULL
*/
GstGLDisplayEGL *
gst_gl_display_egl_new (void)
{
GstGLDisplayEGL *ret;
+ gpointer display;
init_debug ();
- ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL);
- gst_object_ref_sink (ret);
- ret->display =
- gst_gl_display_egl_get_from_native (GST_GL_DISPLAY_TYPE_ANY, 0);
+ display = gst_gl_display_egl_get_from_native (GST_GL_DISPLAY_TYPE_ANY, 0);
- if (!ret->display) {
+ if (!display) {
GST_INFO ("Failed to open EGL display connection");
+ return NULL;
}
+ ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL);
+ gst_object_ref_sink (ret);
+ ret->display = display;
+
return ret;
}
* This function will return the same value for multiple calls with the same
* @display.
*
- * Returns: (transfer full): a new #GstGLDisplayEGL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayEGL
*
* Since: 1.12
*/
*
* Create a new #GstGLDisplayEGLDevice with an EGLDevice supported device
*
- * Returns: (transfer full): a new #GstGLDisplayEGLDevice or %NULL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayEGLDevice or %NULL
*
* Since: 1.18
*/
* @src: the #GstGLAllocationParams to initialize
*
* Returns: (transfer full): a copy of the #GstGLAllocationParams specified by
- * @src or %NULL on failure
+ * @src
*
* Since: 1.8
*/
* @allocator: a #GstGLBaseMemoryAllocator
* @params: the #GstGLAllocationParams to allocate the memory with
*
- * Returns: a new #GstGLBaseMemory from @allocator with the requested @params.
+ * Returns: (transfer full) (nullable): a new #GstGLBaseMemory from @allocator with the requested @params.
*
* Since: 1.8
*/
*
* Note: not called with a GL context current
*
- * Returns: a newly allocated #GstGLBaseMemory from @allocator and @params
+ * Returns: (transfer full) (nullable): a newly allocated #GstGLBaseMemory from @allocator and @params
*
* Since: 1.8
*/
*
* Also see gst_memory_copy();
*
- * Returns: the newly copied #GstGLMemory or %NULL
+ * Returns: (transfer full) (nullable): the newly copied #GstGLMemory or %NULL
*
* Since: 1.8
*/
* gst_buffer_pool_set_config() will cause this function to return a new
* #GstGLAllocationParams which may or may not contain the same information.
*
- * Returns: (transfer full): a copy of the #GstGLAllocationParams being used by the @pool
+ * Returns: (transfer full) (nullable): a copy of the #GstGLAllocationParams being used by the @pool
*
* Since: 1.20
*/
* gst_buffer_pool_config_get_gl_allocation_params:
* @config: a buffer pool config
*
- * Returns: (transfer full): the currently set #GstGLAllocationParams or %NULL
+ * Returns: (transfer full) (nullable): the currently set #GstGLAllocationParams or %NULL
*/
GstGLAllocationParams *
gst_buffer_pool_config_get_gl_allocation_params (GstStructure * config)
/**
* gst_buffer_pool_config_set_gl_allocation_params:
* @config: a buffer pool config
- * @params: (transfer none): a #GstGLAllocationParams
+ * @params: (transfer none) (nullable): a #GstGLAllocationParams
*
* Sets @params on @config
*/
* Converts the data contained by @inbuf using the formats specified by the
* #GstCaps passed to gst_gl_color_convert_set_caps()
*
- * Returns: (transfer full): a converted #GstBuffer or %NULL
+ * Returns: (transfer full) (nullable): a converted #GstBuffer or %NULL
*
* Since: 1.4
*/
* gst_gl_context_get_current_gl_context:
* @context_type: a #GstGLPlatform specifying the type of context to retrieve
*
- * Returns: The OpenGL context handle current in the calling thread or %NULL
+ * Returns: (nullable): The OpenGL context handle current in the calling thread or %NULL
*
* Since: 1.6
*/
*
* See also gst_gl_context_get_proc_address().
*
- * Returns: a function pointer for @name, or %NULL
+ * Returns: (nullable): a function pointer for @name, or %NULL
*
* Since: 1.6
*/
* gst_gl_context_get_thread:
* @context: a #GstGLContext
*
- * Returns: (transfer full): The #GThread, @context is current in or NULL
+ * Returns: (transfer full) (nullable): The #GThread, @context is current in or NULL
*
* Since: 1.6
*/
* void (GSTGLAPI *PFN_glGetIntegerv) (GLenum name, GLint * ret)
* ]|
*
- * Returns: a function pointer or %NULL
+ * Returns: (nullable): a function pointer or %NULL
*
* Since: 1.4
*/
*
* See also: gst_gl_context_get_proc_address()
*
- * Returns: an address pointing to @name or %NULL
+ * Returns: (nullable): an address pointing to @name or %NULL
*
* Since: 1.4
*/
*
* See also gst_gl_context_activate().
*
- * Returns: (transfer none): the #GstGLContext active in the current thread or %NULL
+ * Returns: (transfer none) (nullable): the #GstGLContext active in the current thread or %NULL
*
* Since: 1.6
*/
* It can be called in any thread and it is emitted with
* display's object lock held.
*
- * Returns: (transfer full): the new context.
+ * Returns: (transfer full) (nullable): the new context.
*/
gst_gl_display_signals[CREATE_CONTEXT] =
g_signal_new ("create-context", G_TYPE_FROM_CLASS (klass),
/**
* gst_context_set_gl_display:
* @context: a #GstContext
- * @display: (transfer none): resulting #GstGLDisplay
+ * @display: (transfer none) (nullable): resulting #GstGLDisplay
*
* Sets @display on @context
*
/**
* gst_context_get_gl_display:
* @context: a #GstContext
- * @display: (out) (transfer full): resulting #GstGLDisplay
+ * @display: (out) (optional) (nullable) (transfer full): resulting #GstGLDisplay
*
* Returns: Whether @display was in @context
*
* @display: a #GstGLDisplay
* @other_context: (transfer none): other #GstGLContext to share resources with.
* @p_context: (transfer full) (out): resulting #GstGLContext
- * @error: (allow-none): resulting #GError
+ * @error: (optional): resulting #GError
*
* It requires the display's object lock to be held.
*
* gst_gl_display_create_window:
* @display: a #GstGLDisplay
*
- * Returns: (transfer full): a new #GstGLWindow for @display or %NULL.
+ * Returns: (transfer full) (nullable): a new #GstGLWindow for @display or %NULL.
*/
/* XXX: previous versions had documentation requiring the OBJECT lock to be
* held when this fuction is called so that needs to always work. */
* first argument to @compare_func is the #GstGLWindow being checked and the
* second argument is @data.
*
- * Returns: (transfer none): The first #GstGLWindow that causes a match
+ * Returns: (transfer none) (nullable): The first #GstGLWindow that causes a match
* from @compare_func
*
* Since: 1.12
* first argument to @compare_func is the #GstGLWindow being checked and the
* second argument is @data.
*
- * Returns: (transfer full): The first #GstGLWindow that causes a match
+ * Returns: (transfer full) (nullable): The first #GstGLWindow that causes a match
* from @compare_func
*
* Since: 1.18
* @display: a #GstGLDisplay
* @thread: a #GThread
*
- * Returns: (transfer full): the #GstGLContext current on @thread or %NULL
+ * Returns: (transfer full) (nullable): the #GstGLContext current on @thread or %NULL
*
* Must be called with the object lock held.
*
* gst_gl_texture_target_to_string:
* @target: a #GstGLTextureTarget
*
- * Returns: the stringified version of @target or %NULL
+ * Returns: (nullable): the stringified version of @target or %NULL
*/
const gchar *
gst_gl_texture_target_to_string (GstGLTextureTarget target)
* gst_gl_texture_target_to_buffer_pool_option:
* @target: a #GstGLTextureTarget
*
- * Returns: a string representing the @GstBufferPoolOption specified by @target
+ * Returns: (nullable): a string representing the @GstBufferPoolOption specified by @target
*/
const gchar *
gst_gl_texture_target_to_buffer_pool_option (GstGLTextureTarget target)
/**
* gst_gl_shader_new_link_with_stages:
* @context: a #GstGLContext
- * @error: a #GError
+ * @error: (optional): a #GError
* @...: a NULL terminated list of #GstGLSLStage's
*
* Each stage will attempt to be compiled and attached to @shader. Then
/**
* gst_gl_shader_new_with_stages:
* @context: a #GstGLContext
- * @error: a #GError
+ * @error: (optional): a #GError
* @...: a NULL terminated list of #GstGLSLStage's
*
* Each stage will attempt to be compiled and attached to @shader. On error,
/**
* gst_gl_shader_new_default:
* @context: a #GstGLContext
- * @error: a #GError that is filled on failure
+ * @error: (optional): a #GError that is filled on failure
*
* Note: must be called in the GL thread
*
* gst_gl_shader_compile_attach_stage:
* @shader: a #GstGLShader
* @stage: a #GstGLSLStage to attach
- * @error: a #GError
+ * @error: (optional): a #GError
*
* Compiles @stage and attaches it to @shader.
*
/**
* gst_gl_shader_link:
* @shader: a #GstGLShader
- * @error: a #GError
+ * @error: (optional): a #GError
*
* Links the current list of #GstGLSLStage's in @shader.
*
* @version: a #GstGLSLVersion
* @profile: a #GstGLSLVersion
*
- * Returns: the combined GLSL `#version` string for @version and @profile
+ * Returns: (nullable): the combined GLSL `#version` string for @version and @profile
*/
gchar *
gst_glsl_version_profile_to_string (GstGLSLVersion version,
* Converts the data contained by @inbuf using the formats specified by the
* #GstCaps passed to gst_gl_view_convert_set_caps()
*
- * Returns: (transfer full): a converted #GstBuffer or %NULL
+ * Returns: (transfer full) (nullable): a converted #GstBuffer or %NULL
*
* Since: 1.6
*/
*
* Create a new #GstGLDisplayVivFB from the FB display index.
*
- * Returns: (transfer full): a new #GstGLDisplayVivFB or %NULL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayVivFB or %NULL
*/
GstGLDisplayVivFB *
gst_gl_display_viv_fb_new (gint disp_idx)
* Create a new #GstGLDisplayWayland from the wayland display name. See `wl_display_connect`()
* for details on what is a valid name.
*
- * Returns: (transfer full): a new #GstGLDisplayWayland or %NULL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayWayland or %NULL
*/
GstGLDisplayWayland *
gst_gl_display_wayland_new (const gchar * name)
* Create a new #GstGLDisplayX11 from the x11 display name. See `XOpenDisplay`()
* for details on what is a valid name.
*
- * Returns: (transfer full): a new #GstGLDisplayX11 or %NULL
+ * Returns: (transfer full) (nullable): a new #GstGLDisplayX11 or %NULL
*/
GstGLDisplayX11 *
gst_gl_display_x11_new (const gchar * name)