GNOME Bugzilla – Bug 746251
android/egl: changing window handle breaks video playback
Last modified: 2015-04-17 12:36:47 UTC
Video playback is currently broken on the android platform. Executing tutorial5 leads to no video being displayed and the following logcat output (from android 5.1): http://fpaste.org/198234/43509614/ The regression seems to have been introduced by the following commit: 0c800027ba844712e01de86f49cfb7c66a0ad240 Video playback works at the previsous revision efaca13d11882ad2eb9ceb9cf8f0d8722d75cb88
It looks like #731107. Maybe similar changes than http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=59088f5a90960cde183a72bde2754be749750aa6 have to be applied to newer code.
Matthieu, does it also work with latest GIT master and just reverting that specific commit?
(In reply to Sebastian Dröge (slomo) from comment #2) > Matthieu, does it also work with latest GIT master and just reverting that > specific commit? I've just tested with latest git + reverting 0c800027ba844712e01de86f49cfb7c66a0ad240 but it leads to some gl element failing to allocate gl buffers. (In reply to Julien Isorce from comment #1) > It looks like #731107. Maybe similar changes than > http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/ > ?id=59088f5a90960cde183a72bde2754be749750aa6 have to be applied to newer > code. Would you know where in the code this should be applied too ? I'm not familiar at all with the latest gl changes. Is there some documentation explaining the changes and how it works ?
For iOS, something like this was fixed here: https://bugzilla.gnome.org/show_bug.cgi?id=745090#c9 Maybe that diff can help to fix it for Android too
The issues happens when the window handle is changed by the application (here the android tutorial-5 when it detects a resolution change as it tries to adapt the surface to the new size). It does not happen with a simple pipeline with no window handle change, sorry for the dramatic title. The first critical error happens when gst_gl_context_activate (context, TRUE) is called from gst_gl_window_set_window_handle as glimagesink has detected a window handle change. It fails to create the surface texture with the following error: D/GStreamer+glcontext(23262): 0:00:03.712789635 0xa27664c0 gstglcontext.c:629:gst_gl_context_activate:<glcontextegl1> activate:1 D/GStreamer+glcontext(23262): 0:00:03.712942604 0xa27664c0 gstglcontext_egl.c:524:gst_gl_context_egl_activate:<glcontextegl1> Handle changed (have:0x0, now:0x9d56b208), switching surface E/BufferQueueProducer( 175): [SurfaceView] connect(P): already connected (cur=1 req=1) E/libEGL (23262): eglCreateWindowSurface: native_window_api_connect (win=0x9d56b208) failed (0xffffffea) (already connected to another API?) E/libEGL (23262): eglCreateWindowSurface:416 error 3003 (EGL_BAD_ALLOC) E/GStreamer+glcontext(23262): 0:00:03.713529999 0xa27664c0 gstglcontext_egl.c:536:gst_gl_context_egl_activate:<glcontextegl1> Failed to create window surface: EGL_BAD_ALLOC It is likely that some ressource are leaked / not properly de-initialized somewhere. I have attached a patch that adds error logging in gst_gl_context_egl_activate and make the function fails if the surface is not created (even if the return code is not checked by its caller). I will continue my investigation.
Created attachment 301701 [details] [review] gstglcontext: Make gst_gl_context_egl_activate fail if the surface could not be created
Maybe related to bug #747911
Issue is fixed by 747911 and 748033.
Created attachment 301802 [details] [review] gstglcontext: Make gst_gl_context_egl_activate fail if the surface could not be created
Comment on attachment 301802 [details] [review] gstglcontext: Make gst_gl_context_egl_activate fail if the surface could not be created Does not apply to latest master
Created attachment 301826 [details] [review] gstglcontext: Make gst_gl_context_egl_activate fail if the surface could not be destroyed
commit 93d2e67cbc966d98606d676860dd0d19fdc3a4e8 Author: Matthieu Bouron <matthieu.bouron@collabora.com> Date: Fri Apr 17 14:24:28 2015 +0200 glcontext: Make gst_gl_context_egl_activate fail if the old surface could not be destroyed https://bugzilla.gnome.org/show_bug.cgi?id=746251