NULL,
#define GST_GL_EXT_END()
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
static GstGLFuncs gst_gl = {
#include "glprototypes/opengl.h"
{NULL,},
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
static GstGLES2Funcs gst_gles2 = {
#include "glprototypes/gles1gles2.h"
{NULL,},
#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>
ret (*name) args;
#define GST_GL_EXT_END()
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
typedef struct _GstGLFuncs
{
#include "glprototypes/opengl.h"
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"
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);
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);
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);
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;
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"
display->isAlive = FALSE;
}
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
static gboolean
_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)
{
{
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
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
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;
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)
}
#endif
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
void
_gen_fbo_opengl (GstGLDisplay * display)
{
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_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)
{
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_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)
{
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_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)
{
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_del_fbo_gles2 (GstGLDisplay * display)
{
}
}
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_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)
{
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
void
_del_shader_gles2 (GstGLDisplay * display)
{
} else {
glViewport (0, 0, width, height);
}
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
if (USING_OPENGL(display)) {
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
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
}
/* 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);
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,
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;
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,
#ifndef __GST_GL_H__
#define __GST_GL_H__
+#include "gstglconfig.h"
+
#include <gst/video/video.h>
typedef struct _GstGLUpload GstGLUpload;
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;
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,
/* 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"
"}\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"
"{ \n"
" gl_FragColor = texture2D( s_texture, v_texCoord );\n"
"} \n";
-#endif /* HAVE_GLES2 */
+#endif /* GST_GL_HAVE_GLES2 */
/* *INDENT-ON* */
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;
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;
/* 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);
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);
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,
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 */
}
}
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
static void
_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)
{
}
#endif
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
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_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
{
*
* 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:
/* 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, \
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, \
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
{
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
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;
* 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;
{
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++)
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",
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)
{
glEnd ();
}
-#endif /* HAVE_OPENGL */
+#endif /* GST_GL_HAVE_OPENGL */
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
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);
width, height);
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
width, height);
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);
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;
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);
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);
/* 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
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
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
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)
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)
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);
(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);
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
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
static void _do_upload_draw_gles2 (GstGLDisplay * display,
GstGLUpload * upload);
#endif
/* *INDENT-OFF* */
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
/* YUY2:r,g,a
UYVY:a,b,r */
static gchar *text_shader_YUY2_UYVY_opengl =
#define text_vertex_shader_opengl NULL
#endif
-#ifdef HAVE_GLES2
+#if GST_GL_HAVE_GLES2
/* YUY2:r,g,a
UYVY:a,b,r */
static gchar *text_shader_YUY2_UYVY_gles2 =
g_mutex_init (&upload->lock);
-#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;
priv->draw = _do_upload_draw_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;
case GST_VIDEO_FORMAT_UYVY:
{
gchar text_shader_UYVY[2048];
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
if (USING_GLES2 (display)) {
sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY,
'a', 'b', 'r');
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display)) {
sprintf (text_shader_UYVY, upload->priv->YUY2_UYVY,
'a', 'r', 'b');
case GST_VIDEO_FORMAT_YV12:
{
gchar text_shader_I420_YV12[2048];
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
if ((g_ascii_strncasecmp ("ATI",
(gchar *) glGetString (GL_VENDOR), 3) == 0)
"*0.5");
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
if (USING_GLES2 (display))
g_strlcpy (text_shader_I420_YV12, upload->priv->I420_YV12, 2048);
#endif
/* setup the render buffer for depth */
glGenRenderbuffersEXT (1, &upload->depth_buffer);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, upload->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);
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);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, upload->depth_buffer);
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (display)) {
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, upload->depth_buffer);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
}
-#if HAVE_OPENGL
+#if GST_GL_HAVE_OPENGL
/* called by _do_upload (in the gl thread) */
static void
_do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
}
#endif
-#if HAVE_GLES2
+#if GST_GL_HAVE_GLES2
static void
_do_upload_draw_gles2 (GstGLDisplay * display, GstGLUpload * upload)
{
*
* 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, " \
"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 }"
-#endif /* !HAVE_GLES2 */
+#endif /* !GST_GL_HAVE_GLES2 */
/**
* GST_GL_UPLOAD_VIDEO_CAPS:
#include "gstglwindow.h"
-#ifdef HAVE_WINDOW_X11
+#if GST_GL_HAVE_WINDOW_X11
#include "x11/gstglwindow_x11.h"
#endif
-#ifdef HAVE_WINDOW_WIN32
+#if GST_GL_HAVE_WINDOW_WIN32
#include "win32/gstglwindow_win32.h"
#endif
-#ifdef HAVE_WINDOW_COCOA
+#if GST_GL_HAVE_WINDOW_COCOA
#include "cocoa/gstglwindow_cocoa.h"
#endif
-#ifdef HAVE_WINDOW_WAYLAND
+#if GST_GL_HAVE_WINDOW_WAYLAND
#include "wayland/gstglwindow_wayland_egl.h"
#endif
user_choice = g_getenv ("GST_GL_WINDOW");
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")))
window =
GST_GL_WINDOW (gst_gl_window_x11_new (api, external_gl_context, error));
#endif
-#ifdef HAVE_WINDOW_WIN32
+#if GST_GL_HAVE_WINDOW_WIN32
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "win32")))
window =
GST_GL_WINDOW (gst_gl_window_win32_new (api, external_gl_context,
error));
#endif
-#ifdef HAVE_WINDOW_COCOA
+#if GST_GL_HAVE_WINDOW_COCOA
if (!window && (!user_choice || g_strstr_len (user_choice, 5, "cocoa")))
window =
GST_GL_WINDOW (gst_gl_window_cocoa_new (api, external_gl_context,
error));
#endif
-#ifdef HAVE_WINDOW_WAYLAND
+#if GST_GL_HAVE_WINDOW_WAYLAND
if (!window && (!user_choice || g_strstr_len (user_choice, 7, "wayland")))
window =
GST_GL_WINDOW (gst_gl_window_wayland_egl_new (api,
#include "gstglwindow_win32.h"
-#if HAVE_WGL
+#if GST_GL_HAVE_PLATFORM_WGL
#include "gstglwindow_win32_wgl.h"
#endif
-#if HAVE_EGL
+#if GST_GL_HAVE_PLATFORM_EGL
#include "gstglwindow_win32_egl.h"
#endif
#include "gstglwindow_x11.h"
-#ifdef HAVE_GLX
+#if GST_GL_HAVE_PLATFORM_GLX
# include "gstglwindow_x11_glx.h"
#endif
-#ifdef HAVE_EGL
+#if GST_GL_HAVE_PLATFORM_EGL
# include "gstglwindow_x11_egl.h"
#endif
user_choice = g_getenv ("GST_GL_PLATFORM");
-#ifdef HAVE_GLX
-#ifdef HAVE_EGL
+#if GST_GL_HAVE_PLATFORM_GLX
+#if GST_GL_HAVE_PLATFORM_EGL
/* try GLX first for Desktop OpenGL */
if (gl_api & GST_GL_API_OPENGL || gl_api & GST_GL_API_OPENGL3) {
if (!window && (!user_choice
GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api,
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))
window =
GST_GL_WINDOW_X11 (gst_gl_window_x11_glx_new (gl_api,
external_gl_context, error));
-#endif /* HAVE_GLX */
-#ifdef HAVE_EGL
+#endif /* GST_GL_HAVE_PLATFORM_GLX */
+#ifdef GST_GL_HAVE_PLATFORM_EGL
if (!window && (!user_choice || g_strstr_len (user_choice, 3, "egl") != NULL))
window =
GST_GL_WINDOW_X11 (gst_gl_window_x11_egl_new (gl_api,
external_gl_context, error));
-#endif /* HAVE_EGL */
+#endif /* GST_GL_HAVE_PLATFORM_EGL */
if (!window) {
GST_WARNING ("Failed to create x11 window, user_choice:%s",
user_choice ? user_choice : "NULL");