gl: do not include GL headers in public gstgl headers
authorJulien Isorce <jisorce@oblong.com>
Fri, 7 Jul 2017 15:15:12 +0000 (16:15 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:29 +0000 (19:32 +0000)
Except for gst/gl/gstglfuncs.h

It is up to the client app to include these headers.
It is coherent with the fact that gstreamer-gl.pc does not
require any egl.pc/gles.pc. I.e. it is the responsability
of the app to search these headers within its build setup.

For example gstreamer-vaapi includes explicitly EGL/egl.h
and search for it in its configure.ac.

For example with this patch, if an app includes the headers
  gst/gl/egl/gstglcontext_egl.h
  gst/gl/egl/gstgldisplay_egl.h
  gst/gl/egl/gstglmemoryegl.h
it will *no longer* automatically include EGL/egl.h and GLES2/gl2.h.
Which is good because the app might want to use the gstgl api only
without the need to bother about gl headers.

Also added a test: cd tests/check && make libs/gstglheaders.check

https://bugzilla.gnome.org/show_bug.cgi?id=784779

74 files changed:
ext/gl/gltestsrc.c
ext/gl/gstglcolorbalance.c
ext/gl/gstglcolorscale.c
ext/gl/gstgldeinterlace.c
ext/gl/gstgldifferencematte.c
ext/gl/gstgleffects.c
ext/gl/gstgleffects.h
ext/gl/gstglfiltercube.h
ext/gl/gstglfilterglass.c
ext/gl/gstglfiltershader.c
ext/gl/gstglimagesink.h
ext/gl/gstglmixer.h
ext/gl/gstgloverlay.h
ext/gl/gstgltestsrc.c
ext/gl/gstglutils.c
ext/gl/gstglvideomixer.c
ext/gl/gstglviewconvert.c
ext/gl/gstglviewconvert.h
gst-libs/gst/gl/egl/gsteglimage.c
gst-libs/gst/gl/egl/gsteglimage.h
gst-libs/gst/gl/egl/gstglcontext_egl.c
gst-libs/gst/gl/egl/gstglcontext_egl.h
gst-libs/gst/gl/egl/gstgldisplay_egl.c
gst-libs/gst/gl/egl/gstgldisplay_egl.h
gst-libs/gst/gl/egl/gstglmemoryegl.c
gst-libs/gst/gl/egl/gstglmemoryegl.h
gst-libs/gst/gl/gl.h
gst-libs/gst/gl/gstgl_fwd.h
gst-libs/gst/gl/gstglapi.h
gst-libs/gst/gl/gstglbasefilter.h
gst-libs/gst/gl/gstglbasememory.c
gst-libs/gst/gl/gstglbasememory.h
gst-libs/gst/gl/gstglbuffer.c
gst-libs/gst/gl/gstglbuffer.h
gst-libs/gst/gl/gstglbufferpool.c
gst-libs/gst/gl/gstglbufferpool.h
gst-libs/gst/gl/gstglcolorconvert.c
gst-libs/gst/gl/gstglcontext.c
gst-libs/gst/gl/gstglcontext.h
gst-libs/gst/gl/gstgldebug.c
gst-libs/gst/gl/gstgldebug.h
gst-libs/gst/gl/gstgldisplay.h
gst-libs/gst/gl/gstglfeature.c
gst-libs/gst/gl/gstglfilter.c
gst-libs/gst/gl/gstglfilter.h
gst-libs/gst/gl/gstglformat.c
gst-libs/gst/gl/gstglframebuffer.c
gst-libs/gst/gl/gstglframebuffer.h
gst-libs/gst/gl/gstglfuncs.h [new file with mode: 0644]
gst-libs/gst/gl/gstglmemory.c
gst-libs/gst/gl/gstglmemory.h
gst-libs/gst/gl/gstglmemorypbo.c
gst-libs/gst/gl/gstglmemorypbo.h
gst-libs/gst/gl/gstgloverlaycompositor.c
gst-libs/gst/gl/gstgloverlaycompositor.h
gst-libs/gst/gl/gstglquery.c
gst-libs/gst/gl/gstglquery.h
gst-libs/gst/gl/gstglrenderbuffer.c
gst-libs/gst/gl/gstglrenderbuffer.h
gst-libs/gst/gl/gstglshaderstrings.h
gst-libs/gst/gl/gstglsl_private.h
gst-libs/gst/gl/gstglslstage.c
gst-libs/gst/gl/gstglsyncmeta.c
gst-libs/gst/gl/gstglupload.c
gst-libs/gst/gl/gstglviewconvert.c
gst-libs/gst/gl/gstglviewconvert.h
gst-libs/gst/gl/x11/gstgldisplay_x11.h
gst-libs/gst/gl/x11/gstglwindow_x11.h
tests/check/libs/gstglcontext.c
tests/check/libs/gstglheaders.c [new file with mode: 0644]
tests/check/libs/gstglupload.c
tests/examples/gl/generic/cube/main.cpp
tests/examples/gl/generic/cubeyuv/main.cpp
tests/examples/gl/generic/doublecube/main.cpp

index ac845c6..f6faea3 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #endif
 
+#include <gst/gl/gstglfuncs.h>
+
 #include "gltestsrc.h"
 
 #define MAX_ATTRIBUTES 4
index 7a8a5b1..8163046 100644 (file)
 #include "config.h"
 #endif
 
+#include <string.h>
+#include <gst/gl/gstglfuncs.h>
 #include <gst/math-compat.h>
+#include <gst/video/colorbalance.h>
 
 #include "gstglcolorbalance.h"
-#include <string.h>
-
-#include <gst/video/colorbalance.h>
 
 GST_DEBUG_CATEGORY_STATIC (glcolorbalance_debug);
 #define GST_CAT_DEFAULT glcolorbalance_debug
index 3042734..88b71ef 100644 (file)
@@ -47,7 +47,6 @@
 
 #include "gstglcolorscale.h"
 
-
 #define GST_CAT_DEFAULT gst_gl_colorscale_debug
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
 
index 975128f..3b26715 100644 (file)
@@ -36,6 +36,8 @@
 #include "config.h"
 #endif
 
+#include <gst/gl/gstglfuncs.h>
+
 #include "gstgldeinterlace.h"
 
 #define GST_CAT_DEFAULT gst_gl_deinterlace_debug
index c68bbbe..e805770 100644 (file)
@@ -39,6 +39,8 @@
 #include <stdlib.h>
 #include <png.h>
 
+#include <gst/gl/gstglfuncs.h>
+
 #include "gstgldifferencematte.h"
 #include "effects/gstgleffectssources.h"
 
index 4377310..97a8dfe 100644 (file)
@@ -36,7 +36,6 @@
 #include "config.h"
 #endif
 
-#include <gst/gl/gstglconfig.h>
 #include "gstgleffects.h"
 
 #define GST_CAT_DEFAULT gst_gl_effects_debug
index 151ab78..a090e0d 100644 (file)
@@ -22,6 +22,8 @@
 #define __GST_GL_EFFECTS_H__
 
 #include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
+
 #include "effects/gstgleffectssources.h"
 
 G_BEGIN_DECLS
index ee25048..2dcd6c5 100644 (file)
@@ -22,6 +22,7 @@
 #define _GST_GL_FILTERCUBE_H_
 
 #include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
 
 G_BEGIN_DECLS
 
index 160543f..31f63b5 100644 (file)
 #endif
 
 #include <math.h>
+#include <gst/gl/gstglfuncs.h>
+
 #include "gstglfilterglass.h"
+
 #include "gstglutils.h"
 
 #define GST_CAT_DEFAULT gst_gl_filter_glass_debug
index 06a6195..df5040f 100644 (file)
@@ -56,7 +56,7 @@
 #include "config.h"
 #endif
 
-#include <gst/gst.h>
+#include <gst/gl/gstglfuncs.h>
 
 #include "gstglfiltershader.h"
 #if HAVE_GRAPHENE
index 8833103..12166ec 100644 (file)
@@ -28,6 +28,7 @@
 #include <gst/video/video.h>
 
 #include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
 
 G_BEGIN_DECLS
 
index 309f6bb..886e009 100644 (file)
@@ -24,6 +24,7 @@
 #include <gst/gst.h>
 #include <gst/video/video.h>
 #include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
 #include "gstglbasemixer.h"
 
 G_BEGIN_DECLS
index 565aaab..dad01e4 100644 (file)
@@ -22,6 +22,7 @@
 #define _GST_GL_OVERLAY_H_
 
 #include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
 
 G_BEGIN_DECLS
 
index 4c29e45..0305413 100644 (file)
 #include "config.h"
 #endif
 
+#include <gst/gl/gstglfuncs.h>
+#include <gst/gst-i18n-plugin.h>
+
 #include "gstgltestsrc.h"
 #include "gltestsrc.h"
-#include <gst/gst-i18n-plugin.h>
 
 #define USE_PEER_BUFFERALLOC
 #define SUPPORTED_GL_APIS (GST_GL_API_OPENGL | GST_GL_API_OPENGL3 | GST_GL_API_GLES2)
index ec18065..fdb7ad3 100644 (file)
@@ -22,7 +22,8 @@
 #include "config.h"
 #endif
 
-#include <gst/gst.h>
+#include <gst/gl/gstglfuncs.h>
+
 #include "gstglutils.h"
 
 struct _compile_shader
index a5a094b..7180220 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/video/gstvideoaffinetransformationmeta.h>
 #include <gst/controller/gstproxycontrolbinding.h>
+#include <gst/gl/gstglfuncs.h>
+#include <gst/video/gstvideoaffinetransformationmeta.h>
 
 #include "gstglvideomixer.h"
+
 #include "gstglmixerbin.h"
 #include "gstglutils.h"
 
index eafa084..203df6b 100644 (file)
@@ -47,6 +47,7 @@
 #endif
 
 #include <gst/base/gstbasetransform.h>
+
 #include "gstglviewconvert.h"
 
 #define GST_CAT_DEFAULT gst_gl_view_convert_element_debug
index 1403d27..5ccc58f 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _GST_GL_VIEW_CONVERT_ELEMENT_H_
 #define _GST_GL_VIEW_CONVERT_ELEMENT_H_
 
-#include <gst/gl/gstglviewconvert.h>
+#include <gst/gl/gstglfilter.h>
 
 G_BEGIN_DECLS
 #define GST_TYPE_GL_VIEW_CONVERT_ELEMENT            (gst_gl_view_convert_element_get_type())
index f570718..92b3862 100644 (file)
 #endif
 
 #include "gsteglimage.h"
-#include <gst/gl/egl/gstgldisplay_egl.h>
+
 #include <string.h>
 
+#include <gst/gl/gstglfeature.h>
+#include <gst/gl/gstglmemory.h>
+
+#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 <gst/allocators/gstdmabuf.h>
 #include <libdrm/drm_fourcc.h>
@@ -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)
 {
index 9a0e848..cfd8f00 100644 (file)
 #ifndef _GST_EGL_IMAGE_H_
 #define _GST_EGL_IMAGE_H_
 
-#include <gst/gst.h>
-#include <gst/video/video.h>
-
-#include <gst/gl/gl.h>
-#include <gst/gl/egl/gstegl.h>
+#include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstglformat.h>
 
 G_BEGIN_DECLS
 
@@ -61,7 +58,7 @@ struct _GstEGLImage
   GstMiniObject parent;
 
   GstGLContext *context;
-  EGLImageKHR image;
+  gpointer image;
   GstGLFormat format;
 
   /* <private> */
@@ -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,
index ddac4c4..926050c 100644 (file)
  */
 
 #include "gstglcontext_egl.h"
-#include <gst/gl/egl/gstegl.h>
+
+#include <gst/gl/gstglcontext_private.h>
+#include <gst/gl/gstglfeature.h>
+
+#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) {
index 40adc99..67947a8 100644 (file)
 #ifndef __GST_GL_EGL_H__
 #define __GST_GL_EGL_H__
 
-#include <gst/gst.h>
-#include <gst/gl/gl.h>
-#include <gst/gl/egl/gstegl.h>
-
+#include <gst/gl/gstglcontext.h>
 #include <gst/gl/egl/gstgldisplay_egl.h>
 
 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;
 };
 
 /**
index a2dc98a..83b7b41 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/gl/egl/gstgldisplay_egl.h>
-#include <gst/gl/egl/gsteglimage.h>
-#include <gst/gl/egl/gstglmemoryegl.h>
+#include "gstgldisplay_egl.h"
+
+#include <gst/gl/gstglfeature.h>
+
+#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;
 
index 1ee1c49..319a047 100644 (file)
@@ -21,9 +21,7 @@
 #ifndef __GST_GL_DISPLAY_EGL_H__
 #define __GST_GL_DISPLAY_EGL_H__
 
-#include <gst/gst.h>
 #include <gst/gl/gstgldisplay.h>
-#include <gst/gl/egl/gstegl.h>
 
 G_BEGIN_DECLS
 
@@ -51,7 +49,7 @@ struct _GstGLDisplayEGL
   GstGLDisplay          parent;
 
   /* <private> */
-  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"
 
index 32c4223..1f46114 100644 (file)
 
 #include <string.h>
 
-#include <gst/gl/egl/gstglmemoryegl.h>
-#include <gst/gl/egl/gstglcontext_egl.h>
+#include "gstglmemoryegl.h"
+
+#include <gst/gl/gstglfuncs.h>
+
+#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);
index ac7ca78..098e7cf 100644 (file)
 #ifndef _GST_GL_MEMORY_EGL_H_
 #define _GST_GL_MEMORY_EGL_H_
 
-#include <gst/gst.h>
-#include <gst/gstallocator.h>
-#include <gst/gstmemory.h>
-#include <gst/video/video.h>
-
-#include <gst/gl/gl.h>
-#include <gst/gl/egl/gsteglimage.h>
-
 #include <gst/gl/gstglmemory.h>
+#include <gst/gl/egl/gsteglimage.h>
+#include <gst/gl/egl/gstgldisplay_egl.h>
 
 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
index 036c8d8..33d1f35 100644 (file)
 #endif
 
 #include <gst/gl/gstgl_fwd.h>
-#include <gst/gl/gstglconfig.h>
 #include <gst/gl/gstglapi.h>
-#include <gst/gl/gstgldisplay.h>
+#include <gst/gl/gstglconfig.h>
 #include <gst/gl/gstglcontext.h>
 #include <gst/gl/gstgldebug.h>
+#include <gst/gl/gstgldisplay.h>
 #include <gst/gl/gstglfeature.h>
 #include <gst/gl/gstglformat.h>
 #include <gst/gl/gstglutils.h>
index 8f42e8d..19ca6f3 100644 (file)
@@ -102,6 +102,10 @@ typedef struct _GstGLOverlayCompositorClass GstGLOverlayCompositorClass;
 
 typedef struct _GstGLQuery GstGLQuery;
 
+typedef struct _GstGLFuncs GstGLFuncs;
+
+typedef struct _GstGLAsyncDebug GstGLAsyncDebug;
+
 #include <gst/gl/gstgl_enums.h>
 
 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
index 4196e83..1622d90 100644 (file)
 
 #include <gst/gl/gstglconfig.h>
 
-/* 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 <OpenGLES/ES2/gl.h>
-#  include <OpenGLES/ES2/glext.h>
-# else
-#  if GST_GL_HAVE_GLES3
-#   include <GLES3/gl3.h>
-#   if GST_GL_HAVE_GLES3EXT3_H
-#    include <GLES3/gl3ext.h>
-#   endif
-#   include <GLES2/gl2ext.h>
-#  else
-#   include <GLES2/gl2.h>
-#   include <GLES2/gl2ext.h>
-#  endif
-# endif
-# if !GST_GL_HAVE_OPENGL
-#  include <gst/gl/glprototypes/gstgl_gles2compat.h>
-# endif
-#endif
-
-/* OpenGL for desktop systems */
-#if GST_GL_HAVE_OPENGL
-# ifdef __APPLE__
-#  include <OpenGL/OpenGL.h>
-#  include <OpenGL/gl.h>
-#  if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
-#   define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
-#   include <OpenGL/gl3.h>
-#  endif
-# else
-#  if defined(_MSC_VER)
-#   include <windows.h>
-#  endif
-#  include <GL/gl.h>
-#  if defined(__WIN32__) || defined(_WIN32)
-#   include <GL/glext.h>
-#  endif
-# endif
-#endif
-
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-#if defined(WINAPI)
-#define GSTGLAPI WINAPI
-#else
-#define GSTGLAPI
-#endif
-#include <gst/gl/glprototypes/gstgl_compat.h>
-
 #include <gst/gst.h>
 
 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 <gst/gl/glprototypes/all_functions.h>
-  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
index aa5b946..fa4958d 100644 (file)
 #ifndef _GST_GL_BASE_FILTER_H_
 #define _GST_GL_BASE_FILTER_H_
 
-#include <gst/gst.h>
 #include <gst/base/gstbasetransform.h>
-#include <gst/video/video.h>
 
-#include <gst/gl/gl.h>
+#include <gst/gl/gstgl_fwd.h>
 
 G_BEGIN_DECLS
 
index d7bd88c..4bebedc 100644 (file)
 
 #include <string.h>
 
-#include <gst/gl/gstglbasememory.h>
+#include "gstglbasememory.h"
+
+#include "gstglcontext.h"
+#include "gstglquery.h"
 
 /**
  * SECTION:gstglbasememory
index 302334d..175fbf6 100644 (file)
@@ -375,7 +375,8 @@ struct _GstGLBaseMemoryAllocatorClass
   gpointer                                      _padding[GST_PADDING];
 };
 
-#include <gst/gl/gl.h>
+#include <gst/gl/gstglconfig.h>
+#include <gst/gl/gstglformat.h>
 
 /**
  * GST_GL_BASE_MEMORY_ALLOCATOR_NAME:
index 140f83c..5a45007 100644 (file)
@@ -25,6 +25,9 @@
 #include <string.h>
 
 #include "gstglbuffer.h"
+
+#include "gstglcontext.h"
+#include "gstglfuncs.h"
 #include "gstglutils.h"
 
 /**
index 90f8eb2..52a6576 100644 (file)
 #ifndef _GST_GL_BUFFER_H_
 #define _GST_GL_BUFFER_H_
 
-#include <gst/gst.h>
-#include <gst/gstallocator.h>
-#include <gst/gstmemory.h>
-
 #include <gst/gl/gstglbasememory.h>
 
 G_BEGIN_DECLS
index fc9522b..309bc36 100644 (file)
 #include "config.h"
 #endif
 
-#include "gl.h"
 #include "gstglbufferpool.h"
+
+#include "gstglmemory.h"
+#include "gstglsyncmeta.h"
 #include "gstglutils.h"
 
 /**
index bfe5371..0921464 100644 (file)
 #ifndef _GST_GL_BUFFER_POOL_H_
 #define _GST_GL_BUFFER_POOL_H_
 
-#include <gst/video/video.h>
 #include <gst/video/gstvideometa.h>
 #include <gst/video/gstvideopool.h>
 
-#include <gst/gl/gl.h>
+#include <gst/gl/gstglbasememory.h>
 
 G_BEGIN_DECLS
 
index 6644759..6bd9197 100644 (file)
 #include <string.h>
 #include <stdio.h>
 
-#include "gl.h"
 #include "gstglcolorconvert.h"
+
+#include "gl.h"
+#include "gstglfuncs.h"
 #include "gstglsl_private.h"
 
 /**
index 01c03c1..0d7a532 100644 (file)
 #define _GNU_SOURCE
 #endif
 
+#include "gstglcontext.h"
+
 #include <gmodule.h>
 #include <string.h>
 #include <stdio.h>
 
-#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
index 7cdc957..54383c5 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <gst/gst.h>
 
-#include <gst/gl/gl.h>
+#include <gst/gl/gstgl_fwd.h>
 
 G_BEGIN_DECLS
 
index 2b738cc..6f8eb4a 100644 (file)
 #include "config.h"
 #endif
 
-#include "gl.h"
 #include "gstgldebug.h"
-#include "gstglcontext_private.h"
+
 #include <glib/gprintf.h>
 #include <string.h>
 
+#include "gstglcontext.h"
+#include "gstglcontext_private.h"
+#include "gstglfuncs.h"
+
 /**
  * SECTION:gstgldebug
  * @short_description: helper routines for dealing with OpenGL debugging
index 36ba3a6..5031155 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __GST_GL_DEBUG_H__
 #define __GST_GL_DEBUG_H__
 
-#include <gst/gl/gl.h>
+#include <gst/gl/gstgl_fwd.h>
 
 G_BEGIN_DECLS
 
index 95ae8d6..7e8fe68 100644 (file)
@@ -24,8 +24,6 @@
 #ifndef __GST_GL_DISPLAY_H__
 #define __GST_GL_DISPLAY_H__
 
-#include <gst/gst.h>
-
 #include <gst/gl/gstgl_fwd.h>
 
 G_BEGIN_DECLS
index 56fd0fe..a1cadc2 100644 (file)
 
 #include <string.h>
 
-#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);
index 77b3e99..9f03b50 100644 (file)
@@ -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);
 
index 9dbb537..fc1928b 100644 (file)
@@ -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];
 };
index fd1d6b8..8427be4 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/gl/gstglformat.h>
-#include <gst/gl/gstglcontext.h>
+#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))
index 2e1c3bc..b1d64b2 100644 (file)
 #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);
 
index 172f999..aaf60ec 100644 (file)
@@ -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 (file)
index 0000000..805abcf
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * GStreamer
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
+ *
+ * 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 <gst/gl/gstglconfig.h>
+
+/* 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 <OpenGLES/ES2/gl.h>
+#  include <OpenGLES/ES2/glext.h>
+# else
+#  if GST_GL_HAVE_GLES3
+#   include <GLES3/gl3.h>
+#   if GST_GL_HAVE_GLES3EXT3_H
+#    include <GLES3/gl3ext.h>
+#   endif
+#   include <GLES2/gl2ext.h>
+#  else
+#   include <GLES2/gl2.h>
+#   include <GLES2/gl2ext.h>
+#  endif
+# endif
+# if !GST_GL_HAVE_OPENGL
+#  include <gst/gl/glprototypes/gstgl_gles2compat.h>
+# endif
+#endif
+
+/* OpenGL for desktop systems */
+#if GST_GL_HAVE_OPENGL
+# ifdef __APPLE__
+#  include <OpenGL/OpenGL.h>
+#  include <OpenGL/gl.h>
+#  if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+#   define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#   include <OpenGL/gl3.h>
+#  endif
+# else
+#  if defined(_MSC_VER)
+#   include <windows.h>
+#  endif
+#  include <GL/gl.h>
+#  if defined(__WIN32__) || defined(_WIN32)
+#   include <GL/glext.h>
+#  endif
+# endif
+#endif
+
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+#if defined(WINAPI)
+#define GSTGLAPI WINAPI
+#else
+#define GSTGLAPI
+#endif
+#include <gst/gl/glprototypes/gstgl_compat.h>
+
+#include <gst/gst.h>
+
+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 <gst/gl/glprototypes/all_functions.h>
+  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__ */
index aba40ef..a4a1372 100644 (file)
 
 #include <string.h>
 
-#include <gst/video/video.h>
+#include "gstglmemory.h"
 
-#include <gst/gl/gstglbasememory.h>
-#include <gst/gl/gstglmemory.h>
+#include "gl.h"
+#include "gstglfuncs.h"
 
 /**
  * SECTION:gstglmemory
index 3a4bf9f..e7721a7 100644 (file)
 #ifndef _GST_GL_MEMORY_H_
 #define _GST_GL_MEMORY_H_
 
-#include <gst/gst.h>
-#include <gst/gstallocator.h>
-#include <gst/gstmemory.h>
-#include <gst/video/video.h>
-
 #include <gst/gl/gstglbasememory.h>
+#include <gst/gl/gstglformat.h>
 
 G_BEGIN_DECLS
 
index 89091c8..4a62a38 100644 (file)
 
 #include <string.h>
 
-#include <gst/video/video.h>
+#include "gstglmemorypbo.h"
 
-#include <gst/gl/gstglmemorypbo.h>
+#include "gstglbuffer.h"
+#include "gstglcontext.h"
+#include "gstglfuncs.h"
+#include "gstglutils.h"
 
 /**
  * SECTION:gstglmemorypbo
index 77eff7b..c57bf17 100644 (file)
 #ifndef _GST_GL_MEMORY_PBO_H_
 #define _GST_GL_MEMORY_PBO_H_
 
-#include <gst/gst.h>
-#include <gst/gstallocator.h>
-#include <gst/gstmemory.h>
-#include <gst/video/video.h>
-
 #include <gst/gl/gstglmemory.h>
 
 G_BEGIN_DECLS
index 2572110..05575aa 100644 (file)
 
 #include <stdio.h>
 
-#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
 
index 0f4f1b2..3bc2462 100644 (file)
@@ -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];
 };
index 0cf0f75..faceebf 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/gl/gl.h>
-
 #include <string.h>
 
 #include "gstglquery.h"
 
+#include "gstglcontext.h"
+#include "gstglfuncs.h"
+
 #ifndef GL_TIME_ELAPSED
 #define GL_TIME_ELAPSED 0x88BF
 #endif
index 0b05742..48634b8 100644 (file)
@@ -22,6 +22,7 @@
 #define __GST_GL_QUERY_H__
 
 #include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstgldebug.h>
 
 G_BEGIN_DECLS
 
index 9a3c0c6..4399c7e 100644 (file)
 
 #include <string.h>
 
-#include <gst/video/video.h>
+#include "gstglrenderbuffer.h"
 
-#include <gst/gl/gstglbasememory.h>
-#include <gst/gl/gstglrenderbuffer.h>
+#include "gstglcontext.h"
+#include "gstglfuncs.h"
+#include "gstglmemory.h"
 
 /**
  * SECTION:gstglrenderbuffer
index 9b47e67..598f0ab 100644 (file)
 #ifndef _GST_GL_RENDERBUFFER_H_
 #define _GST_GL_RENDERBUFFER_H_
 
-#include <gst/gst.h>
-#include <gst/gstallocator.h>
-#include <gst/gstmemory.h>
-
 #include <gst/gl/gstglbasememory.h>
 
 G_BEGIN_DECLS
index 0e56471..48ea200 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __GST_GL_SHADER_STRINGS_H__
 #define __GST_GL_SHADER_STRINGS_H__
 
-#include <gst/gl/gl.h>
+#include <gst/gst.h>
 
 G_BEGIN_DECLS
 
index 08addeb..992c417 100644 (file)
@@ -22,6 +22,7 @@
 #define __GST_GLSL_PRIVATE_H__
 
 #include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstglfuncs.h>
 
 G_BEGIN_DECLS
 
index d40a88b..0205f38 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/gl/gl.h>
-
 #include "gstglslstage.h"
+
+#include "gl.h"
+#include "gstglfuncs.h"
 #include "gstglsl_private.h"
 
 #ifndef GL_GEOMETRY_SHADER
index bd9131d..d74b3cd 100644 (file)
 #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
 
index 1bdbfb1..feaf2f6 100644 (file)
@@ -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
index 53475a7..755f1b9 100644 (file)
 #endif
 
 #include "gstglviewconvert.h"
+
+#include <gst/video/gstvideoaffinetransformationmeta.h>
+
+#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"
-#include <gst/video/gstvideoaffinetransformationmeta.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))
index d418ca9..3cad3ad 100644 (file)
 #ifndef _GST_GL_VIEW_CONVERT_H_
 #define _GST_GL_VIEW_CONVERT_H_
 
-#include <gst/gl/gl.h>
+#include <gst/gstmemory.h>
+#include <gst/video/video.h>
+
+#include <gst/gl/gstgl_fwd.h>
 
 G_BEGIN_DECLS
 #define GST_TYPE_GL_VIEW_CONVERT            (gst_gl_view_convert_get_type())
index d96a669..3ffe251 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <X11/Xlib-xcb.h>
 
-#include <gst/gl/gstgl_fwd.h>
 #include <gst/gl/gstgldisplay.h>
 
 G_BEGIN_DECLS
index e612ff1..ba6fd16 100644 (file)
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
-#include <gst/gl/gl.h>
+#include <gst/video/video.h>
+
+#include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstglwindow.h>
 
 G_BEGIN_DECLS
 
index c0b9117..7ea74bc 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <gst/check/gstcheck.h>
 
-#include <gst/gl/gstglcontext.h>
+#include <gst/gl/gl.h>
 
 #include <stdio.h>
 
diff --git a/tests/check/libs/gstglheaders.c b/tests/check/libs/gstglheaders.c
new file mode 100644 (file)
index 0000000..5c35936
--- /dev/null
@@ -0,0 +1,173 @@
+/* GStreamer
+ *
+ * unit test for state changes on all elements
+ *
+ * Copyright (C) <2017> Julien Isorce <julien.isorce@gmail.com>
+ *
+ * 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 <gst/check/gstcheck.h>
+
+#include <gst/gl/gstgl_enums.h>
+#include <gst/gl/gstglapi.h>
+#include <gst/gl/gstglbasefilter.h>
+#include <gst/gl/gstglbuffer.h>
+#include <gst/gl/gstglbufferpool.h>
+#include <gst/gl/gstglcolorconvert.h>
+#include <gst/gl/gstglconfig.h>
+#include <gst/gl/gstglcontext.h>
+#include <gst/gl/gstgldebug.h>
+#include <gst/gl/gstgldisplay.h>
+#include <gst/gl/gstglfeature.h>
+#include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglformat.h>
+#include <gst/gl/gstglframebuffer.h>
+#include <gst/gl/gstglsl.h>
+#include <gst/gl/gstglslstage.h>
+#include <gst/gl/gstglmemory.h>
+#include <gst/gl/gstglmemorypbo.h>
+#include <gst/gl/gstglquery.h>
+#include <gst/gl/gstgloverlaycompositor.h>
+#include <gst/gl/gstglrenderbuffer.h>
+#include <gst/gl/gstglshader.h>
+#include <gst/gl/gstglshaderstrings.h>
+#include <gst/gl/gstglsyncmeta.h>
+#include <gst/gl/gstglupload.h>
+#include <gst/gl/gstglutils.h>
+#include <gst/gl/gstglviewconvert.h>
+#include <gst/gl/gstglwindow.h>
+
+#if GST_GL_HAVE_PLATFORM_EGL
+#include <gst/gl/egl/gstgldisplay_egl.h>
+#include <gst/gl/egl/gstglcontext_egl.h>
+#include <gst/gl/egl/gstglmemoryegl.h>
+#endif
+
+#if GST_GL_HAVE_PLATFORM_X11
+#include <gst/gl/x11/gstgldisplay_x11.h>
+#include <gst/gl/x11/gstglwindow_x11.h>
+#endif
+
+#include <gst/gl/gl.h>
+
+#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);
index d036916..2cd78bc 100644 (file)
@@ -24,8 +24,7 @@
 
 #include <gst/check/gstcheck.h>
 
-#include <gst/gl/gstglcontext.h>
-#include <gst/gl/gstglupload.h>
+#include <gst/gl/gl.h>
 
 #include <stdio.h>
 
index da4aa17..730d952 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <gst/gst.h>
 #include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
+
 
 #include <iostream>
 #include <string>
index cda990f..e1f843e 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <gst/gst.h>
 #include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
 
 #include <iostream>
 #include <sstream>
index 98d7825..631a285 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <gst/gst.h>
 #include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
 
 #include <iostream>
 #include <sstream>