# GstEGLImage

GstEGLImage represents and holds an `EGLImage` handle.

A GstEGLImage can be created from a dmabuf with gst_egl_image_from_dmabuf, or gst_egl_image_from_dmabuf_direct, or GstGLMemoryEGL provides a GstAllocator to allocate `EGLImage`'s bound to and OpenGL texture.

## GstEGLImage

Opaque GstEGLImage struct.

## GstGLEGL.EGLImage

Opaque GstGLEGL.EGLImage struct.

## GstGLEGL.EGLImage

Opaque GstGLEGL.EGLImage struct.

### Constructors

#### gst_egl_image_new_wrapped

    GstEGLImage *
    gst_egl_image_new_wrapped (GstGLContext * context,
                               gpointer image,
                               GstGLFormat format,
                               gpointer user_data,
                               GstEGLImageDestroyNotify user_data_destroy)

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`image` –

the image to wrap

`format` –

the GstGLFormat

`user_data` –

user data

`user_data_destroy` ( [destroy user_data][scope async]) –

called when user_data is no longer needed

Returns –

a new GstEGLImage wrapping image

#### GstGLEGL.EGLImage.prototype.new_wrapped

    function GstGLEGL.EGLImage.prototype.new_wrapped(context: GstGL.GLContext, image: Object, format: GstGL.GLFormat, user_data_destroy: GstGLEGL.EGLImageDestroyNotify): {
        // javascript wrapper for 'gst_egl_image_new_wrapped'
    }

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`image` (Object) –

the image to wrap

`format` (GstGL.GLFormat) –

the GstGL.GLFormat

`user_data_destroy` (GstGLEGL.EGLImageDestroyNotify) –

called when user_data is no longer needed

Returns (GstGLEGL.EGLImage) –

a new GstGLEGL.EGLImage wrapping image

#### GstGLEGL.EGLImage.new_wrapped

    def GstGLEGL.EGLImage.new_wrapped (context, image, format, user_data_destroy):
        #python wrapper for 'gst_egl_image_new_wrapped'

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`image` (object) –

the image to wrap

`format` (GstGL.GLFormat) –

the GstGL.GLFormat

`user_data_destroy` (GstGLEGL.EGLImageDestroyNotify) –

called when user_data is no longer needed

Returns (GstGLEGL.EGLImage) –

a new GstGLEGL.EGLImage wrapping image

### Methods

#### gst_egl_image_export_dmabuf

    gboolean
    gst_egl_image_export_dmabuf (GstEGLImage * image,
                                 int* fd,
                                 gint* stride,
                                 gsize* offset)

Parameters:

`image` –
No description available
`fd` –
No description available
`stride` –
No description available
`offset` –
No description available
Returns –
No description available

#### GstGLEGL.EGLImage.prototype.export_dmabuf

    function GstGLEGL.EGLImage.prototype.export_dmabuf(fd: Number, stride: Number, offset: Number): {
        // javascript wrapper for 'gst_egl_image_export_dmabuf'
    }

Parameters:

`image` (GstGLEGL.EGLImage) –
No description available
`fd` (Number) –
No description available
`stride` (Number) –
No description available
`offset` (Number) –
No description available
Returns (Number) –
No description available

#### GstGLEGL.EGLImage.export_dmabuf

    def GstGLEGL.EGLImage.export_dmabuf (self, fd, stride, offset):
        #python wrapper for 'gst_egl_image_export_dmabuf'

Parameters:

`image` (GstGLEGL.EGLImage) –
No description available
`fd` (int) –
No description available
`stride` (int) –
No description available
`offset` (int) –
No description available
Returns (bool) –
No description available

#### gst_egl_image_get_image

    gpointer
    gst_egl_image_get_image (GstEGLImage * image)

Parameters:

`image` –

a GstEGLImage

Returns –

the `EGLImage` of image

#### GstGLEGL.EGLImage.prototype.get_image

    function GstGLEGL.EGLImage.prototype.get_image(): {
        // javascript wrapper for 'gst_egl_image_get_image'
    }

Parameters:

`image` (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage

Returns (Object) –

the `EGLImage` of image

#### GstGLEGL.EGLImage.get_image

    def GstGLEGL.EGLImage.get_image (self):
        #python wrapper for 'gst_egl_image_get_image'

Parameters:

`image` (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage

Returns (object) –

the `EGLImage` of image

### Functions

#### gst_egl_image_from_dmabuf

    GstEGLImage *
    gst_egl_image_from_dmabuf (GstGLContext * context,
                               gint dmabuf,
                               const GstVideoInfo * in_info,
                               gint plane,
                               gsize offset)

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.

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`dmabuf` –

the DMA-Buf file descriptor

`in_info` –

the GstVideoInfo in dmabuf

`plane` –

the plane in in_info to create and GstEGLImage for

`offset` –

the byte-offset in the data

Returns ( [nullable]) –

a GstEGLImage wrapping dmabuf or NULL on failure

#### GstGLEGL.EGLImage.prototype.from_dmabuf

    function GstGLEGL.EGLImage.prototype.from_dmabuf(context: GstGL.GLContext, dmabuf: Number, in_info: GstVideo.VideoInfo, plane: Number, offset: Number): {
        // javascript wrapper for 'gst_egl_image_from_dmabuf'
    }

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.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`dmabuf` (Number) –

the DMA-Buf file descriptor

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo in dmabuf

`plane` (Number) –

the plane in in_info to create and GstGLEGL.EGLImage for

`offset` (Number) –

the byte-offset in the data

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

#### GstGLEGL.EGLImage.from_dmabuf

    def GstGLEGL.EGLImage.from_dmabuf (context, dmabuf, in_info, plane, offset):
        #python wrapper for 'gst_egl_image_from_dmabuf'

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.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`dmabuf` (int) –

the DMA-Buf file descriptor

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo in dmabuf

`plane` (int) –

the plane in in_info to create and GstGLEGL.EGLImage for

`offset` (int) –

the byte-offset in the data

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

#### gst_egl_image_from_dmabuf_direct

    GstEGLImage *
    gst_egl_image_from_dmabuf_direct (GstGLContext * context,
                                      gint* fd,
                                      const gsize* offset,
                                      const GstVideoInfo * in_info)

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 gst_egl_image_from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`fd` –

Array of DMABuf file descriptors

`offset` –

Array of offsets, relative to the DMABuf

`in_info` –

the GstVideoInfo

Returns ( [nullable]) –

a GstEGLImage wrapping dmabuf or NULL on failure

#### GstGLEGL.EGLImage.prototype.from_dmabuf_direct

    function GstGLEGL.EGLImage.prototype.from_dmabuf_direct(context: GstGL.GLContext, fd: Number, offset: Number, in_info: GstVideo.VideoInfo): {
        // javascript wrapper for 'gst_egl_image_from_dmabuf_direct'
    }

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.prototype.from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`fd` (Number) –

Array of DMABuf file descriptors

`offset` (Number) –

Array of offsets, relative to the DMABuf

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

#### GstGLEGL.EGLImage.from_dmabuf_direct

    def GstGLEGL.EGLImage.from_dmabuf_direct (context, fd, offset, in_info):
        #python wrapper for 'gst_egl_image_from_dmabuf_direct'

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.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`fd` (int) –

Array of DMABuf file descriptors

`offset` (int) –

Array of offsets, relative to the DMABuf

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

#### gst_egl_image_from_dmabuf_direct_target

    GstEGLImage *
    gst_egl_image_from_dmabuf_direct_target (GstGLContext * context,
                                             gint* fd,
                                             const gsize* offset,
                                             const GstVideoInfo * in_info,
                                             GstGLTextureTarget target)

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 gst_egl_image_from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`fd` –

Array of DMABuf file descriptors

`offset` –

Array of offsets, relative to the DMABuf

`in_info` –

the GstVideoInfo

`target` –

GL texture target this GstEGLImage is intended for

Returns ( [nullable]) –

a GstEGLImage wrapping dmabuf or NULL on failure

Since : 1.18

#### GstGLEGL.EGLImage.prototype.from_dmabuf_direct_target

    function GstGLEGL.EGLImage.prototype.from_dmabuf_direct_target(context: GstGL.GLContext, fd: Number, offset: Number, in_info: GstVideo.VideoInfo, target: GstGL.GLTextureTarget): {
        // javascript wrapper for 'gst_egl_image_from_dmabuf_direct_target'
    }

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.prototype.from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`fd` (Number) –

Array of DMABuf file descriptors

`offset` (Number) –

Array of offsets, relative to the DMABuf

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo

`target` (GstGL.GLTextureTarget) –

GL texture target this GstEGLImage is intended for

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

Since : 1.18

#### GstGLEGL.EGLImage.from_dmabuf_direct_target

    def GstGLEGL.EGLImage.from_dmabuf_direct_target (context, fd, offset, in_info, target):
        #python wrapper for 'gst_egl_image_from_dmabuf_direct_target'

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.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`fd` (int) –

Array of DMABuf file descriptors

`offset` (int) –

Array of offsets, relative to the DMABuf

`in_info` (GstVideo.VideoInfo) –

the GstVideo.VideoInfo

`target` (GstGL.GLTextureTarget) –

GL texture target this GstEGLImage is intended for

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

Since : 1.18

#### gst_egl_image_from_dmabuf_direct_target_with_dma_drm

    GstEGLImage *
    gst_egl_image_from_dmabuf_direct_target_with_dma_drm (GstGLContext * context,
                                                          guint n_planes,
                                                          gint* fd,
                                                          const gsize* offset,
                                                          const GstVideoInfoDmaDrm * in_info_dma,
                                                          GstGLTextureTarget target)

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 gst_egl_image_from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`n_planes` –

number of planes (obtained from a GstVideoMeta)

`fd` –

Array of DMABuf file descriptors

`offset` –

Array of offsets, relative to the DMABuf

`in_info_dma` –

the GstVideoInfoDmaDrm

`target` –

GL texture target this GstEGLImage is intended for

Returns ( [nullable]) –

a GstEGLImage wrapping dmabuf or NULL on failure

Since : 1.24

#### GstGLEGL.EGLImage.prototype.from_dmabuf_direct_target_with_dma_drm

    function GstGLEGL.EGLImage.prototype.from_dmabuf_direct_target_with_dma_drm(context: GstGL.GLContext, n_planes: Number, fd: Number, offset: Number, in_info_dma: GstVideo.VideoInfoDmaDrm, target: GstGL.GLTextureTarget): {
        // javascript wrapper for 'gst_egl_image_from_dmabuf_direct_target_with_dma_drm'
    }

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.prototype.from_dmabuf is that this function creates one EGL image for all planes, not one for a single plane.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`n_planes` (Number) –

number of planes (obtained from a GstVideo.VideoMeta)

`fd` (Number) –

Array of DMABuf file descriptors

`offset` (Number) –

Array of offsets, relative to the DMABuf

`in_info_dma` (GstVideo.VideoInfoDmaDrm) –

the GstVideo.VideoInfoDmaDrm

`target` (GstGL.GLTextureTarget) –

GL texture target this GstEGLImage is intended for

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

Since : 1.24

#### GstGLEGL.EGLImage.from_dmabuf_direct_target_with_dma_drm

    def GstGLEGL.EGLImage.from_dmabuf_direct_target_with_dma_drm (context, n_planes, fd, offset, in_info_dma, target):
        #python wrapper for 'gst_egl_image_from_dmabuf_direct_target_with_dma_drm'

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.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`n_planes` (int) –

number of planes (obtained from a GstVideo.VideoMeta)

`fd` (int) –

Array of DMABuf file descriptors

`offset` (int) –

Array of offsets, relative to the DMABuf

`in_info_dma` (GstVideo.VideoInfoDmaDrm) –

the GstVideo.VideoInfoDmaDrm

`target` (GstGL.GLTextureTarget) –

GL texture target this GstEGLImage is intended for

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping dmabuf or NULL on failure

Since : 1.24

#### gst_egl_image_from_texture

    GstEGLImage *
    gst_egl_image_from_texture (GstGLContext * context,
                                GstGLMemory * gl_mem,
                                guintptr* attribs)

Parameters:

`context` –

a GstGLContext (must be an EGL context)

`gl_mem` –

a GstGLMemory

`attribs` –

additional attributes to add to the `eglCreateImage`() call.

Returns ( [transfer: full][nullable]) –

a GstEGLImage wrapping gl_mem or NULL on failure

#### GstGLEGL.EGLImage.prototype.from_texture

    function GstGLEGL.EGLImage.prototype.from_texture(context: GstGL.GLContext, gl_mem: GstGL.GLMemory, attribs: Number): {
        // javascript wrapper for 'gst_egl_image_from_texture'
    }

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`gl_mem` (GstGL.GLMemory) –

a GstGL.GLMemory

`attribs` (Number) –

additional attributes to add to the `eglCreateImage`() call.

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping gl_mem or NULL on failure

#### GstGLEGL.EGLImage.from_texture

    def GstGLEGL.EGLImage.from_texture (context, gl_mem, attribs):
        #python wrapper for 'gst_egl_image_from_texture'

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext (must be an EGL context)

`gl_mem` (GstGL.GLMemory) –

a GstGL.GLMemory

`attribs` (int) –

additional attributes to add to the `eglCreateImage`() call.

Returns (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage wrapping gl_mem or NULL on failure

## Function Macros

### GST_EGL_IMAGE_CAST

    #define GST_EGL_IMAGE_CAST(obj)                    ((GstEGLImage *)(obj))

## Callbacks

### GstEGLImageDestroyNotify

    (*GstEGLImageDestroyNotify) (GstEGLImage * image,
                                 gpointer data)

Function to be called when the GstEGLImage is destroyed. It should free the associated `EGLImage` if necessary

Parameters:

`image` –

a GstEGLImage

`data` –

user data passed to gst_egl_image_new_wrapped

### GstGLEGL.EGLImageDestroyNotify

    function GstGLEGL.EGLImageDestroyNotify(image: GstGLEGL.EGLImage, data: Object): {
        // javascript wrapper for 'GstEGLImageDestroyNotify'
    }

Function to be called when the GstEGLImage is destroyed. It should free the associated `EGLImage` if necessary

Parameters:

`image` (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage

`data` (Object) –

user data passed to GstGLEGL.EGLImage.prototype.new_wrapped

### GstGLEGL.EGLImageDestroyNotify

    def GstGLEGL.EGLImageDestroyNotify (image, data):
        #python wrapper for 'GstEGLImageDestroyNotify'

Function to be called when the GstEGLImage is destroyed. It should free the associated `EGLImage` if necessary

Parameters:

`image` (GstGLEGL.EGLImage) –

a GstGLEGL.EGLImage

`data` (object) –

user data passed to GstGLEGL.EGLImage.new_wrapped

The results of the search are