GstGL.GLFramebuffer

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new (context)

class

new_with_default_depth (context, width, height)

attach (attachment_point, mem)

bind ()

draw_to_texture (mem, func, *user_data)

get_effective_dimensions ()

get_id ()

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

attachments

[object]

r

context

GstGL.GLContext

r

fbo_id

int

r

object

Gst.Object

r

Class Details

class GstGL.GLFramebuffer(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstGL.GLFramebufferClass

A GstGL.GLFramebuffer represents and holds an OpenGL framebuffer object with it’s associated attachments.

A GstGL.GLFramebuffer can be created with GstGL.GLFramebuffer.new() or GstGL.GLFramebuffer.new_with_default_depth() and bound with GstGL.GLFramebuffer.bind(). Other resources can be bound with GstGL.GLFramebuffer.attach()

Note: OpenGL framebuffers are not shareable resources so cannot be used between multiple OpenGL contexts.

New in version 1.10.

classmethod new(context)[source]
Parameters:

context (GstGL.GLContext) – a GstGL.GLContext

Returns:

a new GstGL.GLFramebuffer

Return type:

GstGL.GLFramebuffer

This function will internally create an OpenGL framebuffer object and must be called on context's OpenGL thread.

New in version 1.10.

classmethod new_with_default_depth(context, width, height)[source]
Parameters:
Returns:

a new GstGL.GLFramebuffer with a depth buffer of width and height

Return type:

GstGL.GLFramebuffer

This function will internally create an OpenGL framebuffer object and must be called on context's OpenGL thread.

New in version 1.10.

attach(attachment_point, mem)[source]
Parameters:
  • attachment_point (int) – the OpenGL attachment point to bind mem to

  • mem (GstGL.GLBaseMemory) – the memory object to bind to attachment_point

attach mem to attachment_point

Must be called with the same OpenGL context current that self was created with.

New in version 1.10.

bind()[source]

Bind self into the current thread

Must be called with the same OpenGL context current that self was created with.

New in version 1.10.

draw_to_texture(mem, func, *user_data)[source]
Parameters:
Returns:

the result of executing func

Return type:

bool

Perform the steps necessary to have the output of a glDraw* command in func update the contents of mem.

Note: this function does not map mem for writing with OpenGL and that must be done manually by the caller using any of the mapping functions such as Gst.Memory.map() with the map flags Gst.MapFlags.WRITE | GstGL.MAP_GL.

Must be called with the same OpenGL context current that self was created with.

New in version 1.10.

get_effective_dimensions()[source]
Returns:

width:

output width

height:

output height

Return type:

(width: int, height: int)

Retrieve the effective dimensions from the current attachments attached to self.

New in version 1.10.

get_id()[source]
Returns:

the OpenGL id for self

Return type:

int

New in version 1.10.