After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751101 - glimagesink: Broken on iOS
glimagesink: Broken on iOS
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.5.1
Other other
: Normal blocker
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-17 10:12 UTC by woodyjon
Modified: 2015-08-16 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
debug log of tuto 3 (416.70 KB, text/plain)
2015-06-23 08:29 UTC, woodyjon
  Details
eagl: Don't dispatch_sync() to the main thread if we are on the main thread (3.44 KB, patch)
2015-06-23 09:05 UTC, Sebastian Dröge (slomo)
rejected Details | Review
gl/eagl: Don't call anything synchronously from the main thread (6.30 KB, patch)
2015-07-06 10:29 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description woodyjon 2015-06-17 10:12:05 UTC
In the ios tutos ported to 1.0, found here http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/ , the tuto 3 don't work anymore with v1.5.1 (downloaded here http://gstreamer.freedesktop.org/data/pkg/ios/1.5.1/).

To reproduce, just install the sdk 1.5.1 and launch tuto 3. When you click on the play button, nothing happens. When you do it with 1.4.5, the stream plays as expected.
Comment 2 Sebastian Dröge (slomo) 2015-06-23 08:03:29 UTC
Does it work with tutorial 4 or 5 on a video file, or is it also broken there?


Can you provide a GStreamer debug log with tutorial 3, i.e. by doing gst_debug_set_default_threshold(GST_LEVEL_DEBUG) somewhere before starting the pipeline?
Comment 3 woodyjon 2015-06-23 08:29:24 UTC
Created attachment 305898 [details]
debug log of tuto 3

First the log after launching the pipeline. And below the log after hitting "play".
Comment 4 woodyjon 2015-06-23 08:36:34 UTC
Above debug log is for tuto 3 with
pipeline = gst_parse_launch("videotestsrc ! warptv ! videoconvert ! autovideosink", &error);
Comment 5 woodyjon 2015-06-23 08:48:14 UTC
And tutorial 4 works with playbin and setting the uri.
Comment 6 Sebastian Dröge (slomo) 2015-06-23 08:56:23 UTC
There's no more output after the last line?

> 0:03:28.669232000 [331m17850[00m  0x28ae0a8 [36mINFO   [00m [00m           glcontext gstglcontext.c:1272:gst_gl_context_create_thread:<glcontexteagl0>[00m Attempting to create opengl context. user chosen api(s) (any), compiled api support (gles2) display api (opengl opengl3 gles2)
Comment 7 Sebastian Dröge (slomo) 2015-06-23 09:05:38 UTC
Created attachment 305902 [details] [review]
eagl: Don't dispatch_sync() to the main thread if we are on the main thread

This will otherwise deadlock.
Comment 8 Sebastian Dröge (slomo) 2015-06-23 09:07:33 UTC
This might fix it, please test
Comment 9 woodyjon 2015-06-23 09:27:57 UTC
Ok I will try it. Sorry I am not sure where I must modify this file? And whether I will have to rebuild the pkg after modifying it?
Comment 10 Sebastian Dröge (slomo) 2015-06-23 12:31:11 UTC
Comment on attachment 305902 [details] [review]
eagl: Don't dispatch_sync() to the main thread if we are on the main thread

Doesn't help. The problem is that gst_gl_context_create() is called from the main thread, which then calls gst_gl_context_create_thread() from another thread and waits until that thread is finished with creating the context. Unfortunately that thread needs to call something from the main thread to finish, which is not possible because the main thread is waiting.

So both threads wait on each other.
Comment 11 Sebastian Dröge (slomo) 2015-06-23 12:44:42 UTC
I think to fix that we need to replace the g_cond_wait() there with a vfunc, and in the case of iOS would iterate the NSRunLoop on the main thread there (or if not called from the main thread, just wait in whatever way we want).
Comment 12 Sebastian Dröge (slomo) 2015-06-23 17:46:05 UTC
Also I would expect this to be broken in 1.4 too, IIRC it was always like this with the context creation threads.
Comment 13 woodyjon 2015-06-24 07:19:25 UTC
I confirm that I don't have that issue with 1.4.5, it works fine.
And for your earlier question if there's more input after the last line, no it is the last line.
Comment 14 Sebastian Dröge (slomo) 2015-06-24 08:35:02 UTC
As a workaround you can for now set the pipeline to PAUSED/PLAYING from another thread than the main thread
Comment 15 Sebastian Dröge (slomo) 2015-06-24 13:11:52 UTC
maybe in 1.4 we didn't create a context as direct result of the the state change but only created it later from the streaming thread
Comment 16 Sebastian Dröge (slomo) 2015-07-06 10:23:17 UTC
Currently all the things we do in dispatch_sync() blocks should be possible to do from our current thread, at least if CALayer is thread-safe on iOS (it is on OSX).
Comment 17 Sebastian Dröge (slomo) 2015-07-06 10:29:23 UTC
Created attachment 306904 [details] [review]
gl/eagl: Don't call anything synchronously from the main thread

This will deadlock if the main thread is the one who creates the GstGLContext.
All things we call from the main thread should be possible from any thread.
Comment 18 Jan Schmidt 2015-07-08 12:47:17 UTC
Comment on attachment 306904 [details] [review]
gl/eagl: Don't call anything synchronously from the main thread

This patch makes things work for me on iOS - pushing.
Comment 19 dkabyshev 2015-07-20 12:30:36 UTC
Hi Guys,

I've tried 1.5.2 release and got the same issue. I'm wondering, if it was included into 1.5.2, despite that the changelog states yes - http://gstreamer.freedesktop.org/releases/gst-plugins-bad/1.5.2.html, but looks like it was not. Could you confirm?

Thanks
Comment 20 Jan Schmidt 2015-07-20 12:34:02 UTC
No, the fix will only be in 1.5.3 when we roll that. I'm not sure how it ended up in the fixed bug list for 1.5.2