gl: fix various build errors without desktop gl

This commit is contained in:
Matthew Waters 2014-11-28 10:59:46 +11:00 committed by Tim-Philipp Müller
parent a2a8059daf
commit 3be1edc634
4 changed files with 14 additions and 5 deletions

View file

@ -25,10 +25,10 @@
extern const gchar *mirror_fragment_source_opengl; extern const gchar *mirror_fragment_source_opengl;
extern const gchar *squeeze_fragment_source_opengl; extern const gchar *squeeze_fragment_source_opengl;
#endif #endif
#if GST_GL_HAVE_GLES2
extern const gchar *mirror_fragment_source_gles2; extern const gchar *mirror_fragment_source_gles2;
extern const gchar *squeeze_fragment_source_gles2; extern const gchar *squeeze_fragment_source_gles2;
#endif
extern const gchar *stretch_fragment_source; extern const gchar *stretch_fragment_source;
extern const gchar *tunnel_fragment_source; extern const gchar *tunnel_fragment_source;
extern const gchar *fisheye_fragment_source; extern const gchar *fisheye_fragment_source;

View file

@ -210,12 +210,14 @@ gst_gl_colorscale_callback (gint width, gint height, guint texture,
{ {
GstGLFilter *filter = GST_GL_FILTER (stuff); GstGLFilter *filter = GST_GL_FILTER (stuff);
#if GST_GL_API_HAVE_OPENGL
if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_OPENGL) { if (gst_gl_context_get_gl_api (filter->context) & GST_GL_API_OPENGL) {
const GstGLFuncs *gl = filter->context->gl_vtable; const GstGLFuncs *gl = filter->context->gl_vtable;
gl->MatrixMode (GL_PROJECTION); gl->MatrixMode (GL_PROJECTION);
gl->LoadIdentity (); gl->LoadIdentity ();
} }
#endif
gst_gl_filter_draw_texture (filter, texture, width, height); gst_gl_filter_draw_texture (filter, texture, width, height);
} }

View file

@ -216,10 +216,10 @@ gst_gl_effects_set_effect (GstGLEffects * effects, gint effect_type)
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_glow; effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_glow;
filter_class->supported_gl_api = GST_GL_API_OPENGL; filter_class->supported_gl_api = GST_GL_API_OPENGL;
break; break;
#endif
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
#endif
effects->current_effect = effect_type; effects->current_effect = effect_type;
} }

View file

@ -49,11 +49,13 @@ _set_sync_point (GstGLContext * context, GstGLSyncMeta * sync_meta)
{ {
const GstGLFuncs *gl = context->gl_vtable; const GstGLFuncs *gl = context->gl_vtable;
if (gl->FenceSync) { if (gl->FenceSync && gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3) {
if (sync_meta->glsync) if (sync_meta->glsync)
gl->DeleteSync (sync_meta->glsync); gl->DeleteSync (sync_meta->glsync);
#if GST_GL_HAVE_OPENGL
sync_meta->glsync = gl->FenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0); sync_meta->glsync = gl->FenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
GST_LOG_OBJECT (sync_meta, "setting sync object %p", sync_meta->glsync); GST_LOG_OBJECT (sync_meta, "setting sync object %p", sync_meta->glsync);
#endif
} else { } else {
gl->Flush (); gl->Flush ();
} }
@ -67,6 +69,7 @@ gst_gl_sync_meta_set_sync_point (GstGLSyncMeta * sync_meta,
(GstGLContextThreadFunc) _set_sync_point, sync_meta); (GstGLContextThreadFunc) _set_sync_point, sync_meta);
} }
#if GST_GL_HAVE_OPENGL
static void static void
_wait (GstGLContext * context, GstGLSyncMeta * sync_meta) _wait (GstGLContext * context, GstGLSyncMeta * sync_meta)
{ {
@ -83,14 +86,18 @@ _wait (GstGLContext * context, GstGLSyncMeta * sync_meta)
} while (res == GL_TIMEOUT_EXPIRED); } while (res == GL_TIMEOUT_EXPIRED);
} }
} }
#endif
void void
gst_gl_sync_meta_wait (GstGLSyncMeta * sync_meta) gst_gl_sync_meta_wait (GstGLSyncMeta * sync_meta)
{ {
if (sync_meta->glsync) { #if GST_GL_HAVE_OPENGL
if (sync_meta->glsync
&& gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3) {
gst_gl_context_thread_add (sync_meta->context, gst_gl_context_thread_add (sync_meta->context,
(GstGLContextThreadFunc) _wait, sync_meta); (GstGLContextThreadFunc) _wait, sync_meta);
} }
#endif
} }
static gboolean static gboolean