Sink: inform about used OpenGL(ES) version

This commit is contained in:
Rafostar
2021-03-31 17:02:03 +02:00
parent d54781eda7
commit 43acfddb06

View File

@@ -800,6 +800,23 @@ gtk_clapper_gl_widget_set_buffer (GtkClapperGLWidget * clapper_widget,
GTK_CLAPPER_GL_WIDGET_UNLOCK (clapper_widget);
}
static GstGLAPI
_get_current_gl_api (GstGLPlatform platform)
{
GstGLAPI gl_api = GST_GL_API_NONE;
guint gl_major = 0, gl_minor = 0;
gl_api = gst_gl_context_get_current_gl_api (platform, &gl_major, &gl_minor);
if (gl_api) {
const gboolean is_es = gl_api & (GST_GL_API_GLES1 | GST_GL_API_GLES2);
GST_INFO ("Using OpenGL%s %d.%d", is_es ? " ES" : "", gl_major, gl_minor);
}
return gl_api;
}
static void
_get_gl_context (GtkClapperGLWidget * clapper_widget)
{
@@ -848,7 +865,7 @@ _get_gl_context (GtkClapperGLWidget * clapper_widget)
#endif
if (gl_handle) {
gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL);
gl_api = _get_current_gl_api (platform);
priv->other_context =
gst_gl_context_new_wrapped (priv->display, gl_handle,
platform, gl_api);
@@ -858,7 +875,7 @@ _get_gl_context (GtkClapperGLWidget * clapper_widget)
#if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (GDK_WINDOWING_WAYLAND)
if (GST_IS_GL_DISPLAY_WAYLAND (priv->display)) {
platform = GST_GL_PLATFORM_EGL;
gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL);
gl_api = _get_current_gl_api (platform);
gl_handle = gst_gl_context_get_current_gl_context (platform);
if (gl_handle)
priv->other_context =