summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <ystreet00@gmail.com>2014-05-01 14:11:00 +1000
committerMatthew Waters <ystreet00@gmail.com>2014-05-01 14:11:00 +1000
commit5681f78362cc2b20b4dd71d1836e25c27e3e410f (patch)
treec5c91387ef9bee29bdfe4d2e0737aee8091b4e8c
parent598a79a5e21a03aa59a14e0c5976cf6458b1b373 (diff)
downloadgstreamer-plugins-bad-5681f78362cc2b20b4dd71d1836e25c27e3e410f.tar.gz
glcolorscale: fix operation with dual GL, GLES2 libgstgl
-rw-r--r--ext/gl/gstglcolorscale.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/ext/gl/gstglcolorscale.c b/ext/gl/gstglcolorscale.c
index b4f501bd9..bde35c3a0 100644
--- a/ext/gl/gstglcolorscale.c
+++ b/ext/gl/gstglcolorscale.c
@@ -160,15 +160,17 @@ gst_gl_colorscale_gen_gl_resources (GstGLFilter * filter)
{
GstGLColorscale *colorscale = GST_GL_COLORSCALE (filter);
- gst_gl_context_thread_add (filter->context,
- (GstGLContextThreadFunc) _compile_identity_shader, colorscale);
-
- if (!colorscale->shader) {
- gst_gl_context_set_error (filter->context,
- "Failed to initialize identity shader");
- GST_ELEMENT_ERROR (colorscale, RESOURCE, NOT_FOUND, ("%s",
- gst_gl_context_get_error ()), (NULL));
- return FALSE;
+ if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_GLES2) {
+ gst_gl_context_thread_add (filter->context,
+ (GstGLContextThreadFunc) _compile_identity_shader, colorscale);
+
+ if (!colorscale->shader) {
+ gst_gl_context_set_error (filter->context,
+ "Failed to initialize identity shader");
+ GST_ELEMENT_ERROR (colorscale, RESOURCE, NOT_FOUND, ("%s",
+ gst_gl_context_get_error ()), (NULL));
+ return FALSE;
+ }
}
return TRUE;
@@ -195,13 +197,15 @@ gst_gl_colorscale_filter_texture (GstGLFilter * filter, guint in_tex,
colorscale = GST_GL_COLORSCALE (filter);
#if GST_GL_HAVE_GLES2
- gst_gl_filter_render_to_target_with_shader (filter, TRUE, in_tex, out_tex,
- colorscale->shader);
+ if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_GLES2)
+ gst_gl_filter_render_to_target_with_shader (filter, TRUE, in_tex, out_tex,
+ colorscale->shader);
#endif
#if GST_GL_HAVE_OPENGL
- gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
- gst_gl_colorscale_callback, colorscale);
+ if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_OPENGL)
+ gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
+ gst_gl_colorscale_callback, colorscale);
#endif
return TRUE;