GstGL.GLColorConvert

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GstGL.GLColorConvert GstGL.GLColorConvert Gst.Object->GstGL.GLColorConvert

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

fixate_caps (context, direction, caps, other)

class

new (context)

class

swizzle_shader_string (context)

class

transform_caps (context, direction, caps, filter)

class

yuv_to_rgb_shader_string (context)

decide_allocation (query)

perform (inbuf)

set_caps (in_caps, out_caps)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

context

GstGL.GLContext

r

fbo

GstGL.GLFramebuffer

r

in_info

GstVideo.VideoInfo

r

inbuf

Gst.Buffer

r

initted

bool

r

out_info

GstVideo.VideoInfo

r

outbuf

Gst.Buffer

r

parent

Gst.Object

r

passthrough

bool

r

shader

GstGL.GLShader

r

Class Details

class GstGL.GLColorConvert(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstGL.GLColorConvertClass

GstGL.GLColorConvert is an object that converts between color spaces and/or formats using OpenGL Shaders.

A GstGL.GLColorConvert can be created with GstGL.GLColorConvert.new(), the configuration negotiated with GstGL.GLColorConvert.transform_caps() and the conversion performed with GstGL.GLColorConvert.perform().

The glcolorconvertelement provides a GStreamer element that uses GstGL.GLColorConvert to convert between video formats and color spaces.

classmethod fixate_caps(context, direction, caps, other)[source]
Parameters:
Returns:

the fixated Gst.Caps

Return type:

Gst.Caps

Provides an implementation of GstBase.BaseTransform.do_fixate_caps()

New in version 1.8.

classmethod new(context)[source]
Parameters:

context (GstGL.GLContext) – a GstGL.GLContext

Returns:

a new GstGL.GLColorConvert object

Return type:

GstGL.GLColorConvert

New in version 1.4.

classmethod swizzle_shader_string(context)[source]
Parameters:

context (GstGL.GLContext) – a GstGL.GLContext

Returns:

a shader string that can be used to swizzle vec components in a GLSL shader.

Return type:

str

New in version 1.24.

classmethod transform_caps(context, direction, caps, filter)[source]
Parameters:
Returns:

the converted Gst.Caps

Return type:

Gst.Caps

Provides an implementation of GstBase.BaseTransform.do_transform_caps()

New in version 1.6.

classmethod yuv_to_rgb_shader_string(context)[source]
Parameters:

context (GstGL.GLContext) – a GstGL.GLContext

Returns:

a glsl function that can be used to convert from yuv to rgb

Return type:

str

The returned glsl function has declaration:

vec3 yuv_to_rgb (vec3 rgb, vec3 offset, vec3 ycoeff, vec3 ucoeff, vec3 vcoeff);

The Y component is placed in the 0th index of the returned value, The U component in the 1st, and the V component in the 2nd. offset, ycoeff, ucoeff, and vcoeff are the specific coefficients and offset used for the conversion.

New in version 1.24.

decide_allocation(query)[source]
Parameters:

query (Gst.Query) – a completed ALLOCATION Gst.Query

Returns:

whether the allocation parameters were successfully chosen

Return type:

bool

Provides an implementation of GstBase.BaseTransform.do_decide_allocation()

New in version 1.8.

perform(inbuf)[source]
Parameters:

inbuf (Gst.Buffer) – the GstGL.GLMemory filled Gst.Buffer to convert

Returns:

a converted Gst.Buffer or None

Return type:

Gst.Buffer or None

Converts the data contained by inbuf using the formats specified by the Gst.Caps passed to GstGL.GLColorConvert.set_caps()

New in version 1.4.

set_caps(in_caps, out_caps)[source]
Parameters:
Return type:

bool

Initializes self with the information required for conversion.

New in version 1.6.