diff --git a/ext/gl/gltestsrc.c b/ext/gl/gltestsrc.c index ac845c68f0..f6faea3b6e 100644 --- a/ext/gl/gltestsrc.c +++ b/ext/gl/gltestsrc.c @@ -22,6 +22,8 @@ #include "config.h" #endif +#include + #include "gltestsrc.h" #define MAX_ATTRIBUTES 4 diff --git a/ext/gl/gstglcolorbalance.c b/ext/gl/gstglcolorbalance.c index 7a8a5b1f0d..81630469df 100644 --- a/ext/gl/gstglcolorbalance.c +++ b/ext/gl/gstglcolorbalance.c @@ -38,12 +38,12 @@ #include "config.h" #endif +#include +#include #include +#include #include "gstglcolorbalance.h" -#include - -#include GST_DEBUG_CATEGORY_STATIC (glcolorbalance_debug); #define GST_CAT_DEFAULT glcolorbalance_debug diff --git a/ext/gl/gstglcolorscale.c b/ext/gl/gstglcolorscale.c index 3042734993..88b71ef70e 100644 --- a/ext/gl/gstglcolorscale.c +++ b/ext/gl/gstglcolorscale.c @@ -47,7 +47,6 @@ #include "gstglcolorscale.h" - #define GST_CAT_DEFAULT gst_gl_colorscale_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c index 975128fcf5..3b26715dcd 100644 --- a/ext/gl/gstgldeinterlace.c +++ b/ext/gl/gstgldeinterlace.c @@ -36,6 +36,8 @@ #include "config.h" #endif +#include + #include "gstgldeinterlace.h" #define GST_CAT_DEFAULT gst_gl_deinterlace_debug diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c index c68bbbe465..e805770549 100644 --- a/ext/gl/gstgldifferencematte.c +++ b/ext/gl/gstgldifferencematte.c @@ -39,6 +39,8 @@ #include #include +#include + #include "gstgldifferencematte.h" #include "effects/gstgleffectssources.h" diff --git a/ext/gl/gstgleffects.c b/ext/gl/gstgleffects.c index 4377310d63..97a8dfe8ab 100644 --- a/ext/gl/gstgleffects.c +++ b/ext/gl/gstgleffects.c @@ -36,7 +36,6 @@ #include "config.h" #endif -#include #include "gstgleffects.h" #define GST_CAT_DEFAULT gst_gl_effects_debug diff --git a/ext/gl/gstgleffects.h b/ext/gl/gstgleffects.h index 151ab78111..a090e0d570 100644 --- a/ext/gl/gstgleffects.h +++ b/ext/gl/gstgleffects.h @@ -22,6 +22,8 @@ #define __GST_GL_EFFECTS_H__ #include +#include + #include "effects/gstgleffectssources.h" G_BEGIN_DECLS diff --git a/ext/gl/gstglfiltercube.h b/ext/gl/gstglfiltercube.h index ee25048bc0..2dcd6c5d5b 100644 --- a/ext/gl/gstglfiltercube.h +++ b/ext/gl/gstglfiltercube.h @@ -22,6 +22,7 @@ #define _GST_GL_FILTERCUBE_H_ #include +#include G_BEGIN_DECLS diff --git a/ext/gl/gstglfilterglass.c b/ext/gl/gstglfilterglass.c index 160543f3ea..31f63b5421 100644 --- a/ext/gl/gstglfilterglass.c +++ b/ext/gl/gstglfilterglass.c @@ -41,7 +41,10 @@ #endif #include +#include + #include "gstglfilterglass.h" + #include "gstglutils.h" #define GST_CAT_DEFAULT gst_gl_filter_glass_debug diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c index 06a619582e..df5040fea7 100644 --- a/ext/gl/gstglfiltershader.c +++ b/ext/gl/gstglfiltershader.c @@ -56,7 +56,7 @@ #include "config.h" #endif -#include +#include #include "gstglfiltershader.h" #if HAVE_GRAPHENE diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h index 8833103073..12166ecd4e 100644 --- a/ext/gl/gstglimagesink.h +++ b/ext/gl/gstglimagesink.h @@ -28,6 +28,7 @@ #include #include +#include G_BEGIN_DECLS diff --git a/ext/gl/gstglmixer.h b/ext/gl/gstglmixer.h index 309f6bbf0c..886e00940a 100644 --- a/ext/gl/gstglmixer.h +++ b/ext/gl/gstglmixer.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "gstglbasemixer.h" G_BEGIN_DECLS diff --git a/ext/gl/gstgloverlay.h b/ext/gl/gstgloverlay.h index 565aaaba40..dad01e4eb2 100644 --- a/ext/gl/gstgloverlay.h +++ b/ext/gl/gstgloverlay.h @@ -22,6 +22,7 @@ #define _GST_GL_OVERLAY_H_ #include +#include G_BEGIN_DECLS diff --git a/ext/gl/gstgltestsrc.c b/ext/gl/gstgltestsrc.c index 4c29e45e8c..0305413657 100644 --- a/ext/gl/gstgltestsrc.c +++ b/ext/gl/gstgltestsrc.c @@ -42,9 +42,11 @@ #include "config.h" #endif +#include +#include + #include "gstgltestsrc.h" #include "gltestsrc.h" -#include #define USE_PEER_BUFFERALLOC #define SUPPORTED_GL_APIS (GST_GL_API_OPENGL | GST_GL_API_OPENGL3 | GST_GL_API_GLES2) diff --git a/ext/gl/gstglutils.c b/ext/gl/gstglutils.c index ec18065c94..fdb7ad3305 100644 --- a/ext/gl/gstglutils.c +++ b/ext/gl/gstglutils.c @@ -22,7 +22,8 @@ #include "config.h" #endif -#include +#include + #include "gstglutils.h" struct _compile_shader diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index a5a094b67e..7180220ded 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -43,10 +43,12 @@ #include "config.h" #endif -#include #include +#include +#include #include "gstglvideomixer.h" + #include "gstglmixerbin.h" #include "gstglutils.h" diff --git a/ext/gl/gstglviewconvert.c b/ext/gl/gstglviewconvert.c index eafa084c1e..203df6b976 100644 --- a/ext/gl/gstglviewconvert.c +++ b/ext/gl/gstglviewconvert.c @@ -47,6 +47,7 @@ #endif #include + #include "gstglviewconvert.h" #define GST_CAT_DEFAULT gst_gl_view_convert_element_debug diff --git a/ext/gl/gstglviewconvert.h b/ext/gl/gstglviewconvert.h index 1403d27a12..5ccc58f619 100644 --- a/ext/gl/gstglviewconvert.h +++ b/ext/gl/gstglviewconvert.h @@ -22,7 +22,7 @@ #ifndef _GST_GL_VIEW_CONVERT_ELEMENT_H_ #define _GST_GL_VIEW_CONVERT_ELEMENT_H_ -#include +#include G_BEGIN_DECLS #define GST_TYPE_GL_VIEW_CONVERT_ELEMENT (gst_gl_view_convert_element_get_type()) diff --git a/ext/gtk/Makefile.am b/ext/gtk/Makefile.am index 7736b24ef2..34906257f4 100644 --- a/ext/gtk/Makefile.am +++ b/ext/gtk/Makefile.am @@ -27,7 +27,8 @@ libgstgtk_la_CFLAGS = \ $(GTK3_CFLAGS) \ $(GST_CFLAGS) \ $(GST_BASE_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GL_CFLAGS) libgstgtk_la_LIBADD = \ $(GTK3_LIBS) \ $(GST_BASE_LIBS) \ diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c index 56326882a9..39b54faf86 100644 --- a/ext/gtk/gstgtkglsink.c +++ b/ext/gtk/gstgtkglsink.c @@ -27,6 +27,8 @@ #include "config.h" #endif +#include + #include "gstgtkglsink.h" #include "gtkgstglwidget.h" diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c index ea0fe2f8ab..2423afca00 100644 --- a/ext/gtk/gtkgstglwidget.c +++ b/ext/gtk/gtkgstglwidget.c @@ -26,6 +26,7 @@ #include "gtkgstglwidget.h" #include "gstgtkutils.h" +#include #include #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (GDK_WINDOWING_X11) diff --git a/gst-libs/gst/gl/egl/gsteglimage.c b/gst-libs/gst/gl/egl/gsteglimage.c index f5707189a0..92b3862b14 100644 --- a/gst-libs/gst/gl/egl/gsteglimage.c +++ b/gst-libs/gst/gl/egl/gsteglimage.c @@ -39,9 +39,16 @@ #endif #include "gsteglimage.h" -#include + #include +#include +#include + +#include "gst/gl/egl/gstegl.h" +#include "gst/gl/egl/gstglcontext_egl.h" +#include "gst/gl/egl/gstgldisplay_egl.h" + #if GST_GL_HAVE_DMABUF #include #include @@ -107,7 +114,7 @@ gst_egl_image_ensure_debug_category (void) * * Returns: the #EGLImageKHR of @image */ -EGLImageKHR +gpointer gst_egl_image_get_image (GstEGLImage * image) { g_return_val_if_fail (GST_IS_EGL_IMAGE (image), EGL_NO_IMAGE_KHR); @@ -151,7 +158,7 @@ _gst_egl_image_copy (GstMiniObject * obj) * Returns: a new #GstEGLImage wrapping @image */ GstEGLImage * -gst_egl_image_new_wrapped (GstGLContext * context, EGLImageKHR image, +gst_egl_image_new_wrapped (GstGLContext * context, gpointer image, GstGLFormat format, gpointer user_data, GstEGLImageDestroyNotify user_data_destroy) { diff --git a/gst-libs/gst/gl/egl/gsteglimage.h b/gst-libs/gst/gl/egl/gsteglimage.h index 9a0e848064..cfd8f008aa 100644 --- a/gst-libs/gst/gl/egl/gsteglimage.h +++ b/gst-libs/gst/gl/egl/gsteglimage.h @@ -23,11 +23,8 @@ #ifndef _GST_EGL_IMAGE_H_ #define _GST_EGL_IMAGE_H_ -#include -#include - -#include -#include +#include +#include G_BEGIN_DECLS @@ -61,7 +58,7 @@ struct _GstEGLImage GstMiniObject parent; GstGLContext *context; - EGLImageKHR image; + gpointer image; GstGLFormat format; /* */ @@ -73,12 +70,12 @@ struct _GstEGLImage GST_EXPORT GstEGLImage * gst_egl_image_new_wrapped (GstGLContext * context, - EGLImageKHR image, + gpointer image, GstGLFormat format, gpointer user_data, GstEGLImageDestroyNotify user_data_destroy); GST_EXPORT -EGLImageKHR gst_egl_image_get_image (GstEGLImage * image); +gpointer gst_egl_image_get_image (GstEGLImage * image); GST_EXPORT GstEGLImage * gst_egl_image_from_texture (GstGLContext * context, diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index ddac4c4833..926050c382 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -29,10 +29,13 @@ */ #include "gstglcontext_egl.h" -#include + +#include +#include + +#include "gstegl.h" #include "../utils/opengl_versions.h" #include "../utils/gles_versions.h" -#include "../gstglcontext_private.h" #if GST_GL_HAVE_WINDOW_X11 #include "../x11/gstglwindow_x11.h" @@ -281,7 +284,7 @@ gst_gl_context_egl_create_context (GstGLContext * context, { GstGLContextEGL *egl; GstGLWindow *window = NULL; - EGLNativeWindowType window_handle = (EGLNativeWindowType) 0; + guintptr window_handle = 0; EGLint egl_major; EGLint egl_minor; gboolean need_surface = TRUE; @@ -520,15 +523,14 @@ gst_gl_context_egl_create_context (GstGLContext * context, } if (window) - window_handle = - (EGLNativeWindowType) gst_gl_window_get_window_handle (window); + window_handle = gst_gl_window_get_window_handle (window); if (window_handle) { GST_DEBUG ("Creating EGLSurface from window_handle %p", (void *) window_handle); egl->egl_surface = eglCreateWindowSurface (egl->egl_display, egl->egl_config, - window_handle, NULL); + (EGLNativeWindowType) window_handle, NULL); /* Store window handle for later comparision */ egl->window_handle = window_handle; } else if (!gst_gl_check_extension ("EGL_KHR_surfaceless_context", @@ -619,10 +621,10 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate) if (activate) { GstGLWindow *window = gst_gl_context_get_window (context); - EGLNativeWindowType handle = 0; + guintptr handle = 0; /* Check if the backing handle changed */ if (window) { - handle = (EGLNativeWindowType) gst_gl_window_get_window_handle (window); + handle = gst_gl_window_get_window_handle (window); gst_object_unref (window); } if (handle && handle != egl->window_handle) { @@ -639,8 +641,8 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate) } } egl->egl_surface = - eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle, - NULL); + eglCreateWindowSurface (egl->egl_display, egl->egl_config, + (EGLNativeWindowType) handle, NULL); egl->window_handle = handle; if (egl->egl_surface == EGL_NO_SURFACE) { diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.h b/gst-libs/gst/gl/egl/gstglcontext_egl.h index 40adc99788..67947a8852 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.h +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.h @@ -21,10 +21,7 @@ #ifndef __GST_GL_EGL_H__ #define __GST_GL_EGL_H__ -#include -#include -#include - +#include #include G_BEGIN_DECLS @@ -57,10 +54,10 @@ struct _GstGLContextEGL GstGLDisplayEGL *display_egl; - EGLContext egl_context; - EGLDisplay egl_display; - EGLSurface egl_surface; - EGLConfig egl_config; + gpointer egl_context; + gpointer egl_display; + gpointer egl_surface; + gpointer egl_config; gint egl_major; gint egl_minor; @@ -70,7 +67,7 @@ struct _GstGLContextEGL const gchar *egl_exts; /* Cached handle */ - EGLNativeWindowType window_handle; + guintptr window_handle; }; /** diff --git a/gst-libs/gst/gl/egl/gstgldisplay_egl.c b/gst-libs/gst/gl/egl/gstgldisplay_egl.c index a2dc98a8e4..83b7b41bd9 100644 --- a/gst-libs/gst/gl/egl/gstgldisplay_egl.c +++ b/gst-libs/gst/gl/egl/gstgldisplay_egl.c @@ -22,9 +22,13 @@ #include "config.h" #endif -#include -#include -#include +#include "gstgldisplay_egl.h" + +#include + +#include "gstegl.h" +#include "gsteglimage.h" +#include "gstglmemoryegl.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug); #define GST_CAT_DEFAULT gst_gl_display_debug @@ -92,7 +96,7 @@ gst_gl_display_egl_finalize (GObject * object) * * Since: 1.12 */ -EGLDisplay +gpointer gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display) { const gchar *egl_exts; @@ -107,7 +111,7 @@ gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display) /* given an EGLDisplay already */ if (type == GST_GL_DISPLAY_TYPE_EGL) - return (EGLDisplay) display; + return (gpointer) display; if (type == GST_GL_DISPLAY_TYPE_NONE) type = GST_GL_DISPLAY_TYPE_ANY; @@ -158,7 +162,7 @@ gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display) /* otherwise rely on the implementation to choose the correct display * based on the pointer */ default_display: - return eglGetDisplay ((EGLNativeDisplayType) display); + return (gpointer) eglGetDisplay ((EGLNativeDisplayType) display); } /** @@ -198,7 +202,7 @@ gst_gl_display_egl_new (void) * Since: 1.12 */ GstGLDisplayEGL * -gst_gl_display_egl_new_with_egl_display (EGLDisplay display) +gst_gl_display_egl_new_with_egl_display (gpointer display) { GstGLDisplayEGL *ret; diff --git a/gst-libs/gst/gl/egl/gstgldisplay_egl.h b/gst-libs/gst/gl/egl/gstgldisplay_egl.h index 1ee1c4939f..319a047243 100644 --- a/gst-libs/gst/gl/egl/gstgldisplay_egl.h +++ b/gst-libs/gst/gl/egl/gstgldisplay_egl.h @@ -21,9 +21,7 @@ #ifndef __GST_GL_DISPLAY_EGL_H__ #define __GST_GL_DISPLAY_EGL_H__ -#include #include -#include G_BEGIN_DECLS @@ -51,7 +49,7 @@ struct _GstGLDisplayEGL GstGLDisplay parent; /* */ - EGLDisplay display; + gpointer display; gboolean foreign_display; @@ -69,13 +67,13 @@ GST_EXPORT GstGLDisplayEGL *gst_gl_display_egl_new (void); GST_EXPORT -GstGLDisplayEGL *gst_gl_display_egl_new_with_egl_display (EGLDisplay display); +GstGLDisplayEGL *gst_gl_display_egl_new_with_egl_display (gpointer display); GST_EXPORT GstGLDisplayEGL *gst_gl_display_egl_from_gl_display (GstGLDisplay * display); GST_EXPORT -EGLDisplay gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display); +gpointer gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display); #define GST_GL_DISPLAY_EGL_NAME "gst.gl.display.egl" diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.c b/gst-libs/gst/gl/egl/gstglmemoryegl.c index 32c4223c2a..1f461149de 100644 --- a/gst-libs/gst/gl/egl/gstglmemoryegl.c +++ b/gst-libs/gst/gl/egl/gstglmemoryegl.c @@ -37,8 +37,13 @@ #include -#include -#include +#include "gstglmemoryegl.h" + +#include + +#include "gstegl.h" +#include "gsteglimage.h" +#include "gstglcontext_egl.h" static GstAllocator *_gl_memory_egl_allocator; @@ -80,7 +85,7 @@ _gl_mem_get_parent (GstGLMemoryEGL * gl_mem) * * Since: 1.10 */ -EGLImageKHR +gpointer gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem) { g_return_val_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)), @@ -96,7 +101,7 @@ gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem) * * Since: 1.10 */ -EGLDisplay +gpointer gst_gl_memory_egl_get_display (GstGLMemoryEGL * mem) { g_return_val_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)), NULL); diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.h b/gst-libs/gst/gl/egl/gstglmemoryegl.h index ac7ca78418..098e7cf0da 100644 --- a/gst-libs/gst/gl/egl/gstglmemoryegl.h +++ b/gst-libs/gst/gl/egl/gstglmemoryegl.h @@ -23,15 +23,9 @@ #ifndef _GST_GL_MEMORY_EGL_H_ #define _GST_GL_MEMORY_EGL_H_ -#include -#include -#include -#include - -#include -#include - #include +#include +#include G_BEGIN_DECLS @@ -74,10 +68,10 @@ GST_EXPORT gboolean gst_is_gl_memory_egl (GstMemory * mem); GST_EXPORT -EGLImageKHR gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem); +gpointer gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem); GST_EXPORT -EGLDisplay gst_gl_memory_egl_get_display (GstGLMemoryEGL * mem); +gpointer gst_gl_memory_egl_get_display (GstGLMemoryEGL * mem); /** * GstGLMemoryEGLAllocator diff --git a/gst-libs/gst/gl/gl.h b/gst-libs/gst/gl/gl.h index 036c8d8d62..33d1f35784 100644 --- a/gst-libs/gst/gl/gl.h +++ b/gst-libs/gst/gl/gl.h @@ -27,11 +27,11 @@ #endif #include -#include #include -#include +#include #include #include +#include #include #include #include diff --git a/gst-libs/gst/gl/gstgl_fwd.h b/gst-libs/gst/gl/gstgl_fwd.h index 8f42e8de85..19ca6f3586 100644 --- a/gst-libs/gst/gl/gstgl_fwd.h +++ b/gst-libs/gst/gl/gstgl_fwd.h @@ -102,6 +102,10 @@ typedef struct _GstGLOverlayCompositorClass GstGLOverlayCompositorClass; typedef struct _GstGLQuery GstGLQuery; +typedef struct _GstGLFuncs GstGLFuncs; + +typedef struct _GstGLAsyncDebug GstGLAsyncDebug; + #include #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h index 4196e839e2..1622d90957 100644 --- a/gst-libs/gst/gl/gstglapi.h +++ b/gst-libs/gst/gl/gstglapi.h @@ -23,66 +23,6 @@ #include -/* This mimic GCC behaviour with system headers files even if GL headers may - * not be in the system header path. */ -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wredundant-decls" -#endif - -/* OpenGL 2.0 for Embedded Systems */ -#if GST_GL_HAVE_GLES2 -# if GST_GL_HAVE_PLATFORM_EAGL -# include -# include -# else -# if GST_GL_HAVE_GLES3 -# include -# if GST_GL_HAVE_GLES3EXT3_H -# include -# endif -# include -# else -# include -# include -# endif -# endif -# if !GST_GL_HAVE_OPENGL -# include -# endif -#endif - -/* OpenGL for desktop systems */ -#if GST_GL_HAVE_OPENGL -# ifdef __APPLE__ -# include -# include -# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED -# include -# endif -# else -# if defined(_MSC_VER) -# include -# endif -# include -# if defined(__WIN32__) || defined(_WIN32) -# include -# endif -# endif -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - -#if defined(WINAPI) -#define GSTGLAPI WINAPI -#else -#define GSTGLAPI -#endif -#include - #include G_BEGIN_DECLS @@ -158,22 +98,6 @@ typedef enum GST_GL_PLATFORM_ANY = G_MAXUINT32 } GstGLPlatform; -#define GST_GL_EXT_BEGIN(name, gl_availability, min_gl, maj_gl, gles_maj, \ - gles_min, ext_suf, ext_name) -#define GST_GL_EXT_FUNCTION(ret, name, args) \ - ret (GSTGLAPI *name) args; -#define GST_GL_EXT_END() - -typedef struct _GstGLFuncs -{ -#include - gpointer padding[GST_PADDING_LARGE*6]; -} GstGLFuncs; - -#undef GST_GL_EXT_BEGIN -#undef GST_GL_EXT_FUNCTION -#undef GST_GL_EXT_END - GST_EXPORT gchar * gst_gl_api_to_string (GstGLAPI api); GST_EXPORT diff --git a/gst-libs/gst/gl/gstglbasefilter.h b/gst-libs/gst/gl/gstglbasefilter.h index aa5b946939..fa4958d891 100644 --- a/gst-libs/gst/gl/gstglbasefilter.h +++ b/gst-libs/gst/gl/gstglbasefilter.h @@ -23,11 +23,9 @@ #ifndef _GST_GL_BASE_FILTER_H_ #define _GST_GL_BASE_FILTER_H_ -#include #include -#include -#include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglbasememory.c b/gst-libs/gst/gl/gstglbasememory.c index d7bd88cb12..4bebedc372 100644 --- a/gst-libs/gst/gl/gstglbasememory.c +++ b/gst-libs/gst/gl/gstglbasememory.c @@ -24,7 +24,10 @@ #include -#include +#include "gstglbasememory.h" + +#include "gstglcontext.h" +#include "gstglquery.h" /** * SECTION:gstglbasememory diff --git a/gst-libs/gst/gl/gstglbasememory.h b/gst-libs/gst/gl/gstglbasememory.h index 302334d2a6..175fbf6101 100644 --- a/gst-libs/gst/gl/gstglbasememory.h +++ b/gst-libs/gst/gl/gstglbasememory.h @@ -375,7 +375,8 @@ struct _GstGLBaseMemoryAllocatorClass gpointer _padding[GST_PADDING]; }; -#include +#include +#include /** * GST_GL_BASE_MEMORY_ALLOCATOR_NAME: diff --git a/gst-libs/gst/gl/gstglbuffer.c b/gst-libs/gst/gl/gstglbuffer.c index 140f83cac1..5a45007571 100644 --- a/gst-libs/gst/gl/gstglbuffer.c +++ b/gst-libs/gst/gl/gstglbuffer.c @@ -25,6 +25,9 @@ #include #include "gstglbuffer.h" + +#include "gstglcontext.h" +#include "gstglfuncs.h" #include "gstglutils.h" /** diff --git a/gst-libs/gst/gl/gstglbuffer.h b/gst-libs/gst/gl/gstglbuffer.h index 90f8eb2607..52a6576fdf 100644 --- a/gst-libs/gst/gl/gstglbuffer.h +++ b/gst-libs/gst/gl/gstglbuffer.h @@ -21,10 +21,6 @@ #ifndef _GST_GL_BUFFER_H_ #define _GST_GL_BUFFER_H_ -#include -#include -#include - #include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c index fc9522b826..309bc367b6 100644 --- a/gst-libs/gst/gl/gstglbufferpool.c +++ b/gst-libs/gst/gl/gstglbufferpool.c @@ -22,8 +22,10 @@ #include "config.h" #endif -#include "gl.h" #include "gstglbufferpool.h" + +#include "gstglmemory.h" +#include "gstglsyncmeta.h" #include "gstglutils.h" /** diff --git a/gst-libs/gst/gl/gstglbufferpool.h b/gst-libs/gst/gl/gstglbufferpool.h index bfe5371c7e..0921464d50 100644 --- a/gst-libs/gst/gl/gstglbufferpool.h +++ b/gst-libs/gst/gl/gstglbufferpool.h @@ -21,11 +21,10 @@ #ifndef _GST_GL_BUFFER_POOL_H_ #define _GST_GL_BUFFER_POOL_H_ -#include #include #include -#include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index 6644759ecd..6bd919754b 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -25,8 +25,10 @@ #include #include -#include "gl.h" #include "gstglcolorconvert.h" + +#include "gl.h" +#include "gstglfuncs.h" #include "gstglsl_private.h" /** diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 01c03c11a2..0d7a5326c4 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -40,14 +40,16 @@ #define _GNU_SOURCE #endif +#include "gstglcontext.h" + #include #include #include -#include "gl.h" -#include "gstglcontext.h" #include "gstglcontext_private.h" +#include "gstglfeature.h" #include "gstglfeature_private.h" +#include "gstglfuncs.h" #ifndef GL_NUM_EXTENSIONS #define GL_NUM_EXTENSIONS 0x0000821d diff --git a/gst-libs/gst/gl/gstglcontext.h b/gst-libs/gst/gl/gstglcontext.h index 7cdc95764a..54383c56e1 100644 --- a/gst-libs/gst/gl/gstglcontext.h +++ b/gst-libs/gst/gl/gstglcontext.h @@ -23,7 +23,7 @@ #include -#include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstgldebug.c b/gst-libs/gst/gl/gstgldebug.c index 2b738cc3e7..6f8eb4aa83 100644 --- a/gst-libs/gst/gl/gstgldebug.c +++ b/gst-libs/gst/gl/gstgldebug.c @@ -22,12 +22,15 @@ #include "config.h" #endif -#include "gl.h" #include "gstgldebug.h" -#include "gstglcontext_private.h" + #include #include +#include "gstglcontext.h" +#include "gstglcontext_private.h" +#include "gstglfuncs.h" + /** * SECTION:gstgldebug * @short_description: helper routines for dealing with OpenGL debugging diff --git a/gst-libs/gst/gl/gstgldebug.h b/gst-libs/gst/gl/gstgldebug.h index 36ba3a68dd..503115544e 100644 --- a/gst-libs/gst/gl/gstgldebug.h +++ b/gst-libs/gst/gl/gstgldebug.h @@ -21,7 +21,7 @@ #ifndef __GST_GL_DEBUG_H__ #define __GST_GL_DEBUG_H__ -#include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 95ae8d648d..7e8fe68a7b 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -24,8 +24,6 @@ #ifndef __GST_GL_DISPLAY_H__ #define __GST_GL_DISPLAY_H__ -#include - #include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglfeature.c b/gst-libs/gst/gl/gstglfeature.c index 56fd0fecca..a1cadc2773 100644 --- a/gst-libs/gst/gl/gstglfeature.c +++ b/gst-libs/gst/gl/gstglfeature.c @@ -24,9 +24,11 @@ #include -#include "gl.h" #include "gstglfeature.h" + +#include "gstglcontext.h" #include "gstglfeature_private.h" +#include "gstglfuncs.h" #define GST_CAT_DEFAULT gl_feature GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 77b3e999da..9f03b50447 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -38,6 +38,8 @@ #include "gstglfilter.h" +#include "gstglfuncs.h" + #define GST_CAT_DEFAULT gst_gl_filter_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); diff --git a/gst-libs/gst/gl/gstglfilter.h b/gst-libs/gst/gl/gstglfilter.h index 9dbb5378ff..fc1928b9d8 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -79,11 +79,11 @@ struct _GstGLFilter GstGLShader *default_shader; gboolean valid_attributes; - GLuint vao; - GLuint vbo_indices; - GLuint vertex_buffer; - GLint draw_attr_position_loc; - GLint draw_attr_texture_loc; + guint vao; + guint vbo_indices; + guint vertex_buffer; + gint draw_attr_position_loc; + gint draw_attr_texture_loc; gpointer _padding[GST_PADDING]; }; diff --git a/gst-libs/gst/gl/gstglformat.c b/gst-libs/gst/gl/gstglformat.c index fd1d6b89c6..8427be43fd 100644 --- a/gst-libs/gst/gl/gstglformat.c +++ b/gst-libs/gst/gl/gstglformat.c @@ -32,8 +32,10 @@ #include "config.h" #endif -#include -#include +#include "gstglformat.h" + +#include "gstglcontext.h" +#include "gstglfuncs.h" #define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0)) #define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1)) diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c index 2e1c3bc859..b1d64b288c 100644 --- a/gst-libs/gst/gl/gstglframebuffer.c +++ b/gst-libs/gst/gl/gstglframebuffer.c @@ -42,9 +42,13 @@ #include "config.h" #endif -#include "gl.h" #include "gstglframebuffer.h" +#include "gstglcontext.h" +#include "gstglfuncs.h" +#include "gstglmemory.h" +#include "gstglrenderbuffer.h" + #ifndef GL_FRAMEBUFFER_UNDEFINED #define GL_FRAMEBUFFER_UNDEFINED 0x8219 #endif @@ -518,7 +522,7 @@ gst_gl_framebuffer_get_effective_dimensions (GstGLFramebuffer * fb, */ gboolean gst_gl_context_check_framebuffer_status (GstGLContext * context, - GLenum fbo_target) + guint fbo_target) { g_return_val_if_fail (GST_IS_GL_CONTEXT (context), FALSE); diff --git a/gst-libs/gst/gl/gstglframebuffer.h b/gst-libs/gst/gl/gstglframebuffer.h index 172f999fa0..aaf60ec8af 100644 --- a/gst-libs/gst/gl/gstglframebuffer.h +++ b/gst-libs/gst/gl/gstglframebuffer.h @@ -104,7 +104,7 @@ void gst_gl_framebuffer_get_effective_dimensions (GstGLFrameb GST_EXPORT gboolean gst_gl_context_check_framebuffer_status (GstGLContext * context, - GLenum fbo_target); + guint fbo_target); GST_EXPORT gboolean gst_gl_framebuffer_draw_to_texture (GstGLFramebuffer * fb, diff --git a/gst-libs/gst/gl/gstglfuncs.h b/gst-libs/gst/gl/gstglfuncs.h new file mode 100644 index 0000000000..805abcf3df --- /dev/null +++ b/gst-libs/gst/gl/gstglfuncs.h @@ -0,0 +1,108 @@ +/* + * GStreamer + * Copyright (C) 2012 Matthew Waters + * + * 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 __GST_GL_FUNCS_H__ +#define __GST_GL_FUNCS_H__ + +#include + +/* This mimic GCC behaviour with system headers files even if GL headers may + * not be in the system header path. */ +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wredundant-decls" +#endif + +/* OpenGL 2.0 for Embedded Systems */ +#if GST_GL_HAVE_GLES2 +# if GST_GL_HAVE_PLATFORM_EAGL +# include +# include +# else +# if GST_GL_HAVE_GLES3 +# include +# if GST_GL_HAVE_GLES3EXT3_H +# include +# endif +# include +# else +# include +# include +# endif +# endif +# if !GST_GL_HAVE_OPENGL +# include +# endif +#endif + +/* OpenGL for desktop systems */ +#if GST_GL_HAVE_OPENGL +# ifdef __APPLE__ +# include +# include +# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED +# include +# endif +# else +# if defined(_MSC_VER) +# include +# endif +# include +# if defined(__WIN32__) || defined(_WIN32) +# include +# endif +# endif +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +#if defined(WINAPI) +#define GSTGLAPI WINAPI +#else +#define GSTGLAPI +#endif +#include + +#include + +G_BEGIN_DECLS + +#define GST_GL_EXT_BEGIN(name, gl_availability, min_gl, maj_gl, gles_maj, \ + gles_min, ext_suf, ext_name) +#define GST_GL_EXT_FUNCTION(ret, name, args) \ + ret (GSTGLAPI *name) args; +#define GST_GL_EXT_END() + +typedef struct _GstGLFuncs +{ +#include + gpointer padding[GST_PADDING_LARGE*6]; +} GstGLFuncs; + +#undef GST_GL_EXT_BEGIN +#undef GST_GL_EXT_FUNCTION +#undef GST_GL_EXT_END + +G_END_DECLS + +#endif /* __GST_GL_API_H__ */ diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index aba40ef1ed..a4a137233b 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -24,10 +24,10 @@ #include -#include +#include "gstglmemory.h" -#include -#include +#include "gl.h" +#include "gstglfuncs.h" /** * SECTION:gstglmemory diff --git a/gst-libs/gst/gl/gstglmemory.h b/gst-libs/gst/gl/gstglmemory.h index 3a4bf9f9c4..e7721a79ff 100644 --- a/gst-libs/gst/gl/gstglmemory.h +++ b/gst-libs/gst/gl/gstglmemory.h @@ -21,12 +21,8 @@ #ifndef _GST_GL_MEMORY_H_ #define _GST_GL_MEMORY_H_ -#include -#include -#include -#include - #include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglmemorypbo.c b/gst-libs/gst/gl/gstglmemorypbo.c index 89091c80b1..4a62a383c0 100644 --- a/gst-libs/gst/gl/gstglmemorypbo.c +++ b/gst-libs/gst/gl/gstglmemorypbo.c @@ -25,9 +25,12 @@ #include -#include +#include "gstglmemorypbo.h" -#include +#include "gstglbuffer.h" +#include "gstglcontext.h" +#include "gstglfuncs.h" +#include "gstglutils.h" /** * SECTION:gstglmemorypbo diff --git a/gst-libs/gst/gl/gstglmemorypbo.h b/gst-libs/gst/gl/gstglmemorypbo.h index 77eff7b954..c57bf17344 100644 --- a/gst-libs/gst/gl/gstglmemorypbo.h +++ b/gst-libs/gst/gl/gstglmemorypbo.h @@ -22,11 +22,6 @@ #ifndef _GST_GL_MEMORY_PBO_H_ #define _GST_GL_MEMORY_PBO_H_ -#include -#include -#include -#include - #include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstgloverlaycompositor.c b/gst-libs/gst/gl/gstgloverlaycompositor.c index 2572110978..05575aa8b5 100644 --- a/gst-libs/gst/gl/gstgloverlaycompositor.c +++ b/gst-libs/gst/gl/gstgloverlaycompositor.c @@ -31,9 +31,14 @@ #include -#include "gl.h" #include "gstgloverlaycompositor.h" +#include "gstglcontext.h" +#include "gstglfuncs.h" +#include "gstglmemory.h" +#include "gstglshader.h" +#include "gstglslstage.h" + GST_DEBUG_CATEGORY_STATIC (gst_gl_overlay_compositor_debug); #define GST_CAT_DEFAULT gst_gl_overlay_compositor_debug diff --git a/gst-libs/gst/gl/gstgloverlaycompositor.h b/gst-libs/gst/gl/gstgloverlaycompositor.h index 0f4f1b2829..3bc24620d3 100644 --- a/gst-libs/gst/gl/gstgloverlaycompositor.h +++ b/gst-libs/gst/gl/gstgloverlaycompositor.h @@ -54,8 +54,8 @@ struct _GstGLOverlayCompositor GList * overlays; GstGLShader *shader; - GLint position_attrib; - GLint texcoord_attrib; + gint position_attrib; + gint texcoord_attrib; gpointer _padding[GST_PADDING]; }; diff --git a/gst-libs/gst/gl/gstglquery.c b/gst-libs/gst/gl/gstglquery.c index 0cf0f75add..faceebf5f4 100644 --- a/gst-libs/gst/gl/gstglquery.c +++ b/gst-libs/gst/gl/gstglquery.c @@ -34,12 +34,13 @@ #include "config.h" #endif -#include - #include #include "gstglquery.h" +#include "gstglcontext.h" +#include "gstglfuncs.h" + #ifndef GL_TIME_ELAPSED #define GL_TIME_ELAPSED 0x88BF #endif diff --git a/gst-libs/gst/gl/gstglquery.h b/gst-libs/gst/gl/gstglquery.h index 0b057421fd..48634b8091 100644 --- a/gst-libs/gst/gl/gstglquery.h +++ b/gst-libs/gst/gl/gstglquery.h @@ -22,6 +22,7 @@ #define __GST_GL_QUERY_H__ #include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglrenderbuffer.c b/gst-libs/gst/gl/gstglrenderbuffer.c index 9a3c0c69e8..4399c7ef87 100644 --- a/gst-libs/gst/gl/gstglrenderbuffer.c +++ b/gst-libs/gst/gl/gstglrenderbuffer.c @@ -24,10 +24,11 @@ #include -#include +#include "gstglrenderbuffer.h" -#include -#include +#include "gstglcontext.h" +#include "gstglfuncs.h" +#include "gstglmemory.h" /** * SECTION:gstglrenderbuffer diff --git a/gst-libs/gst/gl/gstglrenderbuffer.h b/gst-libs/gst/gl/gstglrenderbuffer.h index 9b47e6796f..598f0ab9cf 100644 --- a/gst-libs/gst/gl/gstglrenderbuffer.h +++ b/gst-libs/gst/gl/gstglrenderbuffer.h @@ -21,10 +21,6 @@ #ifndef _GST_GL_RENDERBUFFER_H_ #define _GST_GL_RENDERBUFFER_H_ -#include -#include -#include - #include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglshaderstrings.h b/gst-libs/gst/gl/gstglshaderstrings.h index 0e56471c33..48ea20085c 100644 --- a/gst-libs/gst/gl/gstglshaderstrings.h +++ b/gst-libs/gst/gl/gstglshaderstrings.h @@ -21,7 +21,7 @@ #ifndef __GST_GL_SHADER_STRINGS_H__ #define __GST_GL_SHADER_STRINGS_H__ -#include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglsl_private.h b/gst-libs/gst/gl/gstglsl_private.h index 08addeb8cc..992c417528 100644 --- a/gst-libs/gst/gl/gstglsl_private.h +++ b/gst-libs/gst/gl/gstglsl_private.h @@ -22,6 +22,7 @@ #define __GST_GLSL_PRIVATE_H__ #include +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglslstage.c b/gst-libs/gst/gl/gstglslstage.c index d40a88b7e7..0205f384f7 100644 --- a/gst-libs/gst/gl/gstglslstage.c +++ b/gst-libs/gst/gl/gstglslstage.c @@ -22,9 +22,10 @@ #include "config.h" #endif -#include - #include "gstglslstage.h" + +#include "gl.h" +#include "gstglfuncs.h" #include "gstglsl_private.h" #ifndef GL_GEOMETRY_SHADER diff --git a/gst-libs/gst/gl/gstglsyncmeta.c b/gst-libs/gst/gl/gstglsyncmeta.c index bd9131d931..d74b3cd461 100644 --- a/gst-libs/gst/gl/gstglsyncmeta.c +++ b/gst-libs/gst/gl/gstglsyncmeta.c @@ -32,9 +32,11 @@ #include "config.h" #endif -#include "gl.h" #include "gstglsyncmeta.h" +#include "gstglcontext.h" +#include "gstglfuncs.h" + GST_DEBUG_CATEGORY_STATIC (gst_gl_sync_meta_debug); #define GST_CAT_DEFAULT gst_gl_sync_meta_debug diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 1bdbfb1173..feaf2f68e0 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -29,6 +29,7 @@ #include "gstglupload.h" #if GST_GL_HAVE_PLATFORM_EGL +#include "egl/gsteglimage.h" #include "egl/gstglmemoryegl.h" #include "egl/gstglcontext_egl.h" #endif diff --git a/gst-libs/gst/gl/gstglviewconvert.c b/gst-libs/gst/gl/gstglviewconvert.c index 53475a7443..755f1b9979 100644 --- a/gst-libs/gst/gl/gstglviewconvert.c +++ b/gst-libs/gst/gl/gstglviewconvert.c @@ -34,10 +34,19 @@ #endif #include "gstglviewconvert.h" -#include "gstglsl_private.h" -#include "gstglutils_private.h" + #include +#include "gstglcontext.h" +#include "gstglframebuffer.h" +#include "gstglmemory.h" +#include "gstglshader.h" +#include "gstglshaderstrings.h" +#include "gstglsl.h" +#include "gstglsl_private.h" +#include "gstglslstage.h" +#include "gstglutils_private.h" + #define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0)) #define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1)) #define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0)) diff --git a/gst-libs/gst/gl/gstglviewconvert.h b/gst-libs/gst/gl/gstglviewconvert.h index d418ca90e0..3cad3adebd 100644 --- a/gst-libs/gst/gl/gstglviewconvert.h +++ b/gst-libs/gst/gl/gstglviewconvert.h @@ -22,7 +22,10 @@ #ifndef _GST_GL_VIEW_CONVERT_H_ #define _GST_GL_VIEW_CONVERT_H_ -#include +#include +#include + +#include G_BEGIN_DECLS #define GST_TYPE_GL_VIEW_CONVERT (gst_gl_view_convert_get_type()) diff --git a/gst-libs/gst/gl/x11/gstgldisplay_x11.h b/gst-libs/gst/gl/x11/gstgldisplay_x11.h index d96a6697fd..3ffe251bb7 100644 --- a/gst-libs/gst/gl/x11/gstgldisplay_x11.h +++ b/gst-libs/gst/gl/x11/gstgldisplay_x11.h @@ -25,7 +25,6 @@ #include -#include #include G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.h b/gst-libs/gst/gl/x11/gstglwindow_x11.h index e612ff1907..ba6fd16bdc 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.h +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.h @@ -24,7 +24,10 @@ #include #include -#include +#include + +#include +#include G_BEGIN_DECLS diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 39cd047e48..5e34c8424b 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -211,6 +211,7 @@ check_gl=libs/gstglcontext \ libs/gstglcolorconvert \ libs/gstglquery \ libs/gstglsl \ + libs/gstglheaders \ elements/glimagesink \ pipelines/simple-launch-lines else @@ -555,7 +556,7 @@ libs_gstglcontext_LDADD = \ libs_gstglcontext_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) libs_gstglmemory_LDADD = \ $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ @@ -565,12 +566,12 @@ libs_gstglmemory_LDADD = \ libs_gstglmemory_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) libs_gstglupload_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) libs_gstglupload_LDADD = \ $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ @@ -580,7 +581,7 @@ libs_gstglupload_LDADD = \ libs_gstglcolorconvert_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) libs_gstglcolorconvert_LDADD = \ $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ @@ -594,7 +595,7 @@ libs_gstglquery_LDADD = \ libs_gstglquery_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) libs_gstglsl_LDADD = \ $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ @@ -603,7 +604,16 @@ libs_gstglsl_LDADD = \ libs_gstglsl_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -DGST_USE_UNSTABLE_API \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(AM_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) + +libs_gstglheaders_LDADD = \ + $(top_builddir)/gst-libs/gst/gl/libgstgl-@GST_API_VERSION@.la \ + $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(LDADD) + +libs_gstglheaders_CFLAGS = \ + $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ + -DGST_USE_UNSTABLE_API \ + $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GL_CFLAGS) $(AM_CFLAGS) elements_glimagesink_CFLAGS = \ $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ diff --git a/tests/check/libs/.gitignore b/tests/check/libs/.gitignore index ce9f87fcf8..f2d9f4df2a 100644 --- a/tests/check/libs/.gitignore +++ b/tests/check/libs/.gitignore @@ -12,3 +12,4 @@ gstglupload gstglcolorconvert gstglsl gstglquery +gstglheaders diff --git a/tests/check/libs/gstglcontext.c b/tests/check/libs/gstglcontext.c index c0b91178c0..7ea74bcc5e 100644 --- a/tests/check/libs/gstglcontext.c +++ b/tests/check/libs/gstglcontext.c @@ -24,7 +24,7 @@ #include -#include +#include #include diff --git a/tests/check/libs/gstglheaders.c b/tests/check/libs/gstglheaders.c new file mode 100644 index 0000000000..5c359368c1 --- /dev/null +++ b/tests/check/libs/gstglheaders.c @@ -0,0 +1,173 @@ +/* GStreamer + * + * unit test for state changes on all elements + * + * Copyright (C) <2017> Julien Isorce + * + * 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. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* This test check that public gstgl headers does not include any + * GL headers. Except for gst/gl/gstglfuncs.h */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if GST_GL_HAVE_PLATFORM_EGL +#include +#include +#include +#endif + +#if GST_GL_HAVE_PLATFORM_X11 +#include +#include +#endif + +#include + +#if defined(GLint) || defined(GLAPI) || defined(GL_GLEXT_VERSION) +#error gl headers should not be included +#endif + +#if defined(EGLint) || defined(EGLBoolean) || defined(EGLAPI) +#error egl headers should not be included +#endif + +static GstGLDisplay *display; +static GstGLContext *context; + +static void +setup (void) +{ + display = gst_gl_display_new (); + context = gst_gl_context_new (display); + gst_gl_context_create (context, 0, NULL); + gst_gl_buffer_init_once (); + gst_gl_memory_init_once (); + gst_gl_memory_pbo_init_once (); + gst_gl_renderbuffer_init_once (); +} + +static void +teardown (void) +{ + gst_object_unref (context); + gst_object_unref (display); +} + +GST_START_TEST (test_constructors) +{ + GstBufferPool *pool = NULL; + GstGLShader *shader = NULL; + GstGLSLStage *stage = NULL; + GstGLColorConvert *convert = NULL; + GstGLOverlayCompositor *compositor = NULL; + GstGLUpload *upload = NULL; + + pool = gst_gl_buffer_pool_new (context); + fail_if (pool == NULL); + gst_object_unref (pool); + + shader = gst_gl_shader_new (context); + fail_if (shader == NULL); + gst_object_unref (shader); + + stage = gst_glsl_stage_new_default_fragment (context); + fail_if (stage == NULL); + gst_object_unref (stage); + + convert = gst_gl_color_convert_new (context); + fail_if (convert == NULL); + gst_object_unref (convert); + + compositor = gst_gl_overlay_compositor_new (context); + fail_if (compositor == NULL); + gst_object_unref (compositor); + + upload = gst_gl_upload_new (context); + fail_if (upload == NULL); + gst_object_unref (upload); +} + +GST_END_TEST; + +GST_START_TEST (test_constructors_require_activated_context) +{ + gboolean ret = FALSE; + GstGLFramebuffer *framebuffer = NULL; + + ret = gst_gl_context_activate (context, TRUE); + fail_if (!ret); + + framebuffer = gst_gl_framebuffer_new (context); + fail_if (framebuffer == NULL); + gst_object_unref (framebuffer); + + ret = gst_gl_context_activate (context, FALSE); + fail_if (!ret); +} + +GST_END_TEST; + + +static Suite * +gst_gl_headers_suite (void) +{ + Suite *s = suite_create ("Gst GL Headers"); + TCase *tc_chain = tcase_create ("general"); + + suite_add_tcase (s, tc_chain); + tcase_add_checked_fixture (tc_chain, setup, teardown); + tcase_add_test (tc_chain, test_constructors); + tcase_add_test (tc_chain, test_constructors_require_activated_context); + + return s; +} + +GST_CHECK_MAIN (gst_gl_headers); diff --git a/tests/check/libs/gstglupload.c b/tests/check/libs/gstglupload.c index d03691685d..2cd78bcab5 100644 --- a/tests/check/libs/gstglupload.c +++ b/tests/check/libs/gstglupload.c @@ -24,8 +24,7 @@ #include -#include -#include +#include #include diff --git a/tests/examples/gl/generic/cube/main.cpp b/tests/examples/gl/generic/cube/main.cpp index da4aa17962..730d952cb9 100644 --- a/tests/examples/gl/generic/cube/main.cpp +++ b/tests/examples/gl/generic/cube/main.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #include diff --git a/tests/examples/gl/generic/cubeyuv/main.cpp b/tests/examples/gl/generic/cubeyuv/main.cpp index cda990f8a7..e1f843ec46 100644 --- a/tests/examples/gl/generic/cubeyuv/main.cpp +++ b/tests/examples/gl/generic/cubeyuv/main.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/tests/examples/gl/generic/doublecube/main.cpp b/tests/examples/gl/generic/doublecube/main.cpp index 98d7825567..631a285815 100644 --- a/tests/examples/gl/generic/doublecube/main.cpp +++ b/tests/examples/gl/generic/doublecube/main.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/tests/examples/gtk/glliveshader.c b/tests/examples/gtk/glliveshader.c index 5a71bc3fcb..03e745ee36 100644 --- a/tests/examples/gtk/glliveshader.c +++ b/tests/examples/gtk/glliveshader.c @@ -20,6 +20,7 @@ #include #include +#include #include #if GST_GL_HAVE_WINDOW_X11 #include