Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-base.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2021-05-26 23:57:28 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-05-31 16:17:37 +0300
commitcd31689cedac8b0cf5566084ef84dfdf3788b00d (patch)
tree068e6bffaee51b9d1f3dcd183058a5756d2400c0
parent7641d648259ff89d6da7093316ed5f63ef1fe4f9 (diff)
glcontext: Ask for an alpha channel and fallback
While this was already possible through the GLContext machinary, this simply request an alpha channel by default and fallback if this is not possible. This obsolete some RPi Dispmanx hack, since this is near equivalent will allow see through when playgin WebM Alpha or other transparent files. Application are still free to pass their own EGLContext attribute, this is specially for the case the application let GStreamer chose (e.g. gst-launch). Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1176>
-rw-r--r--gst-libs/gst/gl/egl/gstglcontext_egl.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c
index 1254fdd09..459ee63b0 100644
--- a/gst-libs/gst/gl/egl/gstglcontext_egl.c
+++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c
@@ -635,6 +635,7 @@ gst_gl_context_egl_choose_config (GstGLContextEGL * egl, GstGLAPI gl_api,
EGLint egl_api = 0;
EGLBoolean ret = EGL_FALSE;
EGLint surface_type = EGL_WINDOW_BIT;
+ EGLint alpha_size = 1;
GstGLWindow *window;
window = gst_gl_context_get_window (GST_GL_CONTEXT (egl));
@@ -704,12 +705,6 @@ try_again:
/* TODO: more values */
#undef TRANSFORM_VALUE
} else {
-#if defined(USE_EGL_RPI) && GST_GL_HAVE_WINDOW_WAYLAND
- /* The configurations with a=0 seems to be buggy whereas
- * it works when using dispmanx directly */
- config_attrib[i++] = EGL_ALPHA_SIZE;
- config_attrib[i++] = 1;
-#endif
config_attrib[i++] = EGL_DEPTH_SIZE;
config_attrib[i++] = 16;
config_attrib[i++] = EGL_RED_SIZE;
@@ -718,6 +713,8 @@ try_again:
config_attrib[i++] = 1;
config_attrib[i++] = EGL_BLUE_SIZE;
config_attrib[i++] = 1;
+ config_attrib[i++] = EGL_ALPHA_SIZE;
+ config_attrib[i++] = alpha_size;
}
config_attrib[i++] = EGL_NONE;
@@ -732,6 +729,12 @@ try_again:
GST_TRACE_OBJECT (egl, "Retrying config with window bit");
goto try_again;
}
+
+ if (alpha_size == 1) {
+ alpha_size = 0;
+ GST_TRACE_OBJECT (egl, "Retrying config not forcing an alpha channel");
+ goto try_again;
+ }
}
if (ret && numConfigs == 1) {