From a6e50140b723734bcf99d4c2af79d808010ca0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 17 Apr 2013 10:40:48 +0200 Subject: [PATCH] egl: Use new types from libgstvideo instead of defining our own --- gst-libs/gst/egl/Makefile.am | 6 +++++- gst-libs/gst/egl/egl.c | 22 ++++++++++----------- gst-libs/gst/egl/egl.h | 37 ++++++------------------------------ 3 files changed, 21 insertions(+), 44 deletions(-) diff --git a/gst-libs/gst/egl/Makefile.am b/gst-libs/gst/egl/Makefile.am index c89fcb5188..2270d26d5c 100644 --- a/gst-libs/gst/egl/Makefile.am +++ b/gst-libs/gst/egl/Makefile.am @@ -9,10 +9,13 @@ libgstegl_@GST_API_VERSION@include_HEADERS = egl.h libgstegl_@GST_API_VERSION@_la_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) \ + $(GST_PLUGINS_BASE_CFLAGS) \ $(GST_CFLAGS) \ $(EGL_CFLAGS) libgstegl_@GST_API_VERSION@_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + -lgstvideo-@GST_API_VERSION@ \ $(GST_LIBS) \ $(EGL_LIBS) @@ -41,11 +44,12 @@ GstEGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstegl-@GST_API_VERSIO -I$(top_srcdir)/gst-libs \ -I$(top_builddir)/gst-libs \ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ + --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \ --library=libgstegl-@GST_API_VERSION@.la \ --include=Gst-@GST_API_VERSION@ \ --libtool="$(top_builddir)/libtool" \ --pkg gstreamer-@GST_API_VERSION@ \ + --pkg gstreamer-video-@GST_API_VERSION@ \ --pkg-export gstreamer-egl-@GST_API_VERSION@ \ --add-init-section="gst_init(NULL,NULL);" \ -DGST_USE_UNSTABLE_API \ diff --git a/gst-libs/gst/egl/egl.c b/gst-libs/gst/egl/egl.c index 374a6ffdd7..164f8e4445 100644 --- a/gst-libs/gst/egl/egl.c +++ b/gst-libs/gst/egl/egl.c @@ -33,8 +33,8 @@ typedef struct GstEGLDisplay *display; EGLImageKHR image; - GstEGLImageType type; - GstEGLImageOrientation orientation; + GstVideoGLTextureType type; + GstVideoGLTextureOrientation orientation; gpointer user_data; GDestroyNotify user_data_destroy; @@ -79,11 +79,10 @@ gst_egl_image_memory_get_display (GstMemory * mem) return gst_egl_display_ref (GST_EGL_IMAGE_MEMORY (mem)->display); } -GstEGLImageType +GstVideoGLTextureType gst_egl_image_memory_get_type (GstMemory * mem) { - g_return_val_if_fail (gst_is_egl_image_memory (mem), - GST_EGL_IMAGE_MEMORY_TYPE_INVALID); + g_return_val_if_fail (gst_is_egl_image_memory (mem), -1); if (mem->parent) mem = mem->parent; @@ -91,11 +90,11 @@ gst_egl_image_memory_get_type (GstMemory * mem) return GST_EGL_IMAGE_MEMORY (mem)->type; } -GstEGLImageOrientation +GstVideoGLTextureOrientation gst_egl_image_memory_get_orientation (GstMemory * mem) { g_return_val_if_fail (gst_is_egl_image_memory (mem), - GST_EGL_IMAGE_ORIENTATION_X_NORMAL_Y_NORMAL); + GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL); if (mem->parent) mem = mem->parent; @@ -105,7 +104,7 @@ gst_egl_image_memory_get_orientation (GstMemory * mem) void gst_egl_image_memory_set_orientation (GstMemory * mem, - GstEGLImageOrientation orientation) + GstVideoGLTextureOrientation orientation) { g_return_if_fail (gst_is_egl_image_memory (mem)); @@ -253,7 +252,7 @@ gst_egl_image_allocator_obtain (void) GstMemory * gst_egl_image_allocator_alloc (GstAllocator * allocator, - GstEGLDisplay * display, GstEGLImageType type, gint width, gint height, + GstEGLDisplay * display, GstVideoGLTextureType type, gint width, gint height, gsize * size) { return NULL; @@ -261,7 +260,7 @@ gst_egl_image_allocator_alloc (GstAllocator * allocator, GstMemory * gst_egl_image_allocator_wrap (GstAllocator * allocator, - GstEGLDisplay * display, EGLImageKHR image, GstEGLImageType type, + GstEGLDisplay * display, EGLImageKHR image, GstVideoGLTextureType type, GstMemoryFlags flags, gsize size, gpointer user_data, GDestroyNotify user_data_destroy) { @@ -269,7 +268,6 @@ gst_egl_image_allocator_wrap (GstAllocator * allocator, g_return_val_if_fail (display != NULL, NULL); g_return_val_if_fail (image != EGL_NO_IMAGE_KHR, NULL); - g_return_val_if_fail (type != GST_EGL_IMAGE_MEMORY_TYPE_INVALID, NULL); if (!allocator) { allocator = gst_egl_image_allocator_obtain (); @@ -282,7 +280,7 @@ gst_egl_image_allocator_wrap (GstAllocator * allocator, mem->display = gst_egl_display_ref (display); mem->image = image; mem->type = type; - mem->orientation = GST_EGL_IMAGE_ORIENTATION_X_NORMAL_Y_NORMAL; + mem->orientation = GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL; mem->user_data = user_data; mem->user_data_destroy = user_data_destroy; diff --git a/gst-libs/gst/egl/egl.h b/gst-libs/gst/egl/egl.h index ce5da2d398..38670d5984 100644 --- a/gst-libs/gst/egl/egl.h +++ b/gst-libs/gst/egl/egl.h @@ -23,6 +23,7 @@ #define __GST_EGL_H__ #include +#include #include #include @@ -30,32 +31,6 @@ #define GST_CAPS_FEATURE_MEMORY_EGL_IMAGE "memory:EGLImage" -typedef enum -{ - GST_EGL_IMAGE_MEMORY_TYPE_INVALID = -1, - /* GL formats */ - GST_EGL_IMAGE_MEMORY_TYPE_LUMINANCE = 0x0000, - GST_EGL_IMAGE_MEMORY_TYPE_LUMINANCE_ALPHA, - GST_EGL_IMAGE_MEMORY_TYPE_RGB16, - GST_EGL_IMAGE_MEMORY_TYPE_RGB, - GST_EGL_IMAGE_MEMORY_TYPE_RGBA, - /* YUV formats */ - /* GST_EGL_IMAGE_MEMORY_TYPE_YUV420P = 0x1000, */ - /* Other */ - GST_EGL_IMAGE_MEMORY_TYPE_OTHER = 0xffff -} GstEGLImageType; - -typedef enum -{ - /* GStreamer orientation, top line first in memory, left row first */ - GST_EGL_IMAGE_ORIENTATION_X_NORMAL_Y_NORMAL, - /* OpenGL orientation, bottom line first in memory, left row first */ - GST_EGL_IMAGE_ORIENTATION_X_NORMAL_Y_FLIP, - /* Just for the sake of completeness, nothing uses this probably */ - GST_EGL_IMAGE_ORIENTATION_X_FLIP_Y_NORMAL, - GST_EGL_IMAGE_ORIENTATION_X_FLIP_Y_FLIP -} GstEGLImageOrientation; - typedef struct _GstEGLDisplay GstEGLDisplay; /* EGLImage GstMemory handling */ @@ -63,18 +38,18 @@ gboolean gst_egl_image_memory_is_mappable (void); gboolean gst_is_egl_image_memory (GstMemory * mem); EGLImageKHR gst_egl_image_memory_get_image (GstMemory * mem); GstEGLDisplay *gst_egl_image_memory_get_display (GstMemory * mem); -GstEGLImageType gst_egl_image_memory_get_type (GstMemory * mem); -GstEGLImageOrientation gst_egl_image_memory_get_orientation (GstMemory * mem); +GstVideoGLTextureType gst_egl_image_memory_get_type (GstMemory * mem); +GstVideoGLTextureOrientation gst_egl_image_memory_get_orientation (GstMemory * mem); void gst_egl_image_memory_set_orientation (GstMemory * mem, - GstEGLImageOrientation orientation); + GstVideoGLTextureOrientation orientation); /* Generic EGLImage allocator that doesn't support mapping, copying or anything */ GstAllocator *gst_egl_image_allocator_obtain (void); GstMemory *gst_egl_image_allocator_alloc (GstAllocator * allocator, - GstEGLDisplay * display, GstEGLImageType type, gint width, gint height, + GstEGLDisplay * display, GstVideoGLTextureType type, gint width, gint height, gsize * size); GstMemory *gst_egl_image_allocator_wrap (GstAllocator * allocator, - GstEGLDisplay * display, EGLImageKHR image, GstEGLImageType type, + GstEGLDisplay * display, EGLImageKHR image, GstVideoGLTextureType type, GstMemoryFlags flags, gsize size, gpointer user_data, GDestroyNotify user_data_destroy);