GstEGLImage: GStreamer Base Plugins 1.0 Library Reference Manual

## GstEGLImage GstEGLImage — EGLImage abstraction |

## Functions

GstEGLImage * | gst_egl_image_from_dmabuf ()
GstEGLImage * | gst_egl_image_from_texture ()
gpointer | gst_egl_image_get_image ()
GstEGLImage * | gst_egl_image_new_wrapped ()
GstEGLImage * | gst_egl_image_ref ()
void | gst_egl_image_unref ()
void | (*GstEGLImageDestroyNotify) ()

## Includes

    #include <gst/gl/gl.h>

## Description

GstEGLImage represents and holds an EGLImage handle.

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

## Functions

### gst_egl_image_from_dmabuf ()

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

#### 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

a GstEGLImage wrapping `dmabuf` or `NULL` on failure

### 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

a GstEGLImage wrapping `gl_mem` or `NULL` on failure.

[transfer full]

### gst_egl_image_get_image ()

    gpointer
    gst_egl_image_get_image (GstEGLImage *image);

#### Parameters

image | a GstEGLImage |

#### Returns

the EGLImageKHR of `image`

### 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 | called when `user_data` is no longer needed |

#### Returns

a new GstEGLImage wrapping `image`

### gst_egl_image_ref ()

    GstEGLImage *
    gst_egl_image_ref (GstEGLImage *image);

Increases the refcount of the given image by one.

#### Parameters

image | a GstEGLImage. |

#### Returns

`image` .

[transfer full]

### gst_egl_image_unref ()

    void
    gst_egl_image_unref (GstEGLImage *image);

Decreases the refcount of the image. If the refcount reaches 0, the image with the associated metadata and memory will be freed.

#### Parameters

image | a GstEGLImage. | [transfer full]

### GstEGLImageDestroyNotify ()

    void
    (*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()` |

## Types and Values

## See Also

GstGLMemoryEGL, GstGLContext