glEnsureElementData

fnbool glEnsureElementData(gst.element.Element element, gstgl.gldisplay.GLDisplay displayPtr, gstgl.glcontext.GLContext otherContextPtr)

Perform the steps necessary for retrieving a #GstGLDisplay and (optionally) an application provided #GstGLContext from the surrounding elements or from the application using the #GstContext mechanism.

If the contents of display_ptr or other_context_ptr are not null, then no #GstContext query is necessary for #GstGLDisplay or #GstGLContext retrieval or is performed.

This performs #GstContext queries (if necessary) for a winsys display connection with [gstgl.types.GL_DISPLAY_CONTEXT_TYPE], "gst.x11.display.handle", and "GstWaylandDisplayHandleContextType" stopping after the first successful retrieval.

This also performs a #GstContext query (if necessary) for an optional application provided #GstGLContext using the name "gst.gl.app_context". The returned #GstGLContext will be shared with a GStreamer created OpenGL context.

Parameters

elementthe #GstElement running the query
displayPtrthe resulting #GstGLDisplay
otherContextPtrthe resulting #GstGLContext

Returns

whether a #GstGLDisplay exists in display_ptr