From c18a109b42352281708ce32f7d3578416b7cd40a Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Sun, 22 Jun 2014 13:14:27 +0100 Subject: [PATCH] gl: enable glvideomixer on GLES2 --- ext/gl/Makefile.am | 4 ++-- ext/gl/gstglvideomixer.c | 3 +++ ext/gl/gstopengl.c | 12 ++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ext/gl/Makefile.am b/ext/gl/Makefile.am index 66537e64be..5e9f437658 100644 --- a/ext/gl/Makefile.am +++ b/ext/gl/Makefile.am @@ -29,8 +29,6 @@ OPENGL_SOURCES = \ gstgltestsrc.h \ gstglmosaic.c \ gstglmosaic.h \ - gstglvideomixer.c \ - gstglvideomixer.h \ effects/gstgleffectscurves.h \ effects/gstgleffectstretch.c \ effects/gstgleffecttunnel.c \ @@ -74,6 +72,8 @@ libgstopengl_la_SOURCES = \ effects/gstgleffectsqueeze.c \ gstglcolorscale.c \ gstglcolorscale.h \ + gstglvideomixer.c \ + gstglvideomixer.h \ $(OPENGL_SOURCES) if HAVE_GRAPHENE diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index 7b3904e64d..7dcb9367a6 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -81,6 +81,9 @@ static const gchar *video_mixer_v_src = /* fragment source */ static const gchar *video_mixer_f_src = + "#ifdef GL_ES\n" + "precision mediump float;\n" + "#endif\n" "uniform sampler2D texture; \n" "uniform float alpha;\n" "varying vec2 v_texCoord; \n" diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c index 471d5acf05..fbe5b277cb 100644 --- a/ext/gl/gstopengl.c +++ b/ext/gl/gstopengl.c @@ -48,6 +48,7 @@ #include "gstglfiltercube.h" #include "gstgleffects.h" #include "gstglcolorscale.h" +#include "gstglvideomixer.h" #if HAVE_GRAPHENE #include "gstgltransformation.h" #endif @@ -63,7 +64,6 @@ #include "gstglfiltersobel.h" #include "gstgldeinterlace.h" #include "gstglmosaic.h" -#include "gstglvideomixer.h" #if HAVE_PNG #include "gstgldifferencematte.h" #include "gstglbumper.h" @@ -124,6 +124,11 @@ plugin_init (GstPlugin * plugin) GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) { return FALSE; } + + if (!gst_element_register (plugin, "glvideomixer", + GST_RANK_NONE, GST_TYPE_GL_VIDEO_MIXER)) { + return FALSE; + } #if GST_GL_HAVE_OPENGL if (!gst_element_register (plugin, "gltestsrc", GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) { @@ -174,11 +179,6 @@ plugin_init (GstPlugin * plugin) GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) { return FALSE; } - - if (!gst_element_register (plugin, "glvideomixer", - GST_RANK_NONE, GST_TYPE_GL_VIDEO_MIXER)) { - return FALSE; - } #if HAVE_PNG if (!gst_element_register (plugin, "gldifferencematte", GST_RANK_NONE, gst_gl_differencematte_get_type ())) {