From a4d74fda9a1a279fdf27534a53634095cc094c09 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Fri, 7 Jul 2017 16:15:12 +0100 Subject: [PATCH] gl: do not include GL headers in public gstgl headers 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 --- ext/gtk/Makefile.am | 3 ++- ext/gtk/gstgtkglsink.c | 2 ++ ext/gtk/gtkgstglwidget.c | 1 + tests/examples/gtk/glliveshader.c | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/gtk/Makefile.am b/ext/gtk/Makefile.am index 7736b24..3490625 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 5632688..39b54fa 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 ea0fe2f..2423afc 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/tests/examples/gtk/glliveshader.c b/tests/examples/gtk/glliveshader.c index 5a71bc3..03e745e 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 -- 2.7.4