[642/906] add gstglconfig.h for apps to find out what our capabilites are

ie libgstgl can be compiled with any combination of opengl/gles2
This commit is contained in:
Matthew Waters 2013-01-10 01:13:23 +11:00
parent 4e60858f01
commit fa3c3b8434
29 changed files with 174 additions and 170 deletions

View file

@ -25,7 +25,7 @@
NULL, NULL,
#define GST_GL_EXT_END() #define GST_GL_EXT_END()
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static GstGLFuncs gst_gl = { static GstGLFuncs gst_gl = {
#include "glprototypes/opengl.h" #include "glprototypes/opengl.h"
{NULL,}, {NULL,},
@ -44,7 +44,7 @@ gst_gl_get_opengl_vtable (void)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static GstGLES2Funcs gst_gles2 = { static GstGLES2Funcs gst_gles2 = {
#include "glprototypes/gles1gles2.h" #include "glprototypes/gles1gles2.h"
{NULL,}, {NULL,},

View file

@ -21,17 +21,19 @@
#ifndef __GST_GL_API_H__ #ifndef __GST_GL_API_H__
#define __GST_GL_API_H__ #define __GST_GL_API_H__
#include "gstglconfig.h"
/* OpenGL 2.0 for Embedded Systems */ /* OpenGL 2.0 for Embedded Systems */
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
# include <GLES2/gl2.h> # include <GLES2/gl2.h>
# include <GLES2/gl2ext.h> # include <GLES2/gl2ext.h>
# if !HAVE_OPENGL # if !GST_GL_HAVE_OPENGL
# include "gstgles2.h" # include "gstgles2.h"
# endif # endif
#endif #endif
/* OpenGL for desktop systems */ /* OpenGL for desktop systems */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
# if __APPLE__ # if __APPLE__
# include <GL/glew.h> # include <GL/glew.h>
# include <OpenGL/OpenGL.h> # include <OpenGL/OpenGL.h>
@ -73,7 +75,7 @@ typedef enum
ret (*name) args; ret (*name) args;
#define GST_GL_EXT_END() #define GST_GL_EXT_END()
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
typedef struct _GstGLFuncs typedef struct _GstGLFuncs
{ {
#include "glprototypes/opengl.h" #include "glprototypes/opengl.h"
@ -89,7 +91,7 @@ typedef struct _GstGLFuncs
const GstGLFuncs *gst_gl_get_opengl_vtable (void); const GstGLFuncs *gst_gl_get_opengl_vtable (void);
#endif #endif
#if GST_GL_GLES2 #if GST_GL_HAVE_GLES2
typedef struct _GstGLES2Funcs typedef struct _GstGLES2Funcs
{ {
#include "glprototypes/gles1gles2.h" #include "glprototypes/gles1gles2.h"

View file

@ -67,7 +67,7 @@ static void gst_gl_display_finalize (GObject * object);
gpointer gst_gl_display_thread_create_context (GstGLDisplay * display); gpointer gst_gl_display_thread_create_context (GstGLDisplay * display);
void gst_gl_display_thread_destroy_context (GstGLDisplay * display); void gst_gl_display_thread_destroy_context (GstGLDisplay * display);
void gst_gl_display_thread_run_generic (GstGLDisplay * display); void gst_gl_display_thread_run_generic (GstGLDisplay * display);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void gst_gl_display_thread_init_redisplay (GstGLDisplay * display); void gst_gl_display_thread_init_redisplay (GstGLDisplay * display);
#endif #endif
void gst_gl_display_thread_gen_fbo (GstGLDisplay * display); void gst_gl_display_thread_gen_fbo (GstGLDisplay * display);
@ -88,7 +88,7 @@ void gst_gl_display_del_texture_thread (GstGLDisplay * display,
void gst_gl_display_gen_texture_window_cb (GstGLDisplay * display); void gst_gl_display_gen_texture_window_cb (GstGLDisplay * display);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void _gen_fbo_opengl (GstGLDisplay * display); void _gen_fbo_opengl (GstGLDisplay * display);
void _use_fbo_opengl (GstGLDisplay * display); void _use_fbo_opengl (GstGLDisplay * display);
void _use_fbo_v2_opengl (GstGLDisplay * display); void _use_fbo_v2_opengl (GstGLDisplay * display);
@ -96,7 +96,7 @@ void _del_fbo_opengl (GstGLDisplay * display);
void _gen_shader_opengl (GstGLDisplay * display); void _gen_shader_opengl (GstGLDisplay * display);
void _del_shader_opengl (GstGLDisplay * display); void _del_shader_opengl (GstGLDisplay * display);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void _gen_fbo_gles2 (GstGLDisplay * display); void _gen_fbo_gles2 (GstGLDisplay * display);
void _use_fbo_gles2 (GstGLDisplay * display); void _use_fbo_gles2 (GstGLDisplay * display);
void _use_fbo_v2_gles2 (GstGLDisplay * display); void _use_fbo_v2_gles2 (GstGLDisplay * display);
@ -154,7 +154,7 @@ gst_gl_display_init (GstGLDisplay * display)
display->redisplay_texture_width = 0; display->redisplay_texture_width = 0;
display->redisplay_texture_height = 0; display->redisplay_texture_height = 0;
display->keep_aspect_ratio = FALSE; display->keep_aspect_ratio = FALSE;
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
display->redisplay_shader = NULL; display->redisplay_shader = NULL;
display->redisplay_attr_position_loc = 0; display->redisplay_attr_position_loc = 0;
display->redisplay_attr_texture_loc = 0; display->redisplay_attr_texture_loc = 0;
@ -213,7 +213,7 @@ gst_gl_display_init (GstGLDisplay * display)
display->uploads = NULL; display->uploads = NULL;
display->downloads = NULL; display->downloads = NULL;
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
/* *INDENT-OFF* */ /* *INDENT-OFF* */
display->redisplay_vertex_shader_str_gles2 = display->redisplay_vertex_shader_str_gles2 =
"attribute vec4 a_position; \n" "attribute vec4 a_position; \n"
@ -336,7 +336,7 @@ gst_gl_display_set_error (GstGLDisplay * display, const char *format, ...)
display->isAlive = FALSE; display->isAlive = FALSE;
} }
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static gboolean static gboolean
_create_context_gles2 (GstGLDisplay * display, gint * gl_major, gint * gl_minor) _create_context_gles2 (GstGLDisplay * display, gint * gl_major, gint * gl_minor)
{ {
@ -375,7 +375,7 @@ _create_context_gles2 (GstGLDisplay * display, gint * gl_major, gint * gl_minor)
} }
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
gboolean gboolean
_create_context_opengl (GstGLDisplay * display, gint * gl_major, gint * gl_minor) _create_context_opengl (GstGLDisplay * display, gint * gl_major, gint * gl_minor)
{ {
@ -439,10 +439,10 @@ _compiled_api (void)
{ {
GstGLAPI ret = GST_GL_API_NONE; GstGLAPI ret = GST_GL_API_NONE;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
ret |= GST_GL_API_OPENGL; ret |= GST_GL_API_OPENGL;
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
ret |= GST_GL_API_GLES2; ret |= GST_GL_API_GLES2;
#endif #endif
@ -493,11 +493,11 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
g_free (compiled_api_s); g_free (compiled_api_s);
/* gl api specific code */ /* gl api specific code */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (!ret && USING_OPENGL(display)) if (!ret && USING_OPENGL(display))
ret = _create_context_opengl (display, &gl_major, NULL); ret = _create_context_opengl (display, &gl_major, NULL);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (!ret && USING_GLES2(display)) if (!ret && USING_GLES2(display))
ret = _create_context_gles2 (display, &gl_major, NULL); ret = _create_context_gles2 (display, &gl_major, NULL);
#endif #endif
@ -555,7 +555,7 @@ failure:
void void
gst_gl_display_thread_destroy_context (GstGLDisplay * display) gst_gl_display_thread_destroy_context (GstGLDisplay * display)
{ {
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (display->redisplay_shader) { if (display->redisplay_shader) {
g_object_unref (G_OBJECT (display->redisplay_shader)); g_object_unref (G_OBJECT (display->redisplay_shader));
display->redisplay_shader = NULL; display->redisplay_shader = NULL;
@ -575,7 +575,7 @@ gst_gl_display_thread_run_generic (GstGLDisplay * display)
display->generic_callback (display, display->data); display->generic_callback (display, display->data);
} }
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
/* Called in the gl thread */ /* Called in the gl thread */
void void
gst_gl_display_thread_init_redisplay (GstGLDisplay * display) gst_gl_display_thread_init_redisplay (GstGLDisplay * display)
@ -605,7 +605,7 @@ gst_gl_display_thread_init_redisplay (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
_gen_fbo_opengl (GstGLDisplay * display) _gen_fbo_opengl (GstGLDisplay * display)
{ {
@ -671,7 +671,7 @@ _gen_fbo_opengl (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_gen_fbo_gles2 (GstGLDisplay * display) _gen_fbo_gles2 (GstGLDisplay * display)
{ {
@ -732,7 +732,7 @@ _gen_fbo_gles2 (GstGLDisplay * display)
#endif #endif
/* Called in the gl thread */ /* Called in the gl thread */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
_use_fbo_opengl (GstGLDisplay * display) _use_fbo_opengl (GstGLDisplay * display)
{ {
@ -801,7 +801,7 @@ _use_fbo_opengl (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_use_fbo_gles2 (GstGLDisplay * display) _use_fbo_gles2 (GstGLDisplay * display)
{ {
@ -842,7 +842,7 @@ _use_fbo_gles2 (GstGLDisplay * display)
/* Called in a gl thread /* Called in a gl thread
* Need full shader support */ * Need full shader support */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
_use_fbo_v2_opengl (GstGLDisplay * display) _use_fbo_v2_opengl (GstGLDisplay * display)
{ {
@ -882,7 +882,7 @@ _use_fbo_v2_opengl (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_use_fbo_v2_gles2 (GstGLDisplay * display) _use_fbo_v2_gles2 (GstGLDisplay * display)
{ {
@ -919,7 +919,7 @@ _use_fbo_v2_gles2 (GstGLDisplay * display)
#endif #endif
/* Called in the gl thread */ /* Called in the gl thread */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
_del_fbo_opengl (GstGLDisplay * display) _del_fbo_opengl (GstGLDisplay * display)
{ {
@ -936,7 +936,7 @@ _del_fbo_opengl (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_del_fbo_gles2 (GstGLDisplay * display) _del_fbo_gles2 (GstGLDisplay * display)
{ {
@ -991,7 +991,7 @@ _gen_shader_opengl (GstGLDisplay * display)
} }
} }
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_gen_shader_gles2 (GstGLDisplay * display) _gen_shader_gles2 (GstGLDisplay * display)
{ {
@ -1031,7 +1031,7 @@ _gen_shader_gles2 (GstGLDisplay * display)
#endif #endif
/* Called in the gl thread */ /* Called in the gl thread */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
_del_shader_opengl (GstGLDisplay * display) _del_shader_opengl (GstGLDisplay * display)
{ {
@ -1044,7 +1044,7 @@ _del_shader_opengl (GstGLDisplay * display)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
void void
_del_shader_gles2 (GstGLDisplay * display) _del_shader_gles2 (GstGLDisplay * display)
{ {
@ -1096,7 +1096,7 @@ gst_gl_display_on_resize (GstGLDisplay * display, gint width, gint height)
} else { } else {
glViewport (0, 0, width, height); glViewport (0, 0, width, height);
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) { if (USING_OPENGL(display)) {
glMatrixMode (GL_PROJECTION); glMatrixMode (GL_PROJECTION);
glLoadIdentity (); glLoadIdentity ();
@ -1122,7 +1122,7 @@ gst_gl_display_on_draw (GstGLDisplay * display)
if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL) if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL)
glUseProgramObjectARB (0); glUseProgramObjectARB (0);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) if (USING_OPENGL(display))
glDisable (GL_TEXTURE_RECTANGLE_ARB); glDisable (GL_TEXTURE_RECTANGLE_ARB);
#endif #endif
@ -1142,7 +1142,7 @@ gst_gl_display_on_draw (GstGLDisplay * display)
} }
/* default opengl scene */ /* default opengl scene */
else { else {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) { if (USING_OPENGL(display)) {
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -1177,7 +1177,7 @@ gst_gl_display_on_draw (GstGLDisplay * display)
glDisable (GL_TEXTURE_RECTANGLE_ARB); glDisable (GL_TEXTURE_RECTANGLE_ARB);
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2(display)) { if (USING_GLES2(display)) {
const GLfloat vVertices[] = { 1.0f, 1.0f, 0.0f, const GLfloat vVertices[] = { 1.0f, 1.0f, 0.0f,
1.0f, 0.0f, 1.0f, 0.0f,
@ -1355,7 +1355,7 @@ gst_gl_display_check_framebuffer_status (void)
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break; break;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
case GL_FRAMEBUFFER_UNDEFINED: case GL_FRAMEBUFFER_UNDEFINED:
GST_ERROR ("GL_FRAMEBUFFER_UNDEFINED"); GST_ERROR ("GL_FRAMEBUFFER_UNDEFINED");
break; break;
@ -1413,7 +1413,7 @@ gst_gl_display_redisplay (GstGLDisplay * display, GLuint texture,
gst_gl_display_lock (display); gst_gl_display_lock (display);
if (display->isAlive) { if (display->isAlive) {
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2(display)) { if (USING_GLES2(display)) {
if (!display->redisplay_shader) { if (!display->redisplay_shader) {
gst_gl_window_send_message (display->gl_window, gst_gl_window_send_message (display->gl_window,

View file

@ -23,6 +23,8 @@
#ifndef __GST_GL_H__ #ifndef __GST_GL_H__
#define __GST_GL_H__ #define __GST_GL_H__
#include "gstglconfig.h"
#include <gst/video/video.h> #include <gst/video/video.h>
typedef struct _GstGLUpload GstGLUpload; typedef struct _GstGLUpload GstGLUpload;
@ -159,7 +161,7 @@ struct _GstGLDisplay
GLuint redisplay_texture_width; GLuint redisplay_texture_width;
GLuint redisplay_texture_height; GLuint redisplay_texture_height;
gboolean keep_aspect_ratio; gboolean keep_aspect_ratio;
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
GstGLShader *redisplay_shader; GstGLShader *redisplay_shader;
gchar *redisplay_vertex_shader_str_gles2; gchar *redisplay_vertex_shader_str_gles2;
gchar *redisplay_fragment_shader_str_gles2; gchar *redisplay_fragment_shader_str_gles2;

View file

@ -58,13 +58,13 @@ static gboolean gst_gl_download_perform_with_data_unlocked (GstGLDownload *
static gboolean gst_gl_download_perform_with_data_unlocked_thread (GstGLDownload static gboolean gst_gl_download_perform_with_data_unlocked_thread (GstGLDownload
* download, GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]); * download, GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void _do_download_draw_rgb_opengl (GstGLDisplay * display, static void _do_download_draw_rgb_opengl (GstGLDisplay * display,
GstGLDownload * download); GstGLDownload * download);
static void _do_download_draw_yuv_opengl (GstGLDisplay * display, static void _do_download_draw_yuv_opengl (GstGLDisplay * display,
GstGLDownload * download); GstGLDownload * download);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void _do_download_draw_rgb_gles2 (GstGLDisplay * display, static void _do_download_draw_rgb_gles2 (GstGLDisplay * display,
GstGLDownload * download); GstGLDownload * download);
static void _do_download_draw_yuv_gles2 (GstGLDisplay * display, static void _do_download_draw_yuv_gles2 (GstGLDisplay * display,
@ -75,7 +75,7 @@ static void _do_download_draw_yuv_gles2 (GstGLDisplay * display,
/* YUY2:y2,u,y1,v /* YUY2:y2,u,y1,v
UYVY:v,y1,u,y2 */ UYVY:v,y1,u,y2 */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static gchar *text_shader_YUY2_UYVY_opengl = static gchar *text_shader_YUY2_UYVY_opengl =
"#extension GL_ARB_texture_rectangle : enable\n" "#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex;\n" "uniform sampler2DRect tex;\n"
@ -144,9 +144,9 @@ static gchar *text_shader_AYUV_opengl =
"}\n"; "}\n";
#define text_vertex_shader_opengl NULL #define text_vertex_shader_opengl NULL
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static gchar *text_shader_YUY2_UYVY_gles2 = static gchar *text_shader_YUY2_UYVY_gles2 =
"precision mediump float;\n" "precision mediump float;\n"
"varying vec2 v_texCoord;\n" "varying vec2 v_texCoord;\n"
@ -214,7 +214,7 @@ static gchar *text_shader_RGB_gles2 =
"{ \n" "{ \n"
" gl_FragColor = texture2D( s_texture, v_texCoord );\n" " gl_FragColor = texture2D( s_texture, v_texCoord );\n"
"} \n"; "} \n";
#endif /* HAVE_GLES2 */ #endif /* GST_GL_HAVE_GLES2 */
/* *INDENT-ON* */ /* *INDENT-ON* */
@ -288,7 +288,7 @@ gst_gl_download_new (GstGLDisplay * display)
download->display = g_object_ref (display); download->display = g_object_ref (display);
priv = download->priv; priv = download->priv;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_opengl; priv->YUY2_UYVY = text_shader_YUY2_UYVY_opengl;
priv->I420_YV12 = text_shader_I420_YV12_opengl; priv->I420_YV12 = text_shader_I420_YV12_opengl;
@ -298,7 +298,7 @@ gst_gl_download_new (GstGLDisplay * display)
priv->do_yuv = _do_download_draw_yuv_opengl; priv->do_yuv = _do_download_draw_yuv_opengl;
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_gles2; priv->YUY2_UYVY = text_shader_YUY2_UYVY_gles2;
priv->I420_YV12 = text_shader_I420_YV12_gles2; priv->I420_YV12 = text_shader_I420_YV12_gles2;
@ -781,7 +781,7 @@ _init_download (GstGLDisplay * display, GstGLDownload * download)
/* setup the render buffer for depth */ /* setup the render buffer for depth */
glGenRenderbuffersEXT (1, &download->depth_buffer); glGenRenderbuffersEXT (1, &download->depth_buffer);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, download->depth_buffer); glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, download->depth_buffer);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
out_width, out_height); out_width, out_height);
@ -789,7 +789,7 @@ _init_download (GstGLDisplay * display, GstGLDownload * download)
out_width, out_height); out_width, out_height);
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
out_width, out_height); out_width, out_height);
@ -859,7 +859,7 @@ _init_download (GstGLDisplay * display, GstGLDownload * download)
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, download->depth_buffer); GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, download->depth_buffer);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT,
@ -936,7 +936,7 @@ _init_download_shader (GstGLDisplay * display, GstGLDownload * download)
case GST_VIDEO_FORMAT_RGB: case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR: case GST_VIDEO_FORMAT_BGR:
/* color space conversion is not needed */ /* color space conversion is not needed */
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
{ {
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
/* glGetTexImage2D not available in OpenGL ES 2.0 */ /* glGetTexImage2D not available in OpenGL ES 2.0 */
@ -1093,7 +1093,7 @@ _do_download (GstGLDisplay * display, GstGLDownload * download)
} }
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void static void
_do_download_draw_rgb_opengl (GstGLDisplay * display, GstGLDownload * download) _do_download_draw_rgb_opengl (GstGLDisplay * display, GstGLDownload * download)
{ {
@ -1159,7 +1159,7 @@ _do_download_draw_rgb_opengl (GstGLDisplay * display, GstGLDownload * download)
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void static void
_do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download) _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
{ {
@ -1243,7 +1243,7 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
} }
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void static void
_do_download_draw_yuv_opengl (GstGLDisplay * display, GstGLDownload * download) _do_download_draw_yuv_opengl (GstGLDisplay * display, GstGLDownload * download)
{ {
@ -1428,7 +1428,7 @@ _do_download_draw_yuv_opengl (GstGLDisplay * display, GstGLDownload * download)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void static void
_do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download) _do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
{ {

View file

@ -98,12 +98,12 @@ struct _GstGLDownloadClass
* *
* The currently supported formats that can be downloaded * The currently supported formats that can be downloaded
*/ */
#if !HAVE_GLES2 #if !GST_GL_HAVE_GLES2
# define GST_GL_DOWNLOAD_FORMATS "{ RGB, RGBx, RGBA, BGR, BGRx, BGRA, xRGB, " \ # define GST_GL_DOWNLOAD_FORMATS "{ RGB, RGBx, RGBA, BGR, BGRx, BGRA, xRGB, " \
"xBGR, ARGB, ABGR, I420, YV12, YUY2, UYVY, AYUV }" "xBGR, ARGB, ABGR, I420, YV12, YUY2, UYVY, AYUV }"
#else /* HAVE_GLES2 */ #else /* GST_GL_HAVE_GLES2 */
# define GST_GL_DOWNLOAD_FORMATS "{ RGB, RGBx, RGBA, I420, YV12, YUY2, UYVY, AYUV }" # define GST_GL_DOWNLOAD_FORMATS "{ RGB, RGBx, RGBA, I420, YV12, YUY2, UYVY, AYUV }"
#endif /* !HAVE_GLES2 */ #endif /* !GST_GL_HAVE_GLES2 */
/** /**
* GST_GL_DOWNLOAD_VIDEO_CAPS: * GST_GL_DOWNLOAD_VIDEO_CAPS:

View file

@ -54,7 +54,7 @@ gst_gl_check_extension (const char *name, const gchar * ext)
/* Define a set of arrays containing the functions required from GL /* Define a set of arrays containing the functions required from GL
for each feature */ for each feature */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
#define GST_GL_EXT_BEGIN(name, \ #define GST_GL_EXT_BEGIN(name, \
min_gl_major, min_gl_minor, \ min_gl_major, min_gl_minor, \
gles_availability, \ gles_availability, \
@ -83,13 +83,13 @@ gst_gl_check_extension (const char *name, const gchar * ext)
static const GstGLFeatureData gst_gl_feature_ext_functions_data_opengl[] = { static const GstGLFeatureData gst_gl_feature_ext_functions_data_opengl[] = {
#include "glprototypes/opengl_functions.h" #include "glprototypes/opengl_functions.h"
}; };
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
#undef GST_GL_EXT_BEGIN #undef GST_GL_EXT_BEGIN
#undef GST_GL_EXT_FUNCTION #undef GST_GL_EXT_FUNCTION
#undef GST_GL_EXT_END #undef GST_GL_EXT_END
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
#define GST_GL_EXT_BEGIN(name, \ #define GST_GL_EXT_BEGIN(name, \
min_gl_major, min_gl_minor, \ min_gl_major, min_gl_minor, \
gles_availability, \ gles_availability, \
@ -118,7 +118,7 @@ static const GstGLFeatureData gst_gl_feature_ext_functions_data_opengl[] = {
static const GstGLFeatureData gst_gl_feature_ext_functions_data_gles2[] = { static const GstGLFeatureData gst_gl_feature_ext_functions_data_gles2[] = {
#include "glprototypes/gles2_functions.h" #include "glprototypes/gles2_functions.h"
}; };
#endif /* HAVE_GLES2 */ #endif /* GST_GL_HAVE_GLES2 */
#undef GST_GL_EXT_BEGIN #undef GST_GL_EXT_BEGIN
#undef GST_GL_EXT_FUNCTION #undef GST_GL_EXT_FUNCTION
@ -132,18 +132,18 @@ _gst_gl_feature_check (GstGLDisplay * display,
{ {
const char *suffix = NULL; const char *suffix = NULL;
int func_num; int func_num;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static const GstGLFuncs *gst_gl = NULL; static const GstGLFuncs *gst_gl = NULL;
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static const GstGLES2Funcs *gst_gles2 = NULL; static const GstGLES2Funcs *gst_gles2 = NULL;
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (!gst_gl) if (!gst_gl)
gst_gl = gst_gl_get_opengl_vtable (); gst_gl = gst_gl_get_opengl_vtable ();
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (!gst_gles2) if (!gst_gles2)
gst_gles2 = gst_gl_get_gles2_vtable (); gst_gles2 = gst_gl_get_gles2_vtable ();
#endif #endif
@ -219,13 +219,13 @@ _gst_gl_feature_check (GstGLDisplay * display,
goto error; goto error;
/* Set the function pointer in the context */ /* Set the function pointer in the context */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (display->gl_api & GST_GL_API_OPENGL) { if (display->gl_api & GST_GL_API_OPENGL) {
*(void **) ((guint8 *) gst_gl + *(void **) ((guint8 *) gst_gl +
data->functions[func_num].pointer_offset) = func; data->functions[func_num].pointer_offset) = func;
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) { if (display->gl_api & GST_GL_API_GLES2) {
*(void **) ((guint8 *) gst_gles2 + *(void **) ((guint8 *) gst_gles2 +
data->functions[func_num].pointer_offset) = func; data->functions[func_num].pointer_offset) = func;
@ -240,13 +240,13 @@ _gst_gl_feature_check (GstGLDisplay * display,
* do feature testing by just looking at the function pointers */ * do feature testing by just looking at the function pointers */
error: error:
for (func_num = 0; data->functions[func_num].name; func_num++) { for (func_num = 0; data->functions[func_num].name; func_num++) {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (display->gl_api & GST_GL_API_OPENGL) { if (display->gl_api & GST_GL_API_OPENGL) {
*(void **) ((guint8 *) gst_gl + *(void **) ((guint8 *) gst_gl +
data->functions[func_num].pointer_offset) = NULL; data->functions[func_num].pointer_offset) = NULL;
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) { if (display->gl_api & GST_GL_API_GLES2) {
*(void **) ((guint8 *) gst_gles2 + *(void **) ((guint8 *) gst_gles2 +
data->functions[func_num].pointer_offset) = NULL; data->functions[func_num].pointer_offset) = NULL;
@ -263,7 +263,7 @@ _gst_gl_feature_check_ext_functions (GstGLDisplay * display,
{ {
int i; int i;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (display->gl_api & GST_GL_API_OPENGL) { if (display->gl_api & GST_GL_API_OPENGL) {
for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_opengl); for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_opengl);
i++) i++)
@ -272,7 +272,7 @@ _gst_gl_feature_check_ext_functions (GstGLDisplay * display,
gl_extensions); gl_extensions);
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) { if (display->gl_api & GST_GL_API_GLES2) {
for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_gles2); i++) for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_gles2); i++)
_gst_gl_feature_check (display, "GL", _gst_gl_feature_check (display, "GL",

View file

@ -1075,7 +1075,7 @@ gst_gl_filter_render_to_target (GstGLFilter * filter, gboolean resize,
in_width, 0, in_height, GST_GL_DISPLAY_PROJECTION_ORTHO2D, data); in_width, 0, in_height, GST_GL_DISPLAY_PROJECTION_ORTHO2D, data);
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void static void
_draw_with_shader_cb (gint width, gint height, guint texture, gpointer stuff) _draw_with_shader_cb (gint width, gint height, guint texture, gpointer stuff)
{ {
@ -1156,4 +1156,4 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
glEnd (); glEnd ();
} }
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */

View file

@ -124,12 +124,12 @@ gboolean gst_gl_filter_filter_texture (GstGLFilter * filter, GstBuffer * inbuf,
void gst_gl_filter_render_to_target (GstGLFilter *filter, gboolean resize, GLuint input, void gst_gl_filter_render_to_target (GstGLFilter *filter, gboolean resize, GLuint input,
GLuint target, GLCB func, gpointer data); GLuint target, GLCB func, gpointer data);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void gst_gl_filter_render_to_target_with_shader (GstGLFilter * filter, gboolean resize, void gst_gl_filter_render_to_target_with_shader (GstGLFilter * filter, gboolean resize,
GLuint input, GLuint target, GstGLShader *shader); GLuint input, GLuint target, GstGLShader *shader);
void gst_gl_filter_draw_texture (GstGLFilter *filter, GLuint texture, guint width, guint height); void gst_gl_filter_draw_texture (GstGLFilter *filter, GLuint texture, guint width, guint height);
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
G_END_DECLS G_END_DECLS

View file

@ -226,7 +226,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
glGenRenderbuffersEXT (1, &rboId); glGenRenderbuffersEXT (1, &rboId);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, rboId); glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, rboId);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width,
height); height);
@ -234,7 +234,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
width, height); width, height);
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
width, height); width, height);
@ -244,7 +244,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rboId); GL_RENDERBUFFER_EXT, rboId);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboId); GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboId);
@ -277,7 +277,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
GST_CAT_ERROR (GST_CAT_GL_MEMORY, GST_CAT_ERROR (GST_CAT_GL_MEMORY,
"GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break; break;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
case GL_FRAMEBUFFER_UNDEFINED: case GL_FRAMEBUFFER_UNDEFINED:
GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GL_FRAMEBUFFER_UNDEFINED"); GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GL_FRAMEBUFFER_UNDEFINED");
break; break;

View file

@ -303,12 +303,12 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
glGetObjectParameterivARB (priv->vertex_handle, glGetObjectParameterivARB (priv->vertex_handle,
GL_OBJECT_COMPILE_STATUS_ARB, &status); GL_OBJECT_COMPILE_STATUS_ARB, &status);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display)) if (USING_OPENGL (shader->display))
glGetInfoLogARB (priv->vertex_handle, glGetInfoLogARB (priv->vertex_handle,
sizeof (info_buffer) - 1, &len, info_buffer); sizeof (info_buffer) - 1, &len, info_buffer);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display)) if (USING_GLES2 (shader->display))
glGetShaderInfoLog (priv->vertex_handle, glGetShaderInfoLog (priv->vertex_handle,
sizeof (info_buffer) - 1, &len, info_buffer); sizeof (info_buffer) - 1, &len, info_buffer);
@ -342,12 +342,12 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
glGetObjectParameterivARB (priv->fragment_handle, glGetObjectParameterivARB (priv->fragment_handle,
GL_OBJECT_COMPILE_STATUS_ARB, &status); GL_OBJECT_COMPILE_STATUS_ARB, &status);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display)) if (USING_OPENGL (shader->display))
glGetInfoLogARB (priv->fragment_handle, glGetInfoLogARB (priv->fragment_handle,
sizeof (info_buffer) - 1, &len, info_buffer); sizeof (info_buffer) - 1, &len, info_buffer);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display)) if (USING_GLES2 (shader->display))
glGetShaderInfoLog (priv->fragment_handle, glGetShaderInfoLog (priv->fragment_handle,
sizeof (info_buffer) - 1, &len, info_buffer); sizeof (info_buffer) - 1, &len, info_buffer);
@ -372,11 +372,11 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* if nothing failed link shaders */ /* if nothing failed link shaders */
glLinkProgramARB (priv->program_handle); glLinkProgramARB (priv->program_handle);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display)) if (USING_OPENGL (shader->display))
glGetObjectParameterivARB (priv->program_handle, GL_LINK_STATUS, &status); glGetObjectParameterivARB (priv->program_handle, GL_LINK_STATUS, &status);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display)) if (USING_GLES2 (shader->display))
glGetProgramiv (priv->program_handle, GL_LINK_STATUS, &status); glGetProgramiv (priv->program_handle, GL_LINK_STATUS, &status);
#endif #endif
@ -419,11 +419,11 @@ gst_gl_shader_release (GstGLShader * shader)
if (priv->vertex_handle) { /* not needed but nvidia doesn't care to respect the spec */ if (priv->vertex_handle) { /* not needed but nvidia doesn't care to respect the spec */
GST_TRACE ("finalizing vertex shader %u", priv->vertex_handle); GST_TRACE ("finalizing vertex shader %u", priv->vertex_handle);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display)) if (USING_OPENGL (shader->display))
glDeleteObjectARB (priv->vertex_handle); glDeleteObjectARB (priv->vertex_handle);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display)) if (USING_GLES2 (shader->display))
glDeleteShader (priv->vertex_handle); glDeleteShader (priv->vertex_handle);
#endif #endif
@ -438,11 +438,11 @@ gst_gl_shader_release (GstGLShader * shader)
GST_TRACE ("finalizing fragment shader %u", priv->fragment_handle); GST_TRACE ("finalizing fragment shader %u", priv->fragment_handle);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display)) if (USING_OPENGL (shader->display))
glDeleteObjectARB (priv->fragment_handle); glDeleteObjectARB (priv->fragment_handle);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display)) if (USING_GLES2 (shader->display))
glDeleteShader (priv->fragment_handle); glDeleteShader (priv->fragment_handle);
#endif #endif
@ -820,7 +820,7 @@ gst_gl_shader_set_uniform_matrix_4fv (GstGLShader * shader, const gchar * name,
glUniformMatrix4fvARB (location, count, transpose, value); glUniformMatrix4fvARB (location, count, transpose, value);
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void void
gst_gl_shader_set_uniform_matrix_2x3fv (GstGLShader * shader, gst_gl_shader_set_uniform_matrix_2x3fv (GstGLShader * shader,
const gchar * name, gint count, gboolean transpose, const gfloat * value) const gchar * name, gint count, gboolean transpose, const gfloat * value)
@ -916,7 +916,7 @@ gst_gl_shader_set_uniform_matrix_4x3fv (GstGLShader * shader,
glUniformMatrix4x3fv (location, count, transpose, value); glUniformMatrix4x3fv (location, count, transpose, value);
} }
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
GLint GLint
gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name) gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name)

View file

@ -105,7 +105,7 @@ void gst_gl_shader_set_uniform_4fv (GstGLShader *shader, const gchar *n
void gst_gl_shader_set_uniform_matrix_2fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_2fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);
void gst_gl_shader_set_uniform_matrix_3fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_3fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);
void gst_gl_shader_set_uniform_matrix_4fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_4fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
void gst_gl_shader_set_uniform_matrix_2x3fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_2x3fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);
void gst_gl_shader_set_uniform_matrix_2x4fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_2x4fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);
void gst_gl_shader_set_uniform_matrix_3x2fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value); void gst_gl_shader_set_uniform_matrix_3x2fv (GstGLShader *shader, const gchar *name, gint count, gboolean transpose, const gfloat* value);

View file

@ -566,7 +566,7 @@ gst_gl_shadervariable_set (GstGLShader * shader,
(float *) ret->value); (float *) ret->value);
break; break;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
case _mat2x3: case _mat2x3:
gst_gl_shader_set_uniform_matrix_2x3fv (shader, ret->name, ret->count, 0, gst_gl_shader_set_uniform_matrix_2x3fv (shader, ret->name, ret->count, 0,
(float *) ret->value); (float *) ret->value);

View file

@ -59,18 +59,18 @@ static gboolean gst_gl_upload_perform_with_data_unlocked (GstGLUpload * upload,
static gboolean gst_gl_upload_perform_with_data_unlocked_thread (GstGLUpload * static gboolean gst_gl_upload_perform_with_data_unlocked_thread (GstGLUpload *
upload, GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]); upload, GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void _do_upload_draw_opengl (GstGLDisplay * display, static void _do_upload_draw_opengl (GstGLDisplay * display,
GstGLUpload * upload); GstGLUpload * upload);
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void _do_upload_draw_gles2 (GstGLDisplay * display, static void _do_upload_draw_gles2 (GstGLDisplay * display,
GstGLUpload * upload); GstGLUpload * upload);
#endif #endif
/* *INDENT-OFF* */ /* *INDENT-OFF* */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
/* YUY2:r,g,a /* YUY2:r,g,a
UYVY:a,b,r */ UYVY:a,b,r */
static gchar *text_shader_YUY2_UYVY_opengl = static gchar *text_shader_YUY2_UYVY_opengl =
@ -133,7 +133,7 @@ static gchar *text_shader_AYUV_opengl =
#define text_vertex_shader_opengl NULL #define text_vertex_shader_opengl NULL
#endif #endif
#ifdef HAVE_GLES2 #if GST_GL_HAVE_GLES2
/* YUY2:r,g,a /* YUY2:r,g,a
UYVY:a,b,r */ UYVY:a,b,r */
static gchar *text_shader_YUY2_UYVY_gles2 = static gchar *text_shader_YUY2_UYVY_gles2 =
@ -276,7 +276,7 @@ gst_gl_upload_new (GstGLDisplay * display)
g_mutex_init (&upload->lock); g_mutex_init (&upload->lock);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_opengl; priv->YUY2_UYVY = text_shader_YUY2_UYVY_opengl;
priv->I420_YV12 = text_shader_I420_YV12_opengl; priv->I420_YV12 = text_shader_I420_YV12_opengl;
@ -285,7 +285,7 @@ gst_gl_upload_new (GstGLDisplay * display)
priv->draw = _do_upload_draw_opengl; priv->draw = _do_upload_draw_opengl;
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_gles2; priv->YUY2_UYVY = text_shader_YUY2_UYVY_gles2;
priv->I420_YV12 = text_shader_I420_YV12_gles2; priv->I420_YV12 = text_shader_I420_YV12_gles2;
@ -795,13 +795,13 @@ _init_upload (GstGLDisplay * display, GstGLUpload * upload)
case GST_VIDEO_FORMAT_UYVY: case GST_VIDEO_FORMAT_UYVY:
{ {
gchar text_shader_UYVY[2048]; gchar text_shader_UYVY[2048];
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY, sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY,
'a', 'b', 'r'); 'a', 'b', 'r');
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY, sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY,
'a', 'r', 'b'); 'a', 'r', 'b');
@ -825,7 +825,7 @@ _init_upload (GstGLDisplay * display, GstGLUpload * upload)
case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_YV12:
{ {
gchar text_shader_I420_YV12[2048]; gchar text_shader_I420_YV12[2048];
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
if ((g_ascii_strncasecmp ("ATI", if ((g_ascii_strncasecmp ("ATI",
(gchar *) glGetString (GL_VENDOR), 3) == 0) (gchar *) glGetString (GL_VENDOR), 3) == 0)
@ -840,7 +840,7 @@ _init_upload (GstGLDisplay * display, GstGLUpload * upload)
"*0.5"); "*0.5");
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) if (USING_GLES2 (display))
g_strlcpy (text_shader_I420_YV12, upload->priv->I420_YV12, 2048); g_strlcpy (text_shader_I420_YV12, upload->priv->I420_YV12, 2048);
#endif #endif
@ -959,7 +959,7 @@ _init_upload_fbo (GstGLDisplay * display, GstGLUpload * upload)
/* setup the render buffer for depth */ /* setup the render buffer for depth */
glGenRenderbuffersEXT (1, &upload->depth_buffer); glGenRenderbuffersEXT (1, &upload->depth_buffer);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, upload->depth_buffer); glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, upload->depth_buffer);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
out_width, out_height); out_width, out_height);
@ -967,7 +967,7 @@ _init_upload_fbo (GstGLDisplay * display, GstGLUpload * upload)
out_width, out_height); out_width, out_height);
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) { if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
out_width, out_height); out_width, out_height);
@ -994,7 +994,7 @@ _init_upload_fbo (GstGLDisplay * display, GstGLUpload * upload)
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, upload->depth_buffer); GL_RENDERBUFFER_EXT, upload->depth_buffer);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) { if (USING_OPENGL (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, upload->depth_buffer); GL_RENDERBUFFER_EXT, upload->depth_buffer);
@ -1379,7 +1379,7 @@ _do_upload_fill (GstGLDisplay * display, GstGLUpload * upload)
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0); glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
/* called by _do_upload (in the gl thread) */ /* called by _do_upload (in the gl thread) */
static void static void
_do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload) _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
@ -1625,7 +1625,7 @@ _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void static void
_do_upload_draw_gles2 (GstGLDisplay * display, GstGLUpload * upload) _do_upload_draw_gles2 (GstGLDisplay * display, GstGLUpload * upload)
{ {

View file

@ -101,12 +101,12 @@ struct _GstGLUploadClass
* *
* The currently supported formats that can be uploaded * The currently supported formats that can be uploaded
*/ */
#if !HAVE_GLES2 #if !GST_GL_HAVE_GLES2
#define GST_GL_UPLOAD_FORMATS "{ RGB, RGBx, RGBA, BGR, BGRx, BGRA, xRGB, " \ #define GST_GL_UPLOAD_FORMATS "{ RGB, RGBx, RGBA, BGR, BGRx, BGRA, xRGB, " \
"xBGR, ARGB, ABGR, I420, YV12, YUY2, UYVY, AYUV }" "xBGR, ARGB, ABGR, I420, YV12, YUY2, UYVY, AYUV }"
#else /* HAVE_GLES2 */ #else /* GST_GL_HAVE_GLES2 */
# define GST_GL_UPLOAD_FORMATS "{ RGB, RGBx, RGBA, I420, YV12, YUY2, UYVY, AYUV }" # define GST_GL_UPLOAD_FORMATS "{ RGB, RGBx, RGBA, I420, YV12, YUY2, UYVY, AYUV }"
#endif /* !HAVE_GLES2 */ #endif /* !GST_GL_HAVE_GLES2 */
/** /**
* GST_GL_UPLOAD_VIDEO_CAPS: * GST_GL_UPLOAD_VIDEO_CAPS:

View file

@ -26,16 +26,16 @@
#include "gstglwindow.h" #include "gstglwindow.h"
#ifdef HAVE_WINDOW_X11 #if GST_GL_HAVE_WINDOW_X11
#include "x11/gstglwindow_x11.h" #include "x11/gstglwindow_x11.h"
#endif #endif
#ifdef HAVE_WINDOW_WIN32 #if GST_GL_HAVE_WINDOW_WIN32
#include "win32/gstglwindow_win32.h" #include "win32/gstglwindow_win32.h"
#endif #endif
#ifdef HAVE_WINDOW_COCOA #if GST_GL_HAVE_WINDOW_COCOA
#include "cocoa/gstglwindow_cocoa.h" #include "cocoa/gstglwindow_cocoa.h"
#endif #endif
#ifdef HAVE_WINDOW_WAYLAND #if GST_GL_HAVE_WINDOW_WAYLAND
#include "wayland/gstglwindow_wayland_egl.h" #include "wayland/gstglwindow_wayland_egl.h"
#endif #endif
@ -83,24 +83,24 @@ gst_gl_window_new (GstGLAPI api, guintptr external_gl_context, GError ** error)
user_choice = g_getenv ("GST_GL_WINDOW"); user_choice = g_getenv ("GST_GL_WINDOW");
GST_INFO ("creating a window, user choice:%s", user_choice); GST_INFO ("creating a window, user choice:%s", user_choice);
#ifdef HAVE_WINDOW_X11 #if GST_GL_HAVE_WINDOW_X11
if (!window && (!user_choice || g_strstr_len (user_choice, 3, "x11"))) if (!window && (!user_choice || g_strstr_len (user_choice, 3, "x11")))
window = window =
GST_GL_WINDOW (gst_gl_window_x11_new (api, external_gl_context, error)); GST_GL_WINDOW (gst_gl_window_x11_new (api, external_gl_context, error));
#endif #endif
#ifdef HAVE_WINDOW_WIN32 #if GST_GL_HAVE_WINDOW_WIN32
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "win32"))) if (!window && (!user_choice || g_strstr_len (user_choice, 5, "win32")))
window = window =
GST_GL_WINDOW (gst_gl_window_win32_new (api, external_gl_context, GST_GL_WINDOW (gst_gl_window_win32_new (api, external_gl_context,
error)); error));
#endif #endif
#ifdef HAVE_WINDOW_COCOA #if GST_GL_HAVE_WINDOW_COCOA
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "cocoa"))) if (!window && (!user_choice || g_strstr_len (user_choice, 5, "cocoa")))
window = window =
GST_GL_WINDOW (gst_gl_window_cocoa_new (api, external_gl_context, GST_GL_WINDOW (gst_gl_window_cocoa_new (api, external_gl_context,
error)); error));
#endif #endif
#ifdef HAVE_WINDOW_WAYLAND #if GST_GL_HAVE_WINDOW_WAYLAND
if (!window && (!user_choice || g_strstr_len (user_choice, 7, "wayland"))) if (!window && (!user_choice || g_strstr_len (user_choice, 7, "wayland")))
window = window =
GST_GL_WINDOW (gst_gl_window_wayland_egl_new (api, GST_GL_WINDOW (gst_gl_window_wayland_egl_new (api,

View file

@ -25,10 +25,10 @@
#include "gstglwindow_win32.h" #include "gstglwindow_win32.h"
#if HAVE_WGL #if GST_GL_HAVE_PLATFORM_WGL
#include "gstglwindow_win32_wgl.h" #include "gstglwindow_win32_wgl.h"
#endif #endif
#if HAVE_EGL #if GST_GL_HAVE_PLATFORM_EGL
#include "gstglwindow_win32_egl.h" #include "gstglwindow_win32_egl.h"
#endif #endif

View file

@ -30,10 +30,10 @@
#include "gstglwindow_x11.h" #include "gstglwindow_x11.h"
#ifdef HAVE_GLX #if GST_GL_HAVE_PLATFORM_GLX
# include "gstglwindow_x11_glx.h" # include "gstglwindow_x11_glx.h"
#endif #endif
#ifdef HAVE_EGL #if GST_GL_HAVE_PLATFORM_EGL
# include "gstglwindow_x11_egl.h" # include "gstglwindow_x11_egl.h"
#endif #endif
@ -217,8 +217,8 @@ gst_gl_window_x11_new (GstGLAPI gl_api, guintptr external_gl_context,
user_choice = g_getenv ("GST_GL_PLATFORM"); user_choice = g_getenv ("GST_GL_PLATFORM");
#ifdef HAVE_GLX #if GST_GL_HAVE_PLATFORM_GLX
#ifdef HAVE_EGL #if GST_GL_HAVE_PLATFORM_EGL
/* try GLX first for Desktop OpenGL */ /* try GLX first for Desktop OpenGL */
if (gl_api & GST_GL_API_OPENGL || gl_api & GST_GL_API_OPENGL3) { if (gl_api & GST_GL_API_OPENGL || gl_api & GST_GL_API_OPENGL3) {
if (!window && (!user_choice if (!window && (!user_choice
@ -243,18 +243,18 @@ gst_gl_window_x11_new (GstGLAPI gl_api, guintptr external_gl_context,
GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api, GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api,
external_gl_context, error)); external_gl_context, error));
} }
#endif /* HAVE_EGL */ #endif /* GST_GL_HAVE_PLATFORM_EGL */
if (!window && (!user_choice || g_strstr_len (user_choice, 3, "glx") != NULL)) if (!window && (!user_choice || g_strstr_len (user_choice, 3, "glx") != NULL))
window = window =
GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api, GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api,
external_gl_context, error)); external_gl_context, error));
#endif /* HAVE_GLX */ #endif /* GST_GL_HAVE_PLATFORM_GLX */
#ifdef HAVE_EGL #ifdef GST_GL_HAVE_PLATFORM_EGL
if (!window && (!user_choice || g_strstr_len (user_choice, 3, "egl") != NULL)) if (!window && (!user_choice || g_strstr_len (user_choice, 3, "egl") != NULL))
window = window =
GST_GL_WINDOW_X11 (gst_gl_window_x11_egl_new (gl_api, GST_GL_WINDOW_X11 (gst_gl_window_x11_egl_new (gl_api,
external_gl_context, error)); external_gl_context, error));
#endif /* HAVE_EGL */ #endif /* GST_GL_HAVE_PLATFORM_EGL */
if (!window) { if (!window) {
GST_WARNING ("Failed to create x11 window, user_choice:%s", GST_WARNING ("Failed to create x11 window, user_choice:%s",
user_choice ? user_choice : "NULL"); user_choice ? user_choice : "NULL");

View file

@ -33,13 +33,13 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture,
GstGLEffects *effects = GST_GL_EFFECTS (data); GstGLEffects *effects = GST_GL_EFFECTS (data);
GstGLFilter *filter = GST_GL_FILTER (effects); GstGLFilter *filter = GST_GL_FILTER (effects);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (filter->display)) { if (USING_OPENGL (filter->display)) {
glMatrixMode (GL_PROJECTION); glMatrixMode (GL_PROJECTION);
glLoadIdentity (); glLoadIdentity ();
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (filter->display)) { if (USING_GLES2 (filter->display)) {
GstGLShader *shader = GstGLShader *shader =
g_hash_table_lookup (effects->shaderstable, "identity0"); g_hash_table_lookup (effects->shaderstable, "identity0");

View file

@ -40,7 +40,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
shader = gst_gl_shader_new (filter->display); shader = gst_gl_shader_new (filter->display);
g_hash_table_insert (effects->shaderstable, "mirror0", shader); g_hash_table_insert (effects->shaderstable, "mirror0", shader);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (filter->display)) { if (USING_GLES2 (filter->display)) {
if (shader) { if (shader) {
GError *error = NULL; GError *error = NULL;
@ -67,7 +67,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
} }
} }
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (filter->display)) { if (USING_OPENGL (filter->display)) {
if (!gst_gl_shader_compile_and_check (shader, if (!gst_gl_shader_compile_and_check (shader,
mirror_fragment_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) { mirror_fragment_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) {
@ -92,7 +92,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
gst_gl_shader_set_uniform_1i (shader, "tex", 0); gst_gl_shader_set_uniform_1i (shader, "tex", 0);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (filter->display)) { if (USING_OPENGL (filter->display)) {
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f); gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f); gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);

View file

@ -40,7 +40,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
shader = gst_gl_shader_new (filter->display); shader = gst_gl_shader_new (filter->display);
g_hash_table_insert (effects->shaderstable, "squeeze0", shader); g_hash_table_insert (effects->shaderstable, "squeeze0", shader);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (filter->display)) { if (USING_GLES2 (filter->display)) {
if (shader) { if (shader) {
GError *error = NULL; GError *error = NULL;
@ -68,7 +68,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
} }
} }
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (USING_OPENGL (filter->display)) { if (USING_OPENGL (filter->display)) {
if (!gst_gl_shader_compile_and_check (shader, if (!gst_gl_shader_compile_and_check (shader,
squeeze_fragment_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) { squeeze_fragment_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) {
@ -92,7 +92,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
gst_gl_shader_set_uniform_1i (shader, "tex", 0); gst_gl_shader_set_uniform_1i (shader, "tex", 0);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (USING_GLES2 (filter->display)) { if (USING_GLES2 (filter->display)) {
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f); gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f); gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);

View file

@ -80,7 +80,7 @@ const gchar *identity_fragment_source =
"}"; "}";
/* Mirror effect */ /* Mirror effect */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
const gchar *mirror_fragment_source_opengl = const gchar *mirror_fragment_source_opengl =
"#extension GL_ARB_texture_rectangle : enable\n" "#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex;" "uniform sampler2DRect tex;"
@ -96,7 +96,7 @@ const gchar *mirror_fragment_source_opengl =
" gl_FragColor = color * gl_Color;" " gl_FragColor = color * gl_Color;"
"}"; "}";
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
const gchar *mirror_fragment_source_gles2 = const gchar *mirror_fragment_source_gles2 =
"precision mediump float;" "precision mediump float;"
"varying vec2 v_texCoord;" "varying vec2 v_texCoord;"
@ -111,7 +111,7 @@ const gchar *mirror_fragment_source_gles2 =
#endif #endif
/* Squeeze effect */ /* Squeeze effect */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
const gchar *squeeze_fragment_source_opengl = const gchar *squeeze_fragment_source_opengl =
"#extension GL_ARB_texture_rectangle : enable\n" "#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex;" "uniform sampler2DRect tex;"
@ -129,7 +129,7 @@ const gchar *squeeze_fragment_source_opengl =
" gl_FragColor = color * gl_Color;" " gl_FragColor = color * gl_Color;"
"}"; "}";
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
const gchar *squeeze_fragment_source_gles2 = const gchar *squeeze_fragment_source_gles2 =
"precision mediump float;" "precision mediump float;"
"varying vec2 v_texCoord;" "varying vec2 v_texCoord;"

View file

@ -27,11 +27,11 @@
extern const gchar *vertex_shader_source; extern const gchar *vertex_shader_source;
extern const gchar *identity_fragment_source; extern const gchar *identity_fragment_source;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
extern const gchar *mirror_fragment_source_opengl; extern const gchar *mirror_fragment_source_opengl;
extern const gchar *squeeze_fragment_source_opengl; extern const gchar *squeeze_fragment_source_opengl;
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
extern const gchar *mirror_fragment_source_gles2; extern const gchar *mirror_fragment_source_gles2;
extern const gchar *squeeze_fragment_source_gles2; extern const gchar *squeeze_fragment_source_gles2;
#endif #endif

View file

@ -83,7 +83,7 @@ gst_gl_test_src_unicolor (GstGLTestSrc * v, GstBuffer * buffer, int w,
void void
gst_gl_test_src_smpte (GstGLTestSrc * v, GstBuffer * buffer, int w, int h) gst_gl_test_src_smpte (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
{ {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
int i; int i;
if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) { if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) {
@ -191,7 +191,7 @@ gst_gl_test_src_smpte (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
void void
gst_gl_test_src_snow (GstGLTestSrc * v, GstBuffer * buffer, int w, int h) gst_gl_test_src_snow (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
{ {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) { if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) {
glClearColor (0.0, 0.0, 0.0, 1.0); glClearColor (0.0, 0.0, 0.0, 1.0);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -218,7 +218,7 @@ static void
gst_gl_test_src_unicolor (GstGLTestSrc * v, GstBuffer * buffer, int w, gst_gl_test_src_unicolor (GstGLTestSrc * v, GstBuffer * buffer, int w,
int h, const struct vts_color_struct *color) int h, const struct vts_color_struct *color)
{ {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) { if (gst_gl_display_get_gl_api_unlocked (v->display) & GST_GL_API_OPENGL) {
glClearColor (color->R * (1 / 255.0f), color->G * (1 / 255.0f), glClearColor (color->R * (1 / 255.0f), color->G * (1 / 255.0f),
color->B * (1 / 255.0f), 1.0f); color->B * (1 / 255.0f), 1.0f);

View file

@ -97,7 +97,7 @@ gst_gl_effects_effect_get_type (void)
{GST_GL_EFFECT_IDENTITY, "Do nothing Effect", "identity"}, {GST_GL_EFFECT_IDENTITY, "Do nothing Effect", "identity"},
{GST_GL_EFFECT_MIRROR, "Mirror Effect", "mirror"}, {GST_GL_EFFECT_MIRROR, "Mirror Effect", "mirror"},
{GST_GL_EFFECT_SQUEEZE, "Squeeze Effect", "squeeze"}, {GST_GL_EFFECT_SQUEEZE, "Squeeze Effect", "squeeze"},
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
{GST_GL_EFFECT_STRETCH, "Stretch Effect", "stretch"}, {GST_GL_EFFECT_STRETCH, "Stretch Effect", "stretch"},
{GST_GL_EFFECT_FISHEYE, "FishEye Effect", "fisheye"}, {GST_GL_EFFECT_FISHEYE, "FishEye Effect", "fisheye"},
{GST_GL_EFFECT_TWIRL, "Twirl Effect", "twirl"}, {GST_GL_EFFECT_TWIRL, "Twirl Effect", "twirl"},
@ -136,7 +136,7 @@ gst_gl_effects_set_effect (GstGLEffects * effects, gint effect_type)
case GST_GL_EFFECT_SQUEEZE: case GST_GL_EFFECT_SQUEEZE:
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_squeeze; effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_squeeze;
break; break;
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
case GST_GL_EFFECT_STRETCH: case GST_GL_EFFECT_STRETCH:
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_stretch; effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_stretch;
break; break;
@ -270,7 +270,7 @@ void
gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width, gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
guint height) guint height)
{ {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (effects)->display) & if (gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (effects)->display) &
GST_GL_API_OPENGL) { GST_GL_API_OPENGL) {
glActiveTexture (GL_TEXTURE0); glActiveTexture (GL_TEXTURE0);
@ -291,7 +291,7 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
glEnd (); glEnd ();
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (effects)->display) & if (gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (effects)->display) &
GST_GL_API_GLES2) { GST_GL_API_GLES2) {
const GLfloat vVertices[] = { const GLfloat vVertices[] = {
@ -327,7 +327,7 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
static void static void
set_horizontal_swap (GstGLDisplay * display, gpointer data) set_horizontal_swap (GstGLDisplay * display, gpointer data)
{ {
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (gst_gl_display_get_gl_api_unlocked (display) & GST_GL_API_OPENGL) { if (gst_gl_display_get_gl_api_unlocked (display) & GST_GL_API_OPENGL) {
const double mirrormatrix[16] = { const double mirrormatrix[16] = {
-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0,

View file

@ -71,7 +71,7 @@ struct _GstGLEffects
gboolean horizontal_swap; /* switch left to right */ gboolean horizontal_swap; /* switch left to right */
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
GLint draw_attr_position_loc; GLint draw_attr_position_loc;
GLint draw_attr_texture_loc; GLint draw_attr_texture_loc;
#endif #endif

View file

@ -75,20 +75,20 @@ static void gst_gl_filter_cube_get_property (GObject * object, guint prop_id,
static gboolean gst_gl_filter_cube_set_caps (GstGLFilter * filter, static gboolean gst_gl_filter_cube_set_caps (GstGLFilter * filter,
GstCaps * incaps, GstCaps * outcaps); GstCaps * incaps, GstCaps * outcaps);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void gst_gl_filter_cube_reset (GstGLFilter * filter); static void gst_gl_filter_cube_reset (GstGLFilter * filter);
static gboolean gst_gl_filter_cube_init_shader (GstGLFilter * filter); static gboolean gst_gl_filter_cube_init_shader (GstGLFilter * filter);
static void _callback_gles2 (gint width, gint height, guint texture, static void _callback_gles2 (gint width, gint height, guint texture,
gpointer stuff); gpointer stuff);
#endif #endif
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void _callback_opengl (gint width, gint height, guint texture, static void _callback_opengl (gint width, gint height, guint texture,
gpointer stuff); gpointer stuff);
#endif #endif
static gboolean gst_gl_filter_cube_filter_texture (GstGLFilter * filter, static gboolean gst_gl_filter_cube_filter_texture (GstGLFilter * filter,
guint in_tex, guint out_tex); guint in_tex, guint out_tex);
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
/* vertex source */ /* vertex source */
static const gchar *cube_v_src = static const gchar *cube_v_src =
"attribute vec4 a_position; \n" "attribute vec4 a_position; \n"
@ -144,7 +144,7 @@ gst_gl_filter_cube_class_init (GstGLFilterCubeClass * klass)
gobject_class->set_property = gst_gl_filter_cube_set_property; gobject_class->set_property = gst_gl_filter_cube_set_property;
gobject_class->get_property = gst_gl_filter_cube_get_property; gobject_class->get_property = gst_gl_filter_cube_get_property;
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_cube_init_shader; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_cube_init_shader;
GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_filter_cube_reset; GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_filter_cube_reset;
#endif #endif
@ -256,7 +256,7 @@ gst_gl_filter_cube_set_caps (GstGLFilter * filter, GstCaps * incaps,
return TRUE; return TRUE;
} }
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void static void
gst_gl_filter_cube_reset (GstGLFilter * filter) gst_gl_filter_cube_reset (GstGLFilter * filter)
{ {
@ -292,11 +292,11 @@ gst_gl_filter_cube_filter_texture (GstGLFilter * filter, guint in_tex,
api = api =
gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (cube_filter)->display); gst_gl_display_get_gl_api_unlocked (GST_GL_FILTER (cube_filter)->display);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (api & GST_GL_API_OPENGL) if (api & GST_GL_API_OPENGL)
cb = _callback_opengl; cb = _callback_opengl;
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
if (api & GST_GL_API_GLES2) if (api & GST_GL_API_GLES2)
cb = _callback_gles2; cb = _callback_gles2;
#endif #endif
@ -317,7 +317,7 @@ gst_gl_filter_cube_filter_texture (GstGLFilter * filter, guint in_tex,
} }
/* opengl scene, params: input texture (not the output filter->texture) */ /* opengl scene, params: input texture (not the output filter->texture) */
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
static void static void
_callback_opengl (gint width, gint height, guint texture, gpointer stuff) _callback_opengl (gint width, gint height, guint texture, gpointer stuff)
{ {
@ -416,7 +416,7 @@ _callback_opengl (gint width, gint height, guint texture, gpointer stuff)
} }
#endif #endif
#if HAVE_GLES2 #if GST_GL_HAVE_GLES2
static void static void
_callback_gles2 (gint width, gint height, guint texture, gpointer stuff) _callback_gles2 (gint width, gint height, guint texture, gpointer stuff)
{ {

View file

@ -51,7 +51,7 @@
GType gst_gl_filter_cube_get_type (void); GType gst_gl_filter_cube_get_type (void);
GType gst_gl_effects_get_type (void); GType gst_gl_effects_get_type (void);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
#include "gstgltestsrc.h" #include "gstgltestsrc.h"
#include "gstglfilterlaplacian.h" #include "gstglfilterlaplacian.h"
#include "gstglfilterglass.h" #include "gstglfilterglass.h"
@ -86,7 +86,7 @@ GType gst_gl_overlay_get_type (void);
#endif /* HAVE_JPEG */ #endif /* HAVE_JPEG */
#endif /* HAVE_PNG */ #endif /* HAVE_PNG */
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
#define GST_CAT_DEFAULT gst_gl_gstgl_debug #define GST_CAT_DEFAULT gst_gl_gstgl_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
@ -111,7 +111,7 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, gst_gl_effects_get_type ())) { GST_RANK_NONE, gst_gl_effects_get_type ())) {
return FALSE; return FALSE;
} }
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (!gst_element_register (plugin, "gltestsrc", if (!gst_element_register (plugin, "gltestsrc",
GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) { GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) {
return FALSE; return FALSE;
@ -183,7 +183,7 @@ plugin_init (GstPlugin * plugin)
} }
#endif /* HAVE_JPEG */ #endif /* HAVE_JPEG */
#endif /* HAVE_PNG */ #endif /* HAVE_PNG */
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
return TRUE; return TRUE;
} }

View file

@ -131,7 +131,7 @@ GST_START_TEST (test_glfiltercube)
} }
GST_END_TEST GST_END_TEST
#ifdef OPENGL_ES2 #if GST_GL_HAVE_GLES2
# define N_EFFECTS 3 # define N_EFFECTS 3
#else #else
# define N_EFFECTS 16 # define N_EFFECTS 16
@ -154,7 +154,7 @@ GST_START_TEST (test_gleffects)
GST_END_TEST GST_END_TEST
#undef N_EFFECTS #undef N_EFFECTS
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
#define N_SRCS 13 #define N_SRCS 13
GST_START_TEST (test_gltestsrc) GST_START_TEST (test_gltestsrc)
{ {
@ -311,7 +311,7 @@ GST_START_TEST (test_glfilterapp)
GST_END_TEST GST_END_TEST
#endif /* 0 */ #endif /* 0 */
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
#endif /* !GST_DISABLE_PARSE */ #endif /* !GST_DISABLE_PARSE */
Suite * simple_launch_lines_suite (void) Suite * simple_launch_lines_suite (void)
{ {
@ -326,7 +326,7 @@ GST_END_TEST
tcase_add_test (tc_chain, test_glimagesink); tcase_add_test (tc_chain, test_glimagesink);
tcase_add_test (tc_chain, test_glfiltercube); tcase_add_test (tc_chain, test_glfiltercube);
tcase_add_test (tc_chain, test_gleffects); tcase_add_test (tc_chain, test_gleffects);
#if HAVE_OPENGL #if GST_GL_HAVE_OPENGL
tcase_add_test (tc_chain, test_gltestsrc); tcase_add_test (tc_chain, test_gltestsrc);
tcase_add_test (tc_chain, test_glfilterblur); tcase_add_test (tc_chain, test_glfilterblur);
tcase_add_test (tc_chain, test_glfiltersobel); tcase_add_test (tc_chain, test_glfiltersobel);
@ -345,7 +345,7 @@ GST_END_TEST
#endif /* HAVE_JPEG */ #endif /* HAVE_JPEG */
#endif /* HAVE_PNG */ #endif /* HAVE_PNG */
#endif #endif
#endif /* HAVE_OPENGL */ #endif /* GST_GL_HAVE_OPENGL */
#endif /* !GST_DISABLE_PARSE */ #endif /* !GST_DISABLE_PARSE */
return s; return s;
} }