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 |
|
|
|
|
Details¶
- class GstGLEGL.EGLImage¶
GstGLEGL.EGLImage
represents and holds anEGLImage
handle.A
GstGLEGL.EGLImage
can be created from a dmabuf withGstGLEGL.EGLImage.from_dmabuf
(), orGstGLEGL.EGLImage.from_dmabuf_direct
(), orGstGLEGL.GLMemoryEGL
provides aGst.Allocator
to allocateEGLImage
’s bound to and OpenGL texture.- 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.VideoInfo
in dmabufplane (
int
) – the plane in in_info to create andGstGLEGL.EGLImage
foroffset (
int
) – the byte-offset in the data
- Returns:
a
GstGLEGL.EGLImage
wrapping dmabuf orNone
on 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.EGLImage
wrapping dmabuf orNone
on 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.VideoInfo
target (
GstGL.GLTextureTarget
) – GL texture target thisGstGLEGL.EGLImage
is intended for
- Returns:
a
GstGLEGL.EGLImage
wrapping dmabuf orNone
on 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.VideoInfoDmaDrm
target (
GstGL.GLTextureTarget
) – GL texture target thisGstGLEGL.EGLImage
is intended for
- Returns:
a
GstGLEGL.EGLImage
wrapping dmabuf orNone
on 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.GLMemory
attribs (
int
) – additional attributes to add to the ``eglCreateImage``() call.
- Returns:
a
GstGLEGL.EGLImage
wrapping gl_mem orNone
on 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.GLFormat
user_data_destroy (
GstGLEGL.EGLImageDestroyNotify
) – called when user_data is no longer needed
- Returns:
a new
GstGLEGL.EGLImage
wrapping image- Return type:
- export_dmabuf(fd, stride, offset)¶