diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am index a1feb3f2bd..e51576292b 100644 --- a/gst-libs/gst/gl/Makefile.am +++ b/gst-libs/gst/gl/Makefile.am @@ -74,14 +74,16 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \ gstglfilter.h \ gstglmixer.h \ gstglmixerpad.h \ - gstglshadervariables.h \ + gstglshadervariables.h \ gstglshader.h \ gstgldownload.h \ gstglupload.h \ gstglapi.h \ gstglfeature.h \ gstglutils.h \ - gstglframebuffer.h + gstglframebuffer.h \ + gstgl_fwd.h \ + gl.h libgstgl_@GST_API_VERSION@_la_CFLAGS = \ $(GL_CFLAGS) \ diff --git a/gst-libs/gst/gl/gl.h b/gst-libs/gst/gl/gl.h new file mode 100644 index 0000000000..940b6c7a65 --- /dev/null +++ b/gst-libs/gst/gl/gl.h @@ -0,0 +1,41 @@ +/* + * GStreamer + * Copyright (C) 2013 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. + */ + +#ifndef __GL_H__ +#define __GL_H__ + +#include "gstgl_fwd.h" +#include "gstglconfig.h" +#include "gstglapi.h" +#include "gstgldisplay.h" +#include "gstglfeature.h" +#include "gstglutils.h" +#include "gstglwindow.h" +#include "gstglshader.h" +#include "gstglupload.h" +#include "gstgldownload.h" +#include "gstglmemory.h" +#include "gstglbufferpool.h" +#include "gstglframebuffer.h" +#include "gstglfilter.h" +#include "gstglmixer.h" +#include "gstglshadervariables.h" + +#endif /* __GL_H__ */ diff --git a/gst-libs/gst/gl/gstgl_fwd.h b/gst-libs/gst/gl/gstgl_fwd.h new file mode 100644 index 0000000000..f0b049e495 --- /dev/null +++ b/gst-libs/gst/gl/gstgl_fwd.h @@ -0,0 +1,56 @@ +/* + * GStreamer + * Copyright (C) 2013 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. + */ + +#ifndef __GST_GL_FWD_H__ +#define __GST_GL_FWD_H__ + +#include + +#include "gstglapi.h" + +G_BEGIN_DECLS + +typedef struct _GstGLDisplay GstGLDisplay; +typedef struct _GstGLDisplayClass GstGLDisplayClass; +typedef struct _GstGLDisplayPrivate GstGLDisplayPrivate; + +typedef struct _GstGLWindow GstGLWindow; +typedef struct _GstGLWindowPrivate GstGLWindowPrivate; +typedef struct _GstGLWindowClass GstGLWindowClass; + +typedef struct _GstGLMemory GstGLMemory; +typedef struct _GstGLAllocator GstGLAllocator; +typedef struct _GstGLAllocatorClass GstGLAllocatorClass; + +typedef struct _GstGLShader GstGLShader; +typedef struct _GstGLShaderPrivate GstGLShaderPrivate; +typedef struct _GstGLShaderClass GstGLShaderClass; + +typedef struct _GstGLDownload GstGLDownload; +typedef struct _GstGLDownloadClass GstGLDownloadClass; +typedef struct _GstGLDownloadPrivate GstGLDownloadPrivate; + +typedef struct _GstGLUpload GstGLUpload; +typedef struct _GstGLUploadClass GstGLUploadClass; +typedef struct _GstGLUploadPrivate GstGLUploadPrivate; + +G_END_DECLS + +#endif /* __GST_GL_FWD_H__ */ diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h index ef0f45c323..ee314cff43 100644 --- a/gst-libs/gst/gl/gstglapi.h +++ b/gst-libs/gst/gl/gstglapi.h @@ -37,6 +37,7 @@ # if __APPLE__ # include # include +# include # else # include # include @@ -52,10 +53,10 @@ #define GSTGLAPI #endif -#include "glprototypes/gstgl_compat.h" - #include +#include "glprototypes/gstgl_compat.h" + G_BEGIN_DECLS typedef enum { diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c index 7409dd502c..cef6ea441d 100644 --- a/gst-libs/gst/gl/gstglbufferpool.c +++ b/gst-libs/gst/gl/gstglbufferpool.c @@ -22,6 +22,7 @@ #include "config.h" #endif +#include "gl.h" #include "gstglbufferpool.h" /** diff --git a/gst-libs/gst/gl/gstglbufferpool.h b/gst-libs/gst/gl/gstglbufferpool.h index 5f75dca947..d4456ba10a 100644 --- a/gst-libs/gst/gl/gstglbufferpool.h +++ b/gst-libs/gst/gl/gstglbufferpool.h @@ -25,8 +25,7 @@ #include #include -#include "gstgldisplay.h" -#include "gstglmemory.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index b001f80e7e..6a560c1414 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -25,8 +25,7 @@ #include "config.h" #endif -#include "gstglmemory.h" - +#include "gl.h" #include "gstgldisplay.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug); diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 3ee6fbc6f4..bfe021d5d1 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -24,12 +24,7 @@ #ifndef __GST_GL_DISPLAY_H__ #define __GST_GL_DISPLAY_H__ -#include "gstglconfig.h" - -typedef struct _GstGLWindow GstGLWindow; - -#include "gstglwindow.h" -#include "gstglutils.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS @@ -42,10 +37,6 @@ GType gst_gl_display_get_type (void); #define GST_IS_GL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY)) #define GST_GL_DISPLAY_CAST(obj) ((GstGLDisplay*)(obj)) -typedef struct _GstGLDisplay GstGLDisplay; -typedef struct _GstGLDisplayClass GstGLDisplayClass; -typedef struct _GstGLDisplayPrivate GstGLDisplayPrivate; - /** * GstGLDisplayThreadFunc: * @display: a #GstGLDisplay diff --git a/gst-libs/gst/gl/gstgldownload.c b/gst-libs/gst/gl/gstgldownload.c index fa1a3813e3..f7ab882389 100644 --- a/gst-libs/gst/gl/gstgldownload.c +++ b/gst-libs/gst/gl/gstgldownload.c @@ -24,8 +24,8 @@ #include +#include "gl.h" #include "gstgldownload.h" -#include "gstglmemory.h" /** * SECTION:gstgldownload diff --git a/gst-libs/gst/gl/gstgldownload.h b/gst-libs/gst/gl/gstgldownload.h index cef26ef7c6..ded8a42302 100644 --- a/gst-libs/gst/gl/gstgldownload.h +++ b/gst-libs/gst/gl/gstgldownload.h @@ -24,15 +24,10 @@ #include #include -#include "gstgldisplay.h" -#include "gstglshader.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS -/* forward declare */ -typedef struct _GstGLMemory GstGLMemory; -typedef struct _GstGLDisplay GstGLDisplay; - GType gst_gl_download_get_type (void); #define GST_TYPE_GL_DOWNLOAD (gst_gl_download_get_type()) #define GST_GL_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DOWNLOAD,GstGLDownload)) @@ -41,10 +36,6 @@ GType gst_gl_download_get_type (void); #define GST_IS_GL_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_DOWNLOAD)) #define GST_GL_DOWNLOAD_CAST(obj) ((GstGLDownload*)(obj)) -typedef struct _GstGLDownload GstGLDownload; -typedef struct _GstGLDownloadClass GstGLDownloadClass; -typedef struct _GstGLDownloadPrivate GstGLDownloadPrivate; - /** * GstGLDownload * @parent: the parent object diff --git a/gst-libs/gst/gl/gstglegl.c b/gst-libs/gst/gl/gstglegl.c index f41092cbbd..4097a52233 100644 --- a/gst-libs/gst/gl/gstglegl.c +++ b/gst-libs/gst/gl/gstglegl.c @@ -22,6 +22,7 @@ #include "config.h" #endif +#include "gl.h" #include "gstglegl.h" static const gchar * diff --git a/gst-libs/gst/gl/gstglegl.h b/gst-libs/gst/gl/gstglegl.h index 426182fa8c..4bfd479e91 100644 --- a/gst-libs/gst/gl/gstglegl.h +++ b/gst-libs/gst/gl/gstglegl.h @@ -24,7 +24,7 @@ #include #include -#include "gstglwindow.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglfeature.c b/gst-libs/gst/gl/gstglfeature.c index 72c347c7c1..f599e484b7 100644 --- a/gst-libs/gst/gl/gstglfeature.c +++ b/gst-libs/gst/gl/gstglfeature.c @@ -24,10 +24,9 @@ #include +#include "gl.h" #include "gstglfeature.h" -#include "gstglapi.h" - gboolean gst_gl_check_extension (const char *name, const gchar * ext) { diff --git a/gst-libs/gst/gl/gstglfeature.h b/gst-libs/gst/gl/gstglfeature.h index 4105d6200f..eb9a04f81c 100644 --- a/gst-libs/gst/gl/gstglfeature.h +++ b/gst-libs/gst/gl/gstglfeature.h @@ -45,7 +45,7 @@ #include -#include "gstgldisplay.h" +#include "gstgl_fwd.h" #define GST_GL_CHECK_GL_VERSION(driver_major, driver_minor, \ target_major, target_minor) \ diff --git a/gst-libs/gst/gl/gstglfilter.h b/gst-libs/gst/gl/gstglfilter.h index dda8dddce3..b989885f11 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -27,7 +27,7 @@ #include #include -#include "gstglbufferpool.h" +#include "gl.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c index 1b574d298b..ae8bb5eb57 100644 --- a/gst-libs/gst/gl/gstglframebuffer.c +++ b/gst-libs/gst/gl/gstglframebuffer.c @@ -21,6 +21,7 @@ #include "config.h" #endif +#include "gl.h" #include "gstglframebuffer.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug); diff --git a/gst-libs/gst/gl/gstglframebuffer.h b/gst-libs/gst/gl/gstglframebuffer.h index 48250db938..1f5fcc8a14 100644 --- a/gst-libs/gst/gl/gstglframebuffer.h +++ b/gst-libs/gst/gl/gstglframebuffer.h @@ -21,7 +21,7 @@ #ifndef __GST_GL_FRAMEBUFFER_H__ #define __GST_GL_FRAMEBUFFER_H__ -#include "gstgldisplay.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index 1d5542b387..e83299488e 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -25,7 +25,6 @@ #include #include "gstglmemory.h" -#include "gstglutils.h" /** * SECTION:gstglmemory diff --git a/gst-libs/gst/gl/gstglmemory.h b/gst-libs/gst/gl/gstglmemory.h index 1556951638..7bec6cd060 100644 --- a/gst-libs/gst/gl/gstglmemory.h +++ b/gst-libs/gst/gl/gstglmemory.h @@ -22,12 +22,11 @@ #define _GST_GL_MEMORY_H_ #include -#include #include +#include +#include -#include "gstgldisplay.h" -#include "gstgldownload.h" -#include "gstglupload.h" +#include "gl.h" G_BEGIN_DECLS @@ -41,10 +40,6 @@ GType gst_gl_allocator_get_type(void); #define GST_GL_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_ALLOCATOR, GstGLAllocatorClass)) #define GST_GL_ALLOCATOR_CAST(obj) ((GstGLAllocator *)(obj)) -typedef struct _GstGLMemory GstGLMemory; -typedef struct _GstGLAllocator GstGLAllocator; -typedef struct _GstGLAllocatorClass GstGLAllocatorClass; - /** * GstGLMemoryFlags: * diff --git a/gst-libs/gst/gl/gstglmixer.h b/gst-libs/gst/gl/gstglmixer.h index c089d592d2..3e287d5026 100644 --- a/gst-libs/gst/gl/gstglmixer.h +++ b/gst-libs/gst/gl/gstglmixer.h @@ -25,7 +25,7 @@ #include #include "gstglmixerpad.h" -#include "gstglbufferpool.h" +#include "gl.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index a3c3cdcf6a..b412420faa 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -22,6 +22,7 @@ #include "config.h" #endif +#include "gl.h" #include "gstglshader.h" #ifndef GL_COMPILE_STATUS diff --git a/gst-libs/gst/gl/gstglshader.h b/gst-libs/gst/gl/gstglshader.h index cd06195532..a75f3fd10d 100644 --- a/gst-libs/gst/gl/gstglshader.h +++ b/gst-libs/gst/gl/gstglshader.h @@ -21,13 +21,10 @@ #ifndef __GST_GL_SHADER_H__ #define __GST_GL_SHADER_H__ -#include "gstgldisplay.h" -#include +#include "gstgl_fwd.h" G_BEGIN_DECLS -typedef struct _GstGLDisplay GstGLDisplay; - #define GST_GL_TYPE_SHADER (gst_gl_shader_get_type()) #define GST_GL_SHADER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_GL_TYPE_SHADER, GstGLShader)) #define GST_GL_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_GL_TYPE_SHADER, GstGLShaderClass)) @@ -48,10 +45,6 @@ typedef enum { GST_GL_SHADER_VERTEX_SOURCE } GstGLShaderSourceType; -typedef struct _GstGLShader GstGLShader; -typedef struct _GstGLShaderPrivate GstGLShaderPrivate; -typedef struct _GstGLShaderClass GstGLShaderClass; - struct _GstGLShader { /*< private >*/ GObject parent; diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 30de512a5a..8b58709564 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -24,8 +24,8 @@ #include +#include "gl.h" #include "gstglupload.h" -#include "gstglmemory.h" /** * SECTION:gstglupload diff --git a/gst-libs/gst/gl/gstglupload.h b/gst-libs/gst/gl/gstglupload.h index 2daafd72bd..8b93bcad58 100644 --- a/gst-libs/gst/gl/gstglupload.h +++ b/gst-libs/gst/gl/gstglupload.h @@ -24,15 +24,10 @@ #include #include -#include "gstglshader.h" -#include "gstgldisplay.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS -/* forward declare */ -typedef struct _GstGLMemory GstGLMemory; -typedef struct _GstGLDisplay GstGLDisplay; - GType gst_gl_upload_get_type (void); #define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type()) #define GST_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_UPLOAD,GstGLUpload)) @@ -41,10 +36,6 @@ GType gst_gl_upload_get_type (void); #define GST_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_UPLOAD)) #define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj)) -typedef struct _GstGLUpload GstGLUpload; -typedef struct _GstGLUploadClass GstGLUploadClass; -typedef struct _GstGLUploadPrivate GstGLUploadPrivate; - /** * GstGLUpload * @parent: the parent object diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 76de438122..c835b78927 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -25,9 +25,8 @@ #include +#include "gl.h" #include "gstglutils.h" -#include "gstglfeature.h" -#include "gstglframebuffer.h" #ifndef GL_FRAMEBUFFER_UNDEFINED #define GL_FRAMEBUFFER_UNDEFINED 0x8219 diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h index 2761a02412..e22d5ce79b 100644 --- a/gst-libs/gst/gl/gstglutils.h +++ b/gst-libs/gst/gl/gstglutils.h @@ -21,13 +21,9 @@ #ifndef __GST_GL_UTILS_H__ #define __GST_GL_UTILS_H__ -typedef struct _GstGLDisplay GstGLDisplay; -typedef struct _GstGLShader GstGLShader; - #include -#include "gstgldisplay.h" -#include "gstglshader.h" +#include "gstgl_fwd.h" /** * GstGLDisplayProjection: diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c index 2cb74bd468..1aa1b8c493 100644 --- a/gst-libs/gst/gl/gstglwindow.c +++ b/gst-libs/gst/gl/gstglwindow.c @@ -25,6 +25,7 @@ #include #include +#include "gl.h" #include "gstglwindow.h" #if GST_GL_HAVE_WINDOW_X11 @@ -40,8 +41,6 @@ #include "wayland/gstglwindow_wayland_egl.h" #endif -#include "gstglfeature.h" - #define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL) #define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3) #define USING_GLES(display) (display->gl_api & GST_GL_API_GLES) diff --git a/gst-libs/gst/gl/gstglwindow.h b/gst-libs/gst/gl/gstglwindow.h index 923c9278f3..f6f03b7387 100644 --- a/gst-libs/gst/gl/gstglwindow.h +++ b/gst-libs/gst/gl/gstglwindow.h @@ -22,12 +22,9 @@ #ifndef __GST_GL_WINDOW_H__ #define __GST_GL_WINDOW_H__ -typedef struct _GstGLDisplay GstGLDisplay; - #include -#include "gstglapi.h" -#include "gstgldisplay.h" +#include "gstgl_fwd.h" G_BEGIN_DECLS @@ -70,10 +67,6 @@ typedef void (*GstGLWindowResizeCB) (gpointer data, guint width, guint height); #define GST_GL_WINDOW_CB(f) ((GstGLWindowCB) (f)) #define GST_GL_WINDOW_RESIZE_CB(f) ((GstGLWindowResizeCB) (f)) -typedef struct _GstGLWindow GstGLWindow; -typedef struct _GstGLWindowPrivate GstGLWindowPrivate; -typedef struct _GstGLWindowClass GstGLWindowClass; - struct _GstGLWindow { /*< private >*/ GObject parent; diff --git a/gst/gl/gstglimagesink.h b/gst/gl/gstglimagesink.h index f75ea93f0b..8ac03fe87c 100644 --- a/gst/gl/gstglimagesink.h +++ b/gst/gl/gstglimagesink.h @@ -27,8 +27,7 @@ #include #include -#include "gstglbufferpool.h" -#include +#include "gl.h" G_BEGIN_DECLS diff --git a/gst/gl/gstgltestsrc.h b/gst/gl/gstgltestsrc.h index b90c1db3a8..884ace20a0 100644 --- a/gst/gl/gstgltestsrc.h +++ b/gst/gl/gstgltestsrc.h @@ -26,7 +26,7 @@ #include #include -#include "gstglbufferpool.h" +#include "gl.h" G_BEGIN_DECLS