GstGL.GLMemory¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
info |
r/w |
the texture’s |
|
mem |
r/w |
the parent |
|
plane |
r/w |
data plane in info |
|
tex_format |
r/w |
the texture type |
|
tex_id |
r/w |
the GL texture id for this memory |
|
tex_scaling |
[ |
r/w |
GL shader scaling parameters for valign and/or width/height |
tex_target |
r/w |
the GL texture target for this memory |
|
tex_width |
r/w |
||
texture_wrapped |
r/w |
||
unpack_length |
r/w |
||
valign |
r/w |
data alignment for system memory mapping |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstGL.GLMemory¶
GstGL.GLMemoryis aGstGL.GLBaseMemorysubclass providing support for the mapping of OpenGL textures.GstGL.GLMemoryis created or wrapped throughGstGL.GLBaseMemory.alloc() withGstGL.GLVideoAllocationParams.Data is uploaded or downloaded from the GPU as is necessary.
The
Gst.Capsthat is used forGstGL.GLMemorybased buffers should contain theGstGL.CAPS_FEATURE_MEMORY_GL_MEMORYas aGst.CapsFeaturesand should contain a ‘texture-target’ field with one of theGstGL.GLTextureTargetvalues as a string, i.e. some combination of ‘texture-target=(string){2D, rectangle, external-oes}’.- classmethod 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.GLMemoryoperation.New in version 1.4.
- copy_into(tex_id, target, tex_format, width, height)[source]¶
- Parameters:
tex_id (
int) – OpenGL texture idtarget (
GstGL.GLTextureTarget) – theGstGL.GLTextureTargettex_format (
GstGL.GLFormat) – theGstGL.GLFormatwidth (
int) – width of tex_idheight (
int) – height of tex_id
- Returns:
Whether the copy succeeded
- Return type:
Copies self into the texture specified by tex_id. The format of tex_id is specified by tex_format, width and height.
New in version 1.8.
- copy_teximage(tex_id, out_target, out_tex_format, out_width, out_height)[source]¶
- Parameters:
tex_id (
int) – the destination texture idout_target (
GstGL.GLTextureTarget) – the destinationGstGL.GLTextureTargetout_tex_format (
GstGL.GLFormat) – the destinationGstGL.GLFormatout_width (
int) – the destination widthout_height (
int) – the destination height
- Returns:
whether the copy succeeded.
- Return type:
Copies the texture in
GstGL.GLMemoryinto the texture specified by tex_id, out_target, out_tex_format, out_width and out_height.New in version 1.8.
- get_texture_format()[source]¶
- Returns:
the
GstGL.GLFormatof self- Return type:
New in version 1.12.
- get_texture_id()[source]¶
- Returns:
the OpenGL texture handle of self
- Return type:
New in version 1.8.
- get_texture_target()[source]¶
- Returns:
the
GstGL.GLTextureTargetof self- Return type:
New in version 1.8.
- init(allocator, parent, context, target, tex_format, params, info, plane, valign, user_data, notify)[source]¶
- Parameters:
allocator (
Gst.Allocator) – theGst.Allocatorto initialize withparent (
Gst.MemoryorNone) – the parentGst.Memoryto initialize withcontext (
GstGL.GLContext) – theGstGL.GLContextto initialize withtarget (
GstGL.GLTextureTarget) – theGstGL.GLTextureTargetfor thisGstGL.GLMemorytex_format (
GstGL.GLFormat) – theGstGL.GLFormatfor thisGstGL.GLMemoryparams (
Gst.AllocationParamsorNone) – the GstAllocationParams to initialize withinfo (
GstVideo.VideoInfo) – theGstVideo.VideoInfofor thisGstGL.GLMemoryplane (
int) – the plane number (starting from 0) for thisGstGL.GLMemoryvalign (
GstVideo.VideoAlignmentorNone) – optionalGstVideo.VideoAlignmentparametersnotify (
GLib.DestroyNotifyorNone) – aGLib.DestroyNotify
Initializes self with the required parameters. info is assumed to have already have been modified with
GstVideo.VideoInfo.align().New in version 1.8.
- read_pixels(write_pointer)[source]¶
- Parameters:
write_pointer (
objectorNone) – the data pointer to pass to glReadPixels- Returns:
whether theread operation succeeded
- Return type:
Reads the texture in
GstGL.GLMemoryinto write_pointer if no buffer is bound toGL_PIXEL_PACK_BUFFER. Otherwise write_pointer is the byte offset into the currently boundGL_PIXEL_PACK_BUFFERbuffer to store the result of glReadPixels. See the OpenGL specification for glReadPixels for more details.New in version 1.8.
- texsubimage(read_pointer)[source]¶
-
Reads the texture in read_pointer into self.
See
GstGL.GLMemory.read_pixels() for what read_pointer signifies.New in version 1.8.