GLMemory

GstGLMemory is a #GstGLBaseMemory subclass providing support for the mapping of OpenGL textures.

#GstGLMemory is created or wrapped through gstgl.glbase_memory.GLBaseMemory.alloc with #GstGLVideoAllocationParams.

Data is uploaded or downloaded from the GPU as is necessary.

The #GstCaps that is used for #GstGLMemory based buffers should contain the GST_CAPS_FEATURE_MEMORY_GL_MEMORY as a #GstCapsFeatures and should contain a 'texture-target' field with one of the #GstGLTextureTarget values as a string, i.e. some combination of 'texture-target=(string){2D, rectangle, external-oes}'.

class GLMemory : Boxed {}

Constructors

this
this(uint texId, gstgl.types.GLTextureTarget texTarget, gstgl.types.GLFormat texFormat, uint plane, bool textureWrapped, uint unpackLength, uint texWidth)

Create a glmemory.GLMemory boxed type.

this
this(void* ptr, Flag!"Take" take)

Members

Functions

cPtr
void* cPtr(Flag!"Dup" dup)
copyInto
bool copyInto(uint texId, gstgl.types.GLTextureTarget target, gstgl.types.GLFormat texFormat, int width, int height)

Copies gl_mem into the texture specified by tex_id. The format of tex_id is specified by tex_format, width and height.

copyTeximage
bool copyTeximage(uint texId, gstgl.types.GLTextureTarget outTarget, gstgl.types.GLFormat outTexFormat, int outWidth, int outHeight)

Copies the texture in #GstGLMemory into the texture specified by tex_id, out_target, out_tex_format, out_width and out_height.

getTextureFormat
gstgl.types.GLFormat getTextureFormat()
getTextureHeight
int getTextureHeight()
getTextureId
uint getTextureId()
getTextureTarget
gstgl.types.GLTextureTarget getTextureTarget()
getTextureWidth
int getTextureWidth()
init_
void init_(gst.allocator.Allocator allocator, gst.memory.Memory parent, gstgl.glcontext.GLContext context, gstgl.types.GLTextureTarget target, gstgl.types.GLFormat texFormat, gst.allocation_params.AllocationParams params, gstvideo.video_info.VideoInfo info, uint plane, gstvideo.video_alignment.VideoAlignment valign, void* userData, glib.types.DestroyNotify notify)

Initializes mem with the required parameters. info is assumed to have already have been modified with gstvideo.video_info.VideoInfo.align_.

readPixels
bool readPixels(void* writePointer)

Reads the texture in #GstGLMemory into write_pointer if no buffer is bound to GL_PIXEL_PACK_BUFFER. Otherwise write_pointer is the byte offset into the currently bound GL_PIXEL_PACK_BUFFER buffer to store the result of glReadPixels. See the OpenGL specification for glReadPixels for more details.

self
GLMemory self()

Returns this, for use in with statements.

texsubimage
void texsubimage(void* readPointer)

Reads the texture in read_pointer into gl_mem.

Properties

gType
GType gType [@property getter]
info
gstvideo.video_info.VideoInfo info [@property getter]

Get field info.

mem
gstgl.glbase_memory.GLBaseMemory mem [@property getter]

Get field mem.

plane
uint plane [@property getter]

Get field plane.

plane
uint plane [@property setter]

Set field plane.

texFormat
gstgl.types.GLFormat texFormat [@property getter]

Get field texFormat.

texFormat
gstgl.types.GLFormat texFormat [@property setter]

Set field texFormat.

texId
uint texId [@property getter]

Get field texId.

texId
uint texId [@property setter]

Set field texId.

texTarget
gstgl.types.GLTextureTarget texTarget [@property getter]

Get field texTarget.

texTarget
gstgl.types.GLTextureTarget texTarget [@property setter]

Set field texTarget.

texWidth
uint texWidth [@property getter]
texWidth
uint texWidth [@property setter]
textureWrapped
bool textureWrapped [@property getter]
textureWrapped
bool textureWrapped [@property setter]
unpackLength
uint unpackLength [@property getter]
unpackLength
uint unpackLength [@property setter]
valign
gstvideo.video_alignment.VideoAlignment valign [@property getter]

Get field valign.

Static functions

getGType
GType getGType()
initOnce
void initOnce()

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

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.