summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <ystreet00@gmail.com>2014-02-11 07:24:40 +1100
committerMatthew Waters <ystreet00@gmail.com>2014-02-21 00:37:59 +1100
commita14d2a50b872a4a32e186431ba919f76bc8a4cd2 (patch)
tree5e052277d262dce230aaafd4f9e26e3020a110cc
parent08e53e971f1818cf4c2dd77cd91a91bc4ebf3075 (diff)
port glcolorscale to GLES2
-rw-r--r--gst/gl/Makefile.am4
-rw-r--r--gst/gl/gstglcolorscale.c10
-rw-r--r--gst/gl/gstopengl.c12
3 files changed, 16 insertions, 10 deletions
diff --git a/gst/gl/Makefile.am b/gst/gl/Makefile.am
index 1333a45..d87f881 100644
--- a/gst/gl/Makefile.am
+++ b/gst/gl/Makefile.am
@@ -21,8 +21,6 @@ OPENGL_SOURCES = \
gstglfilterapp.h \
gstglfilterreflectedscreen.c \
gstglfilterreflectedscreen.h \
- gstglcolorscale.c \
- gstglcolorscale.h \
gstgldeinterlace.c \
gstgldeinterlace.h \
gltestsrc.c \
@@ -74,6 +72,8 @@ libgstopengl_la_SOURCES = \
effects/gstgleffectidentity.c \
effects/gstgleffectmirror.c \
effects/gstgleffectsqueeze.c \
+ gstglcolorscale.c \
+ gstglcolorscale.h \
$(OPENGL_SOURCES)
# check order of CFLAGS and LIBS, shouldn't the order be the other way around
diff --git a/gst/gl/gstglcolorscale.c b/gst/gl/gstglcolorscale.c
index ffea2d5..10ea7fc 100644
--- a/gst/gl/gstglcolorscale.c
+++ b/gst/gl/gstglcolorscale.c
@@ -143,8 +143,14 @@ gst_gl_colorscale_callback (gint width, gint height, guint texture,
{
GstGLFilter *filter = GST_GL_FILTER (stuff);
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
+#if GST_GL_HAVE_OPENGL
+ if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_OPENGL) {
+ const GstGLFuncs *gl = filter->context->gl_vtable;
+
+ gl->MatrixMode (GL_PROJECTION);
+ gl->LoadIdentity ();
+ }
+#endif
gst_gl_filter_draw_texture (filter, texture, width, height);
}
diff --git a/gst/gl/gstopengl.c b/gst/gl/gstopengl.c
index b905f51..b439859 100644
--- a/gst/gl/gstopengl.c
+++ b/gst/gl/gstopengl.c
@@ -53,6 +53,7 @@
#include "gstglfiltercube.h"
#include "gstgleffects.h"
+#include "gstglcolorscale.h"
GType gst_gl_filter_cube_get_type (void);
GType gst_gl_effects_get_type (void);
@@ -64,7 +65,6 @@ GType gst_gl_effects_get_type (void);
#include "gstglfilterapp.h"
#include "gstglfilterreflectedscreen.h"
#include "gstglfiltershader.h"
-#include "gstglcolorscale.h"
#include "gstgldeinterlace.h"
#include "gstglmosaic.h"
#include "gstglvideomixer.h"
@@ -123,6 +123,11 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, gst_gl_effects_get_type ())) {
return FALSE;
}
+
+ if (!gst_element_register (plugin, "glcolorscale",
+ GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
+ return FALSE;
+ }
#if GST_GL_HAVE_OPENGL
if (!gst_element_register (plugin, "gltestsrc",
GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) {
@@ -169,11 +174,6 @@ plugin_init (GstPlugin * plugin)
return FALSE;
}
- if (!gst_element_register (plugin, "glcolorscale",
- GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
- return FALSE;
- }
-
if (!gst_element_register (plugin, "glmosaic",
GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) {
return FALSE;