Functions

  buffer_add_gl_sync_meta (context, buffer)
  buffer_add_gl_sync_meta_full (context, buffer, data)
  buffer_pool_config_get_gl_allocation_params (config)
  buffer_pool_config_set_gl_allocation_params (config, params)
  context_get_gl_display (context)
  context_set_gl_display (context, display)
  gl_api_from_string (api_s)
  gl_api_to_string (api)
  gl_base_memory_alloc (allocator, params)
  gl_base_memory_error_quark ()
  gl_base_memory_init_once ()
  gl_buffer_init_once ()
  gl_check_extension (name, ext)
  gl_context_error_quark ()
  gl_element_propagate_display_context (element, display)
  gl_ensure_element_data (element, display_ptr, other_context_ptr)
  gl_format_from_video_info (context, vinfo, plane)
  gl_format_is_supported (context, format)
  gl_format_type_from_sized_gl_format (format)
  gl_format_type_n_bytes (format, type)
  gl_get_plane_data_size (info, align, plane)
  gl_get_plane_start (info, valign, plane)
  gl_handle_context_query (element, query, display, context, other_context)
  gl_handle_set_context (element, context, display, other_context)
  gl_memory_init_once ()
  gl_memory_pbo_init_once ()
  gl_platform_from_string (platform_s)
  gl_platform_to_string (platform)
  gl_query_local_gl_context (element, direction, context_ptr)
  gl_renderbuffer_init_once ()
  gl_sized_gl_format_from_gl_format_type (context, format, type)
  gl_stereo_downmix_mode_get_type ()
  gl_sync_meta_api_get_type ()
  gl_sync_meta_get_info ()
  gl_texture_target_from_gl (target)
  gl_texture_target_from_string (str)
  gl_texture_target_to_buffer_pool_option (target)
  gl_texture_target_to_gl (target)
  gl_texture_target_to_string (target)
  gl_value_get_texture_target_mask (value)
  gl_value_set_texture_target (value, target)
  gl_value_set_texture_target_from_mask (value, target_mask)
  gl_version_to_glsl_version (gl_api, maj, min)
  gl_window_error_quark ()
  glsl_error_quark ()
  glsl_profile_from_string (string)
  glsl_profile_to_string (profile)
  glsl_string_get_version_profile (s)
  glsl_version_from_string (string)
  glsl_version_profile_from_string (string)
  glsl_version_profile_to_string (version, profile)
  glsl_version_to_string (version)
  is_gl_base_memory (mem)
  is_gl_buffer (mem)
  is_gl_memory (mem)
  is_gl_memory_pbo (mem)
  is_gl_renderbuffer (mem)

Details

GstGL.buffer_add_gl_sync_meta(context, buffer)[source]
Parameters:
Returns:

the GstGL.GLSyncMeta added to Gst.Buffer

Return type:

GstGL.GLSyncMeta

New in version 1.6.

GstGL.buffer_add_gl_sync_meta_full(context, buffer, data)[source]
Parameters:
Returns:

the GstGL.GLSyncMeta added to Gst.Buffer

Return type:

GstGL.GLSyncMeta

New in version 1.8.

GstGL.buffer_pool_config_get_gl_allocation_params(config)[source]
Parameters:config (Gst.Structure) – a buffer pool config
Returns:the currently set GstGL.GLAllocationParams or None
Return type:GstGL.GLAllocationParams
GstGL.buffer_pool_config_set_gl_allocation_params(config, params)[source]
Parameters:

Sets params on config

GstGL.context_get_gl_display(context)[source]
Parameters:context (Gst.Context) – a Gst.Context
Returns:Whether display was in context
display:resulting GstGL.GLDisplay
Return type:(bool, display: GstGL.GLDisplay)

New in version 1.4.

GstGL.context_set_gl_display(context, display)[source]
Parameters:

Sets display on context

New in version 1.4.

GstGL.gl_api_from_string(api_s)[source]
Parameters:api_s (str) – a space seperated string of OpenGL apis
Returns:The GstGL.GLAPI represented by api_s
Return type:GstGL.GLAPI
GstGL.gl_api_to_string(api)[source]
Parameters:api (GstGL.GLAPI) – a GstGL.GLAPI to stringify
Returns:A space seperated string of the OpenGL api’s enabled in api
Return type:str
GstGL.gl_base_memory_alloc(allocator, params)[source]
Parameters:
Returns:

a new GstGL.GLBaseMemory from allocator with the requested params.

Return type:

GstGL.GLBaseMemory

New in version 1.8.

GstGL.gl_base_memory_error_quark()[source]
Return type:int
GstGL.gl_base_memory_init_once()[source]

Initializes the GL Base Memory allocator. It is safe to call this function multiple times. This must be called before any other GstGL.GLBaseMemory operation.

New in version 1.8.

GstGL.gl_buffer_init_once()[source]

Initializes the GL Buffer allocator. It is safe to call this function multiple times. This must be called before any other GstGL.GLBuffer operation.

New in version 1.8.

GstGL.gl_check_extension(name, ext)[source]
Parameters:
  • name (str) – the extension to search for
  • ext (str) – the list of possible extensions
Returns:

whether name is in the space seperated list of ext

Return type:

bool

GstGL.gl_context_error_quark()[source]
Return type:int
GstGL.gl_element_propagate_display_context(element, display)[source]
Parameters:
GstGL.gl_ensure_element_data(element, display_ptr, other_context_ptr)[source]
Parameters:
Returns:

whether a GstGL.GLDisplay exists in display_ptr

display_ptr:the resulting GstGL.GLDisplay
other_context_ptr:
 the resulting GstGL.GLContext

Return type:

(bool, display_ptr: GstGL.GLDisplay, other_context_ptr: GstGL.GLContext)

Perform the steps necessary for retrieving a GstGL.GLDisplay and (optionally) an application provided GstGL.GLContext from the surrounding elements or from the application using the Gst.Context mechanism.

If the contents of display_ptr or other_context_ptr are not None, then no Gst.Context query is necessary for GstGL.GLDisplay or GstGL.GLContext retrieval or is performed.

This performs Gst.Context queries (if necessary) for a winsys display connection with GstGL.GL_DISPLAY_CONTEXT_TYPE, “gst.x11.display.handle”, and “GstWaylandDisplayHandleContextType” stopping after the first successful retrieval.

This also performs a Gst.Context query (if necessary) for an optional application provided GstGL.GLContext using the name “gst.gl.app_context”. The returned GstGL.GLContext will be shared with a GStreamer created OpenGL context.

GstGL.gl_format_from_video_info(context, vinfo, plane)[source]
Parameters:
Returns:

the GstGL.GLFormat necessary for holding the data in plane of vinfo

Return type:

GstGL.GLFormat

GstGL.gl_format_is_supported(context, format)[source]
Parameters:
Returns:

Whether format is supported by context based on the OpenGL API, version, or available OpenGL extension/s.

Return type:

bool

New in version 1.16.

GstGL.gl_format_type_from_sized_gl_format(format)[source]
Parameters:format (GstGL.GLFormat) – the sized internal GstGL.GLFormat
Returns:
unsized_format:location for the resulting unsized GstGL.GLFormat
gl_type:location for the resulting GL type
Return type:(unsized_format: GstGL.GLFormat, gl_type: int)

Get the unsized format and type from format for usage in glReadPixels, glTex{Sub}Image*, glTexImage* and similar functions.

New in version 1.16.

GstGL.gl_format_type_n_bytes(format, type)[source]
Parameters:
  • format (int) – the OpenGL format, %GL_RGBA, %GL_LUMINANCE, etc
  • type (int) – the OpenGL type, %GL_UNSIGNED_BYTE, %GL_FLOAT, etc
Returns:

the number of bytes the specified format, type combination takes per pixel

Return type:

int

GstGL.gl_get_plane_data_size(info, align, plane)[source]
Parameters:
Return type:

int

Retrieve the size in bytes of a video plane of data with a certain alignment

GstGL.gl_get_plane_start(info, valign, plane)[source]
Parameters:
Returns:

difference between the supposed start of the plane from the info and where the data from the previous plane ends.

Return type:

int

GstGL.gl_handle_context_query(element, query, display, context, other_context)[source]
Parameters:
Returns:

Whether the query was successfully responded to from the passed display, context, and other_context.

Return type:

bool

GstGL.gl_handle_set_context(element, context, display, other_context)[source]
Parameters:
Returns:

whether the display or other_context could be set successfully

display:location of a GstGL.GLDisplay
other_context:location of a GstGL.GLContext

Return type:

(bool, display: GstGL.GLDisplay, other_context: GstGL.GLContext)

Helper function for implementing Gst.Element.do_set_context() in OpenGL capable elements.

Retrieve’s the GstGL.GLDisplay or GstGL.GLContext in context and places the result in display or other_context respectively.

GstGL.gl_memory_init_once()[source]

Initializes the GL Base Texture allocator. It is safe to call this function multiple times. This must be called before any other GstGL.GLMemory operation.

New in version 1.4.

GstGL.gl_memory_pbo_init_once()[source]
GstGL.gl_platform_from_string(platform_s)[source]
Parameters:platform_s (str) – a space seperated string of OpenGL platformss
Returns:The GstGL.GLPlatform represented by platform_s
Return type:GstGL.GLPlatform
GstGL.gl_platform_to_string(platform)[source]
Parameters:platform (GstGL.GLPlatform) – a GstGL.GLPlatform to stringify
Returns:A space seperated string of the OpenGL platforms enabled in platform
Return type:str
GstGL.gl_query_local_gl_context(element, direction, context_ptr)[source]
Parameters:
Returns:

whether context_ptr contains a GstGL.GLContext

context_ptr:location containing the current and/or resulting GstGL.GLContext

Return type:

(bool, context_ptr: GstGL.GLContext)

Performs a Gst.QueryType.CONTEXT query of type “gst.gl.local_context” on all Gst.Pads in element of direction for the local OpenGL context used by GStreamer elements.

GstGL.gl_renderbuffer_init_once()[source]

Initializes the GL Base Texture allocator. It is safe to call this function multiple times. This must be called before any other GstGL.GLRenderbuffer operation.

New in version 1.10.

GstGL.gl_sized_gl_format_from_gl_format_type(context, format, type)[source]
Parameters:
Returns:

the sized internal format specified by format and type that can be used in context

Return type:

int

GstGL.gl_stereo_downmix_mode_get_type()[source]
Return type:GObject.GType
GstGL.gl_sync_meta_api_get_type()[source]
Return type:GObject.GType
GstGL.gl_sync_meta_get_info()[source]
Return type:Gst.MetaInfo
GstGL.gl_texture_target_from_gl(target)[source]
Parameters:target (int) – an OpenGL texture binding target
Returns:the GstGL.GLTextureTarget that’s equiavalant to target or GstGL.GLTextureTarget.NONE
Return type:GstGL.GLTextureTarget
GstGL.gl_texture_target_from_string(str)[source]
Parameters:str (str) – a string equivalant to one of the GST_GL_TEXTURE_TARGET_*_STR values
Returns:the GstGL.GLTextureTarget represented by str or GstGL.GLTextureTarget.NONE
Return type:GstGL.GLTextureTarget
GstGL.gl_texture_target_to_buffer_pool_option(target)[source]
Parameters:target (GstGL.GLTextureTarget) – a GstGL.GLTextureTarget
Returns:a string representing the GstBufferPoolOption specified by target
Return type:str
GstGL.gl_texture_target_to_gl(target)[source]
Parameters:target (GstGL.GLTextureTarget) – a GstGL.GLTextureTarget
Returns:the OpenGL value for binding the target with glBindTexture() and similar functions or 0
Return type:int
GstGL.gl_texture_target_to_string(target)[source]
Parameters:target (GstGL.GLTextureTarget) – a GstGL.GLTextureTarget
Returns:the stringified version of target or None
Return type:str
GstGL.gl_value_get_texture_target_mask(value)[source]
Parameters:value (GObject.Value) – an initialized GObject.Value of type GObject.TYPE_STRING
Returns:the mask of GstGL.GLTextureTarget’s in value
Return type:GstGL.GLTextureTarget

See GstGL.gl_value_set_texture_target_from_mask() for what entails a mask

GstGL.gl_value_set_texture_target(value, target)[source]
Parameters:
Returns:

whether the target could be set on value

Return type:

bool

GstGL.gl_value_set_texture_target_from_mask(value, target_mask)[source]
Parameters:
Returns:

whether the target_mask could be set on value

Return type:

bool

A mask is a bitwise OR of (1 << target) where target is a valid GstGL.GLTextureTarget

GstGL.gl_version_to_glsl_version(gl_api, maj, min)[source]
Parameters:
Returns:

The minimum supported GstGL.GLSLVersion available for gl_api, maj and min

Return type:

GstGL.GLSLVersion

GstGL.gl_window_error_quark()[source]
Return type:int
GstGL.glsl_error_quark()[source]
Return type:int
GstGL.glsl_profile_from_string(string)[source]
Parameters:string (str) – a GLSL version string
Returns:the GstGL.GLSLProfile of string or GstGL.GLSLProfile.NONE on error
Return type:GstGL.GLSLProfile
GstGL.glsl_profile_to_string(profile)[source]
Parameters:profile (GstGL.GLSLProfile) – a GstGL.GLSLProfile
Returns:the name for profile or None on error
Return type:str or None
GstGL.glsl_string_get_version_profile(s)[source]
Parameters:s (str) – string to search for a valid #version string
Returns:True if a valid #version string was found, False otherwise
version:resulting GstGL.GLSLVersion
profile:resulting GstGL.GLSLProfile
Return type:(bool, version: GstGL.GLSLVersion, profile: GstGL.GLSLProfile)

Note: this function first searches the first 1 kilobytes for a #version preprocessor directive and then executes GstGL.GLSLVersion.profile_from_string().

GstGL.glsl_version_from_string(string)[source]
Parameters:string (str) – a GLSL version string
Returns:the GstGL.GLSLVersion of string or GstGL.GLSLVersion.NONE on error
Return type:GstGL.GLSLVersion
GstGL.glsl_version_profile_from_string(string)[source]
Parameters:string (str) – a valid GLSL #version string
Returns:True if a valid #version string was found, False otherwise
version_ret:resulting GstGL.GLSLVersion
profile_ret:resulting GstGL.GLSLVersion
Return type:(bool, version_ret: GstGL.GLSLVersion, profile_ret: GstGL.GLSLProfile)

Note: this function expects either a #version GLSL preprocesser directive or a valid GLSL version and/or profile.

GstGL.glsl_version_profile_to_string(version, profile)[source]
Parameters:
Returns:

the combined GLSL #version string for version and profile

Return type:

str

GstGL.glsl_version_to_string(version)[source]
Parameters:version (GstGL.GLSLVersion) – a GstGL.GLSLVersion
Returns:the name of version or None on error
Return type:str or None
GstGL.is_gl_base_memory(mem)[source]
Parameters:mem (Gst.Memory) – a Gst.Memory
Returns:whether the memory at mem is a GstGL.GLBaseMemory
Return type:bool

New in version 1.8.

GstGL.is_gl_buffer(mem)[source]
Parameters:mem (Gst.Memory) – a Gst.Memory
Returns:whether the memory at mem is a GstGL.GLBuffer
Return type:bool

New in version 1.8.

GstGL.is_gl_memory(mem)[source]
Parameters:mem (Gst.Memory) – a Gst.Memory
Returns:whether the memory at mem is a GstGL.GLMemory
Return type:bool

New in version 1.4.

GstGL.is_gl_memory_pbo(mem)[source]
Parameters:mem (Gst.Memory) – a Gst.Memory
Returns:whether the memory at mem is a GstGL.GLMemoryPBO
Return type:bool

New in version 1.8.

GstGL.is_gl_renderbuffer(mem)[source]
Parameters:mem (Gst.Memory) – a Gst.Memory
Returns:whether the memory at mem is a GstGL.GLRenderbuffer
Return type:bool

New in version 1.10.