#include "config.h"
#endif
+#include <gst/gl/gstglfuncs.h>
+
#include "gltestsrc.h"
#define MAX_ATTRIBUTES 4
#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
#include "gstglcolorscale.h"
-
#define GST_CAT_DEFAULT gst_gl_colorscale_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
#include "config.h"
#endif
+#include <gst/gl/gstglfuncs.h>
+
#include "gstgldeinterlace.h"
#define GST_CAT_DEFAULT gst_gl_deinterlace_debug
#include <stdlib.h>
#include <png.h>
+#include <gst/gl/gstglfuncs.h>
+
#include "gstgldifferencematte.h"
#include "effects/gstgleffectssources.h"
#include "config.h"
#endif
-#include <gst/gl/gstglconfig.h>
#include "gstgleffects.h"
#define GST_CAT_DEFAULT gst_gl_effects_debug
#define __GST_GL_EFFECTS_H__
#include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
+
#include "effects/gstgleffectssources.h"
G_BEGIN_DECLS
#define _GST_GL_FILTERCUBE_H_
#include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
G_BEGIN_DECLS
#endif
#include <math.h>
+#include <gst/gl/gstglfuncs.h>
+
#include "gstglfilterglass.h"
+
#include "gstglutils.h"
#define GST_CAT_DEFAULT gst_gl_filter_glass_debug
#include "config.h"
#endif
-#include <gst/gst.h>
+#include <gst/gl/gstglfuncs.h>
#include "gstglfiltershader.h"
#if HAVE_GRAPHENE
#include <gst/video/video.h>
#include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
G_BEGIN_DECLS
#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
#define _GST_GL_OVERLAY_H_
#include <gst/gl/gstglfilter.h>
+#include <gst/gl/gstglfuncs.h>
G_BEGIN_DECLS
#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)
#include "config.h"
#endif
-#include <gst/gst.h>
+#include <gst/gl/gstglfuncs.h>
+
#include "gstglutils.h"
struct _compile_shader
#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"
#endif
#include <gst/base/gstbasetransform.h>
+
#include "gstglviewconvert.h"
#define GST_CAT_DEFAULT gst_gl_view_convert_element_debug
#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())
$(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) \
#include "config.h"
#endif
+#include <gst/gl/gstglfuncs.h>
+
#include "gstgtkglsink.h"
#include "gtkgstglwidget.h"
#include "gtkgstglwidget.h"
#include "gstgtkutils.h"
+#include <gst/gl/gstglfuncs.h>
#include <gst/video/video.h>
#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (GDK_WINDOWING_X11)
#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>
*
* 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);
* 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)
{
#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
GstMiniObject parent;
GstGLContext *context;
- EGLImageKHR image;
+ gpointer image;
GstGLFormat format;
/* <private> */
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,
*/
#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"
{
GstGLContextEGL *egl;
GstGLWindow *window = NULL;
- EGLNativeWindowType window_handle = (EGLNativeWindowType) 0;
+ guintptr window_handle = 0;
EGLint egl_major;
EGLint egl_minor;
gboolean need_surface = TRUE;
}
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",
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) {
}
}
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) {
#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
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;
const gchar *egl_exts;
/* Cached handle */
- EGLNativeWindowType window_handle;
+ guintptr window_handle;
};
/**
#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
*
* Since: 1.12
*/
-EGLDisplay
+gpointer
gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display)
{
const gchar *egl_exts;
/* 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;
/* 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);
}
/**
* 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;
#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
GstGLDisplay parent;
/* <private> */
- EGLDisplay display;
+ gpointer display;
gboolean foreign_display;
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"
#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;
*
* 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)),
*
* 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);
#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
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
#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>
typedef struct _GstGLQuery GstGLQuery;
+typedef struct _GstGLFuncs GstGLFuncs;
+
+typedef struct _GstGLAsyncDebug GstGLAsyncDebug;
+
#include <gst/gl/gstgl_enums.h>
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
#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
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
#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
#include <string.h>
-#include <gst/gl/gstglbasememory.h>
+#include "gstglbasememory.h"
+
+#include "gstglcontext.h"
+#include "gstglquery.h"
/**
* SECTION:gstglbasememory
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:
#include <string.h>
#include "gstglbuffer.h"
+
+#include "gstglcontext.h"
+#include "gstglfuncs.h"
#include "gstglutils.h"
/**
#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
#include "config.h"
#endif
-#include "gl.h"
#include "gstglbufferpool.h"
+
+#include "gstglmemory.h"
+#include "gstglsyncmeta.h"
#include "gstglutils.h"
/**
#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
#include <string.h>
#include <stdio.h>
-#include "gl.h"
#include "gstglcolorconvert.h"
+
+#include "gl.h"
+#include "gstglfuncs.h"
#include "gstglsl_private.h"
/**
#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
#include <gst/gst.h>
-#include <gst/gl/gl.h>
+#include <gst/gl/gstgl_fwd.h>
G_BEGIN_DECLS
#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
#ifndef __GST_GL_DEBUG_H__
#define __GST_GL_DEBUG_H__
-#include <gst/gl/gl.h>
+#include <gst/gl/gstgl_fwd.h>
G_BEGIN_DECLS
#ifndef __GST_GL_DISPLAY_H__
#define __GST_GL_DISPLAY_H__
-#include <gst/gst.h>
-
#include <gst/gl/gstgl_fwd.h>
G_BEGIN_DECLS
#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);
#include "gstglfilter.h"
+#include "gstglfuncs.h"
+
#define GST_CAT_DEFAULT gst_gl_filter_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
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];
};
#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))
#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
*/
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);
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,
--- /dev/null
+/*
+ * 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__ */
#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
#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
#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
#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
#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
GList * overlays;
GstGLShader *shader;
- GLint position_attrib;
- GLint texcoord_attrib;
+ gint position_attrib;
+ gint texcoord_attrib;
gpointer _padding[GST_PADDING];
};
#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
#define __GST_GL_QUERY_H__
#include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstgldebug.h>
G_BEGIN_DECLS
#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
#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
#ifndef __GST_GL_SHADER_STRINGS_H__
#define __GST_GL_SHADER_STRINGS_H__
-#include <gst/gl/gl.h>
+#include <gst/gst.h>
G_BEGIN_DECLS
#define __GST_GLSL_PRIVATE_H__
#include <gst/gl/gstgl_fwd.h>
+#include <gst/gl/gstglfuncs.h>
G_BEGIN_DECLS
#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
#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
#include "gstglupload.h"
#if GST_GL_HAVE_PLATFORM_EGL
+#include "egl/gsteglimage.h"
#include "egl/gstglmemoryegl.h"
#include "egl/gstglcontext_egl.h"
#endif
#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))
#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())
#include <X11/Xlib-xcb.h>
-#include <gst/gl/gstgl_fwd.h>
#include <gst/gl/gstgldisplay.h>
G_BEGIN_DECLS
#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
libs/gstglcolorconvert \
libs/gstglquery \
libs/gstglsl \
+ libs/gstglheaders \
elements/glimagesink \
pipelines/simple-launch-lines
else
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 \
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 \
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 \
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 \
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) \
gstglcolorconvert
gstglsl
gstglquery
+gstglheaders
#include <gst/check/gstcheck.h>
-#include <gst/gl/gstglcontext.h>
+#include <gst/gl/gl.h>
#include <stdio.h>
--- /dev/null
+/* 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);
#include <gst/check/gstcheck.h>
-#include <gst/gl/gstglcontext.h>
-#include <gst/gl/gstglupload.h>
+#include <gst/gl/gl.h>
#include <stdio.h>
#include <gst/gst.h>
#include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
+
#include <iostream>
#include <string>
#include <gst/gst.h>
#include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
#include <iostream>
#include <sstream>
#include <gst/gst.h>
#include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
#include <iostream>
#include <sstream>
#include <gst/gst.h>
#include <gst/gl/gl.h>
+#include <gst/gl/gstglfuncs.h>
#include <gtk/gtk.h>
#if GST_GL_HAVE_WINDOW_X11
#include <X11/Xlib.h>