gl: enable glvideomixer on GLES2
authorJulien Isorce <julien.isorce@collabora.co.uk>
Sun, 22 Jun 2014 12:14:27 +0000 (13:14 +0100)
committerJulien Isorce <julien.isorce@collabora.co.uk>
Wed, 25 Jun 2014 05:55:11 +0000 (06:55 +0100)
ext/gl/Makefile.am
ext/gl/gstglvideomixer.c
ext/gl/gstopengl.c

index 66537e6..5e9f437 100644 (file)
@@ -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
index 7b3904e..7dcb936 100644 (file)
@@ -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"
index 471d5ac..fbe5b27 100644 (file)
@@ -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 ())) {