/* * Derived from GStreamer 0.10 EGL Library in gst-omx * Copyright (C) 2014 Fluendo S.A. * @author: Josep Torra * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __MY_EGL_H__ #define __MY_EGL_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _EGLImageMemory EGLImageMemory; typedef struct _EGLImageMemoryPool EGLImageMemoryPool; typedef struct _EGLDisplayWrapper EGLDisplayWrapper; typedef void (*DestroyNotifyEGLImageMemoryPool) (EGLImageMemoryPool * pool, gpointer user_data); /* EGLImageMemory handling */ EGLImageMemory *egl_image_memory_ref (EGLImageMemory * mem); EGLImageMemory *egl_image_memory_unref (EGLImageMemory * mem); EGLImageKHR egl_image_memory_get_image (EGLImageMemory * mem); /* EGLImageMemoryPool handling */ #define TYPE_EGL_IMAGE_MEMORY_POOL (egl_image_memory_pool_get_type()) GType egl_image_memory_pool_get_type (void); EGLImageMemoryPool *egl_image_memory_pool_new (gint size, EGLDisplayWrapper * display, gpointer user_data, DestroyNotifyEGLImageMemoryPool destroy_data); EGLImageMemoryPool *egl_image_memory_pool_ref (EGLImageMemoryPool * pool); EGLImageMemoryPool *egl_image_memory_pool_unref (EGLImageMemoryPool * pool); gint egl_image_memory_pool_get_size (EGLImageMemoryPool * pool); gboolean egl_image_memory_pool_set_resources (EGLImageMemoryPool * pool, gint idx, EGLClientBuffer client_buffer, EGLImageKHR image); gboolean egl_image_memory_pool_get_resources (EGLImageMemoryPool * pool, gint idx, EGLClientBuffer * client_buffer, EGLImageKHR * image); EGLDisplayWrapper *egl_image_memory_pool_get_display (EGLImageMemoryPool * pool); GList *egl_image_memory_pool_get_images (EGLImageMemoryPool * pool); void egl_image_memory_pool_set_active (EGLImageMemoryPool * pool, gboolean active); void egl_image_memory_pool_wait_released (EGLImageMemoryPool * pool); EGLImageMemory *egl_image_memory_pool_acquire_memory (EGLImageMemoryPool * pool, gint idx, gpointer user_data, GDestroyNotify destroy_data); /* EGLDisplay wrapper with refcount, connection is closed after last ref is gone */ EGLDisplayWrapper * egl_display_new (EGLDisplay display, gpointer user_data, GDestroyNotify destroy_data); EGLDisplayWrapper *egl_display_ref (EGLDisplayWrapper * display); void egl_display_unref (EGLDisplayWrapper * display); EGLDisplay egl_display_get (EGLDisplayWrapper * display); G_END_DECLS #endif /* __MY_EGL_H__ */