GstGLEGL.EGLImage¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
context |
r |
||
destroy_data |
r |
||
destroy_notify |
r |
||
format |
r |
||
image |
r |
||
parent |
r |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
Details¶
- class GstGLEGL.EGLImage¶
GstGLEGL.EGLImagerepresents and holds anEGLImagehandle.A
GstGLEGL.EGLImagecan be created from a dmabuf withGstGLEGL.EGLImage.from_dmabuf(), orGstGLEGL.EGLImage.from_dmabuf_direct(), orGstGLEGL.GLMemoryEGLprovides aGst.Allocatorto allocateEGLImage’s bound to and OpenGL texture.- classmethod can_emulate(context, format)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)format (
GstVideo.VideoFormat) – aGstVideo.VideoFormat
- Returns:
Trueif format can be emulated- Return type:
Checks if the given context can emulate format using a limited subset of RGB texture formats. Such format is then suitable for importing using
GstGLEGL.EGLImage.from_dmabuf() even when GL supports the video format as external-only or not at all.New in version 1.26.
- classmethod from_dmabuf(context, dmabuf, in_info, plane, offset)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)dmabuf (
int) – the DMA-Buf file descriptorin_info (
GstVideo.VideoInfo) – theGstVideo.VideoInfoin dmabufplane (
int) – the plane in in_info to create andGstGLEGL.EGLImageforoffset (
int) – the byte-offset in the data
- Returns:
a
GstGLEGL.EGLImagewrapping dmabuf orNoneon failure- Return type:
Creates an EGL image that imports the dmabuf FD. The dmabuf data is passed as RGBA data. Shaders later take this “RGBA” data and convert it from its true format (described by in_info) to actual RGBA output. For example, with I420, three EGL images are created, one for each plane, each EGL image with a single-channel R format. With NV12, two EGL images are created, one with R format, one with RG format etc.
- classmethod from_dmabuf_direct(context, fd, offset, in_info)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)fd (
int) – Array of DMABuf file descriptorsoffset (
int) – Array of offsets, relative to the DMABufin_info (
GstVideo.VideoInfo) – theGstVideo.VideoInfo
- Returns:
a
GstGLEGL.EGLImagewrapping dmabuf orNoneon failure- Return type:
Creates an EGL image that imports the dmabuf FD. The dmabuf data is passed directly as the format described in in_info. This is useful if the hardware is capable of performing color space conversions internally. The appropriate DRM format is picked, and the EGL image is created with this DRM format.
Another notable difference to
GstGLEGL.EGLImage.from_dmabuf() is that this function creates one EGL image for all planes, not one for a single plane.
- classmethod from_dmabuf_direct_target(context, fd, offset, in_info, target)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)fd (
int) – Array of DMABuf file descriptorsoffset (
int) – Array of offsets, relative to the DMABufin_info (
GstVideo.VideoInfo) – theGstVideo.VideoInfotarget (
GstGL.GLTextureTarget) – GL texture target thisGstGLEGL.EGLImageis intended for
- Returns:
a
GstGLEGL.EGLImagewrapping dmabuf orNoneon failure- Return type:
Creates an EGL image that imports the dmabuf FD. The dmabuf data is passed directly as the format described in in_info. This is useful if the hardware is capable of performing color space conversions internally. The appropriate DRM format is picked, and the EGL image is created with this DRM format.
Another notable difference to
GstGLEGL.EGLImage.from_dmabuf() is that this function creates one EGL image for all planes, not one for a single plane.New in version 1.18.
- classmethod from_dmabuf_direct_target_with_dma_drm(context, n_planes, fd, offset, in_info_dma, target)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)n_planes (
int) – number of planes (obtained from aGstVideo.VideoMeta)fd (
int) – Array of DMABuf file descriptorsoffset (
int) – Array of offsets, relative to the DMABufin_info_dma (
GstVideo.VideoInfoDmaDrm) – theGstVideo.VideoInfoDmaDrmtarget (
GstGL.GLTextureTarget) – GL texture target thisGstGLEGL.EGLImageis intended for
- Returns:
a
GstGLEGL.EGLImagewrapping dmabuf orNoneon failure- Return type:
Creates an EGL image that imports the dmabuf FD. The dmabuf data is passed directly as the format described in in_info. This is useful if the hardware is capable of performing color space conversions internally.
Another notable difference to
GstGLEGL.EGLImage.from_dmabuf() is that this function creates one EGL image for all planes, not one for a single plane.New in version 1.24.
- classmethod from_texture(context, gl_mem, attribs)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)gl_mem (
GstGL.GLMemory) – aGstGL.GLMemoryattribs (
int) – additional attributes to add to the ``eglCreateImage``() call.
- Returns:
a
GstGLEGL.EGLImagewrapping gl_mem orNoneon failure- Return type:
- classmethod new_wrapped(context, image, format, user_data_destroy)¶
- Parameters:
context (
GstGL.GLContext) – aGstGL.GLContext(must be an EGL context)format (
GstGL.GLFormat) – theGstGL.GLFormatuser_data_destroy (
GstGLEGL.EGLImageDestroyNotify) – called when user_data is no longer needed
- Returns:
a new
GstGLEGL.EGLImagewrapping image- Return type:
- export_dmabuf(fd, stride, offset)¶