mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
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
This commit is contained in:
parent
f02993921c
commit
2fd84a6c86
80 changed files with 507 additions and 222 deletions
|
@ -22,6 +22,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gltestsrc.h"
|
||||
|
||||
#define MAX_ATTRIBUTES 4
|
||||
|
|
|
@ -38,12 +38,12 @@
|
|||
#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
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
#include "gstglcolorscale.h"
|
||||
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_colorscale_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstgldeinterlace.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_deinterlace_debug
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <png.h>
|
||||
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstgldifferencematte.h"
|
||||
#include "effects/gstgleffectssources.h"
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gl/gstglconfig.h>
|
||||
#include "gstgleffects.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_effects_debug
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define _GST_GL_FILTERCUBE_H_
|
||||
|
||||
#include <gst/gl/gstglfilter.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -41,7 +41,10 @@
|
|||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstglfilterglass.h"
|
||||
|
||||
#include "gstglutils.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_filter_glass_debug
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstglfiltershader.h"
|
||||
#if HAVE_GRAPHENE
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <gst/video/video.h>
|
||||
|
||||
#include <gst/gl/gl.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define _GST_GL_OVERLAY_H_
|
||||
|
||||
#include <gst/gl/gstglfilter.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -42,9 +42,11 @@
|
|||
#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)
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstglutils.h"
|
||||
|
||||
struct _compile_shader
|
||||
|
|
|
@ -43,10 +43,12 @@
|
|||
#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"
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#endif
|
||||
|
||||
#include <gst/base/gstbasetransform.h>
|
||||
|
||||
#include "gstglviewconvert.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_view_convert_element_debug
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include "gstgtkglsink.h"
|
||||
#include "gtkgstglwidget.h"
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#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)
|
||||
|
|
|
@ -39,9 +39,16 @@
|
|||
#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)
|
||||
{
|
||||
|
|
|
@ -23,11 +23,8 @@
|
|||
#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,
|
||||
|
|
|
@ -29,10 +29,13 @@
|
|||
*/
|
||||
|
||||
#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) {
|
||||
|
|
|
@ -21,10 +21,7 @@
|
|||
#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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,9 +22,13 @@
|
|||
#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;
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -37,8 +37,13 @@
|
|||
|
||||
#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);
|
||||
|
|
|
@ -23,15 +23,9 @@
|
|||
#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
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
#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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -23,66 +23,6 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -23,11 +23,9 @@
|
|||
#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
|
||||
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <gst/gl/gstglbasememory.h>
|
||||
#include "gstglbasememory.h"
|
||||
|
||||
#include "gstglcontext.h"
|
||||
#include "gstglquery.h"
|
||||
|
||||
/**
|
||||
* SECTION:gstglbasememory
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "gstglbuffer.h"
|
||||
|
||||
#include "gstglcontext.h"
|
||||
#include "gstglfuncs.h"
|
||||
#include "gstglutils.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#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
|
||||
|
|
|
@ -22,8 +22,10 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gl.h"
|
||||
#include "gstglbufferpool.h"
|
||||
|
||||
#include "gstglmemory.h"
|
||||
#include "gstglsyncmeta.h"
|
||||
#include "gstglutils.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
#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
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gl.h"
|
||||
#include "gstglcolorconvert.h"
|
||||
|
||||
#include "gl.h"
|
||||
#include "gstglfuncs.h"
|
||||
#include "gstglsl_private.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,14 +40,16 @@
|
|||
#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
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <gst/gl/gl.h>
|
||||
#include <gst/gl/gstgl_fwd.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -22,12 +22,15 @@
|
|||
#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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,9 +24,11 @@
|
|||
|
||||
#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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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];
|
||||
};
|
||||
|
|
|
@ -32,8 +32,10 @@
|
|||
#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))
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
108
gst-libs/gst/gl/gstglfuncs.h
Normal file
108
gst-libs/gst/gl/gstglfuncs.h
Normal file
|
@ -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__ */
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -21,12 +21,8 @@
|
|||
#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
|
||||
|
||||
|
|
|
@ -25,9 +25,12 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -22,11 +22,6 @@
|
|||
#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
|
||||
|
|
|
@ -31,9 +31,14 @@
|
|||
|
||||
#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
|
||||
|
||||
|
|
|
@ -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];
|
||||
};
|
||||
|
|
|
@ -34,12 +34,13 @@
|
|||
#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
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define __GST_GL_QUERY_H__
|
||||
|
||||
#include <gst/gl/gstgl_fwd.h>
|
||||
#include <gst/gl/gstgldebug.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -24,10 +24,11 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -21,10 +21,6 @@
|
|||
#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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define __GST_GLSL_PRIVATE_H__
|
||||
|
||||
#include <gst/gl/gstgl_fwd.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
#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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,10 +34,19 @@
|
|||
#endif
|
||||
|
||||
#include "gstglviewconvert.h"
|
||||
#include "gstglsl_private.h"
|
||||
#include "gstglutils_private.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"
|
||||
|
||||
#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))
|
||||
|
|
|
@ -22,7 +22,10 @@
|
|||
#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())
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
|
||||
#include <gst/gl/gstgl_fwd.h>
|
||||
#include <gst/gl/gstgldisplay.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
#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
|
||||
|
||||
|
|
|
@ -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) \
|
||||
|
|
1
tests/check/libs/.gitignore
vendored
1
tests/check/libs/.gitignore
vendored
|
@ -12,3 +12,4 @@ gstglupload
|
|||
gstglcolorconvert
|
||||
gstglsl
|
||||
gstglquery
|
||||
gstglheaders
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
#include <gst/gl/gstglcontext.h>
|
||||
#include <gst/gl/gl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
173
tests/check/libs/gstglheaders.c
Normal file
173
tests/check/libs/gstglheaders.c
Normal file
|
@ -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);
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gl/gl.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gl/gl.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/gl/gl.h>
|
||||
#include <gst/gl/gstglfuncs.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#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>
|
||||
|
|
Loading…
Reference in a new issue