Commit e983f02e authored by Matthew Waters's avatar Matthew Waters 🐨 Committed by Tim-Philipp Müller

[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
parent 8375116c
......@@ -25,7 +25,7 @@
NULL,
#define GST_GL_EXT_END()
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
static GstGLFuncs gst_gl = {
#include "glprototypes/opengl.h"
{NULL,},
......@@ -44,7 +44,7 @@ gst_gl_get_opengl_vtable (void)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static GstGLES2Funcs gst_gles2 = {
#include "glprototypes/gles1gles2.h"
{NULL,},
......
......@@ -21,17 +21,19 @@
#ifndef __GST_GL_API_H__
#define __GST_GL_API_H__
#include "gstglconfig.h"
/* OpenGL 2.0 for Embedded Systems */
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# if !HAVE_OPENGL
# if !GST_GL_HAVE_OPENGL
# include "gstgles2.h"
# endif
#endif
/* OpenGL for desktop systems */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
# if __APPLE__
# include <GL/glew.h>
# include <OpenGL/OpenGL.h>
......@@ -73,7 +75,7 @@ typedef enum
ret (*name) args;
#define GST_GL_EXT_END()
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
typedef struct _GstGLFuncs
{
#include "glprototypes/opengl.h"
......@@ -89,7 +91,7 @@ typedef struct _GstGLFuncs
const GstGLFuncs *gst_gl_get_opengl_vtable (void);
#endif
#if GST_GL_GLES2
#if GST_GL_HAVE_GLES2
typedef struct _GstGLES2Funcs
{
#include "glprototypes/gles1gles2.h"
......
......@@ -67,7 +67,7 @@ static void gst_gl_display_finalize (GObject * object);
gpointer gst_gl_display_thread_create_context (GstGLDisplay * display);
void gst_gl_display_thread_destroy_context (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);
#endif
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);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void _gen_fbo_opengl (GstGLDisplay * display);
void _use_fbo_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 _del_shader_opengl (GstGLDisplay * display);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void _gen_fbo_gles2 (GstGLDisplay * display);
void _use_fbo_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_height = 0;
display->keep_aspect_ratio = FALSE;
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
display->redisplay_shader = NULL;
display->redisplay_attr_position_loc = 0;
display->redisplay_attr_texture_loc = 0;
......@@ -213,7 +213,7 @@ gst_gl_display_init (GstGLDisplay * display)
display->uploads = NULL;
display->downloads = NULL;
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
/* *INDENT-OFF* */
display->redisplay_vertex_shader_str_gles2 =
"attribute vec4 a_position; \n"
......@@ -336,7 +336,7 @@ gst_gl_display_set_error (GstGLDisplay * display, const char *format, ...)
display->isAlive = FALSE;
}
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static gboolean
_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
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
gboolean
_create_context_opengl (GstGLDisplay * display, gint * gl_major, gint * gl_minor)
{
......@@ -439,10 +439,10 @@ _compiled_api (void)
{
GstGLAPI ret = GST_GL_API_NONE;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
ret |= GST_GL_API_OPENGL;
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
ret |= GST_GL_API_GLES2;
#endif
......@@ -493,11 +493,11 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
g_free (compiled_api_s);
/* gl api specific code */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (!ret && USING_OPENGL(display))
ret = _create_context_opengl (display, &gl_major, NULL);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (!ret && USING_GLES2(display))
ret = _create_context_gles2 (display, &gl_major, NULL);
#endif
......@@ -555,7 +555,7 @@ failure:
void
gst_gl_display_thread_destroy_context (GstGLDisplay * display)
{
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (display->redisplay_shader) {
g_object_unref (G_OBJECT (display->redisplay_shader));
display->redisplay_shader = NULL;
......@@ -575,7 +575,7 @@ gst_gl_display_thread_run_generic (GstGLDisplay * display)
display->generic_callback (display, display->data);
}
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
/* Called in the gl thread */
void
gst_gl_display_thread_init_redisplay (GstGLDisplay * display)
......@@ -605,7 +605,7 @@ gst_gl_display_thread_init_redisplay (GstGLDisplay * display)
}
#endif
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void
_gen_fbo_opengl (GstGLDisplay * display)
{
......@@ -671,7 +671,7 @@ _gen_fbo_opengl (GstGLDisplay * display)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_gen_fbo_gles2 (GstGLDisplay * display)
{
......@@ -732,7 +732,7 @@ _gen_fbo_gles2 (GstGLDisplay * display)
#endif
/* Called in the gl thread */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void
_use_fbo_opengl (GstGLDisplay * display)
{
......@@ -801,7 +801,7 @@ _use_fbo_opengl (GstGLDisplay * display)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_use_fbo_gles2 (GstGLDisplay * display)
{
......@@ -842,7 +842,7 @@ _use_fbo_gles2 (GstGLDisplay * display)
/* Called in a gl thread
* Need full shader support */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void
_use_fbo_v2_opengl (GstGLDisplay * display)
{
......@@ -882,7 +882,7 @@ _use_fbo_v2_opengl (GstGLDisplay * display)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_use_fbo_v2_gles2 (GstGLDisplay * display)
{
......@@ -919,7 +919,7 @@ _use_fbo_v2_gles2 (GstGLDisplay * display)
#endif
/* Called in the gl thread */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void
_del_fbo_opengl (GstGLDisplay * display)
{
......@@ -936,7 +936,7 @@ _del_fbo_opengl (GstGLDisplay * display)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_del_fbo_gles2 (GstGLDisplay * display)
{
......@@ -991,7 +991,7 @@ _gen_shader_opengl (GstGLDisplay * display)
}
}
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_gen_shader_gles2 (GstGLDisplay * display)
{
......@@ -1031,7 +1031,7 @@ _gen_shader_gles2 (GstGLDisplay * display)
#endif
/* Called in the gl thread */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
void
_del_shader_opengl (GstGLDisplay * display)
{
......@@ -1044,7 +1044,7 @@ _del_shader_opengl (GstGLDisplay * display)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
void
_del_shader_gles2 (GstGLDisplay * display)
{
......@@ -1096,7 +1096,7 @@ gst_gl_display_on_resize (GstGLDisplay * display, gint width, gint height)
} else {
glViewport (0, 0, width, height);
}
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) {
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
......@@ -1122,7 +1122,7 @@ gst_gl_display_on_draw (GstGLDisplay * display)
if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL)
glUseProgramObjectARB (0);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display))
glDisable (GL_TEXTURE_RECTANGLE_ARB);
#endif
......@@ -1142,7 +1142,7 @@ gst_gl_display_on_draw (GstGLDisplay * display)
}
/* default opengl scene */
else {
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) {
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);
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2(display)) {
const GLfloat vVertices[] = { 1.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:
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
case GL_FRAMEBUFFER_UNDEFINED:
GST_ERROR ("GL_FRAMEBUFFER_UNDEFINED");
break;
......@@ -1413,7 +1413,7 @@ gst_gl_display_redisplay (GstGLDisplay * display, GLuint texture,
gst_gl_display_lock (display);
if (display->isAlive) {
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2(display)) {
if (!display->redisplay_shader) {
gst_gl_window_send_message (display->gl_window,
......
......@@ -23,6 +23,8 @@
#ifndef __GST_GL_H__
#define __GST_GL_H__
#include "gstglconfig.h"
#include <gst/video/video.h>
typedef struct _GstGLUpload GstGLUpload;
......@@ -159,7 +161,7 @@ struct _GstGLDisplay
GLuint redisplay_texture_width;
GLuint redisplay_texture_height;
gboolean keep_aspect_ratio;
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
GstGLShader *redisplay_shader;
gchar *redisplay_vertex_shader_str_gles2;
gchar *redisplay_fragment_shader_str_gles2;
......
......@@ -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
* 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,
GstGLDownload * download);
static void _do_download_draw_yuv_opengl (GstGLDisplay * display,
GstGLDownload * download);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static void _do_download_draw_rgb_gles2 (GstGLDisplay * display,
GstGLDownload * download);
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
UYVY:v,y1,u,y2 */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
static gchar *text_shader_YUY2_UYVY_opengl =
"#extension GL_ARB_texture_rectangle : enable\n"
"uniform sampler2DRect tex;\n"
......@@ -144,9 +144,9 @@ static gchar *text_shader_AYUV_opengl =
"}\n";
#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 =
"precision mediump float;\n"
"varying vec2 v_texCoord;\n"
......@@ -214,7 +214,7 @@ static gchar *text_shader_RGB_gles2 =
"{ \n"
" gl_FragColor = texture2D( s_texture, v_texCoord );\n"
"} \n";
#endif /* HAVE_GLES2 */
#endif /* GST_GL_HAVE_GLES2 */
/* *INDENT-ON* */
......@@ -288,7 +288,7 @@ gst_gl_download_new (GstGLDisplay * display)
download->display = g_object_ref (display);
priv = download->priv;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_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;
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
priv->YUY2_UYVY = text_shader_YUY2_UYVY_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 */
glGenRenderbuffersEXT (1, &download->depth_buffer);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, download->depth_buffer);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
out_width, out_height);
......@@ -789,7 +789,7 @@ _init_download (GstGLDisplay * display, GstGLDownload * download)
out_width, out_height);
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
out_width, out_height);
......@@ -859,7 +859,7 @@ _init_download (GstGLDisplay * display, GstGLDownload * download)
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, download->depth_buffer);
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_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_BGR:
/* color space conversion is not needed */
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
{
if (USING_GLES2 (display)) {
/* 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
_do_download_draw_rgb_opengl (GstGLDisplay * display, GstGLDownload * download)
{
......@@ -1159,7 +1159,7 @@ _do_download_draw_rgb_opengl (GstGLDisplay * display, GstGLDownload * download)
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static void
_do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
{
......@@ -1243,7 +1243,7 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
}
#endif
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
static void
_do_download_draw_yuv_opengl (GstGLDisplay * display, GstGLDownload * download)
{
......@@ -1428,7 +1428,7 @@ _do_download_draw_yuv_opengl (GstGLDisplay * display, GstGLDownload * download)
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static void
_do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
{
......
......@@ -98,12 +98,12 @@ struct _GstGLDownloadClass
*
* 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, " \
"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 }"
#endif /* !HAVE_GLES2 */
#endif /* !GST_GL_HAVE_GLES2 */
/**
* GST_GL_DOWNLOAD_VIDEO_CAPS:
......
......@@ -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
for each feature */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
#define GST_GL_EXT_BEGIN(name, \
min_gl_major, min_gl_minor, \
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[] = {
#include "glprototypes/opengl_functions.h"
};
#endif /* HAVE_OPENGL */
#endif /* GST_GL_HAVE_OPENGL */
#undef GST_GL_EXT_BEGIN
#undef GST_GL_EXT_FUNCTION
#undef GST_GL_EXT_END
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
#define GST_GL_EXT_BEGIN(name, \
min_gl_major, min_gl_minor, \
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[] = {
#include "glprototypes/gles2_functions.h"
};
#endif /* HAVE_GLES2 */
#endif /* GST_GL_HAVE_GLES2 */
#undef GST_GL_EXT_BEGIN
#undef GST_GL_EXT_FUNCTION
......@@ -132,18 +132,18 @@ _gst_gl_feature_check (GstGLDisplay * display,
{
const char *suffix = NULL;
int func_num;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
static const GstGLFuncs *gst_gl = NULL;
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
static const GstGLES2Funcs *gst_gles2 = NULL;
#endif
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (!gst_gl)
gst_gl = gst_gl_get_opengl_vtable ();
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (!gst_gles2)
gst_gles2 = gst_gl_get_gles2_vtable ();
#endif
......@@ -219,13 +219,13 @@ _gst_gl_feature_check (GstGLDisplay * display,
goto error;
/* Set the function pointer in the context */
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (display->gl_api & GST_GL_API_OPENGL) {
*(void **) ((guint8 *) gst_gl +
data->functions[func_num].pointer_offset) = func;
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) {
*(void **) ((guint8 *) gst_gles2 +
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 */
error:
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) {
*(void **) ((guint8 *) gst_gl +
data->functions[func_num].pointer_offset) = NULL;
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) {
*(void **) ((guint8 *) gst_gles2 +
data->functions[func_num].pointer_offset) = NULL;
......@@ -263,7 +263,7 @@ _gst_gl_feature_check_ext_functions (GstGLDisplay * display,
{
int i;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (display->gl_api & GST_GL_API_OPENGL) {
for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_opengl);
i++)
......@@ -272,7 +272,7 @@ _gst_gl_feature_check_ext_functions (GstGLDisplay * display,
gl_extensions);
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (display->gl_api & GST_GL_API_GLES2) {
for (i = 0; i < G_N_ELEMENTS (gst_gl_feature_ext_functions_data_gles2); i++)
_gst_gl_feature_check (display, "GL",
......
......@@ -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);
}
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
static void
_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 ();
}
#endif /* HAVE_OPENGL */
#endif /* GST_GL_HAVE_OPENGL */
......@@ -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,
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,
GLuint input, GLuint target, GstGLShader *shader);
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
......
......@@ -226,7 +226,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
glGenRenderbuffersEXT (1, &rboId);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, rboId);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width,
height);
......@@ -234,7 +234,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
width, height);
}
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
width, height);
......@@ -244,7 +244,7 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, rboId);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
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,
"GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
case GL_FRAMEBUFFER_UNDEFINED:
GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GL_FRAMEBUFFER_UNDEFINED");
break;
......
......@@ -303,12 +303,12 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
glGetObjectParameterivARB (priv->vertex_handle,
GL_OBJECT_COMPILE_STATUS_ARB, &status);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display))
glGetInfoLogARB (priv->vertex_handle,
sizeof (info_buffer) - 1, &len, info_buffer);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display))
glGetShaderInfoLog (priv->vertex_handle,
sizeof (info_buffer) - 1, &len, info_buffer);
......@@ -342,12 +342,12 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
glGetObjectParameterivARB (priv->fragment_handle,
GL_OBJECT_COMPILE_STATUS_ARB, &status);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display))
glGetInfoLogARB (priv->fragment_handle,
sizeof (info_buffer) - 1, &len, info_buffer);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display))
glGetShaderInfoLog (priv->fragment_handle,
sizeof (info_buffer) - 1, &len, info_buffer);
......@@ -372,11 +372,11 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error)
/* if nothing failed link shaders */
glLinkProgramARB (priv->program_handle);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display))
glGetObjectParameterivARB (priv->program_handle, GL_LINK_STATUS, &status);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display))
glGetProgramiv (priv->program_handle, GL_LINK_STATUS, &status);
#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 */
GST_TRACE ("finalizing vertex shader %u", priv->vertex_handle);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display))
glDeleteObjectARB (priv->vertex_handle);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display))
glDeleteShader (priv->vertex_handle);
#endif
......@@ -438,11 +438,11 @@ gst_gl_shader_release (GstGLShader * shader)
GST_TRACE ("finalizing fragment shader %u", priv->fragment_handle);
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (shader->display))
glDeleteObjectARB (priv->fragment_handle);
#endif
#if HAVE_GLES2
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (shader->display))
glDeleteShader (priv->fragment_handle);
#endif
......@@ -820,7 +820,7 @@ gst_gl_shader_set_uniform_matrix_4fv (GstGLShader * shader, const gchar * name,
glUniformMatrix4fvARB (location, count, transpose, 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)
......@@ -916,7 +916,7 @@ gst_gl_shader_set_uniform_matrix_4x3fv (GstGLShader * shader,
glUniformMatrix4x3fv (location, count, transpose, value);
}
#endif /* HAVE_OPENGL */
#endif /* GST_GL_HAVE_OPENGL */
GLint
gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name)
......
......@@ -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_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);
#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_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);
......
......@@ -566,7 +566,7 @@ gst_gl_shadervariable_set (GstGLShader * shader,
(float *) ret->value);
break;
#if HAVE_OPENGL
#if GST_GL_HAVE_OPENGL
case _mat2x3:
gst_gl_shader_set_uniform_matrix_2x3fv (shader, ret->name, ret->count, 0,
(float *) ret->value);
......
......@@ -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 *
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,
GstGLUpload * upload);
#endif