iOS: pausing video streaming pipeline before dispose graphical context

elio francesconi elio.francesconi at gmail.com
Sun Mar 6 10:13:51 UTC 2016


Ok, I replaced PAUSED with NULL I hope to solve the issue. Thanks!

Yes I was referring to problems when the application goes in background,
suspend, etc... and according with Apple documentation:
applicationWillResignActive:
<https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive:>
  is called  when leaving the foreground state(before the application is
suspended.. ),
Usually the right callback to use is applicationDidEnterBackground
<https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationDidEnterBackground:>
 (Tells the delegate that the app is now in the background.) , but IMHO
it's too late because the EGLContext is already disposed and it's too late
to stop the pipeline.
So I'm using the callback applicationWillResignActive:
<https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive:>
 where the EGLContext is still valid.
What do you think?
Elio

2016-03-06 9:05 GMT+01:00 Sebastian Dröge <sebastian at centricular.com>:

> On Sa, 2016-03-05 at 18:24 +0100, elio francesconi wrote:
> > Hi all,
> > I'm facing a crash with my iOS application. It seems the pipeline
> > tries to draw video when graphical context is already disposed and
> > the application crashes.
> > I solved executing in applicationWillResignActive (immediately before
> > the graphical context is destroyed gst_element_set_state (pPipeline,
> > GST_STATE_PAUSED);
> > This is the pseudocode:
> > - (void)applicationWillResignActive:(UIApplication *)application {
> > gst_element_set_state (pPipeline, GST_STATE_PAUSED);
> > }
> > It is not the best solution to solve the issue because sometimes my
> > pipeline hangs pausing and the iOS application crashes due to
> > WATCHDOG in the main thread..
> >
> > How can I solve this issue?
> >
> > Is there a best way to stop immediately the pipeline?
>
> Setting it to NULL state. If that hangs, you found a bug and should
> report that. It should never ever hang :)
>
> Setting the pipeline to NULL state also generally seems the right thing
> to do when the application shuts down (I assume that's what "will
> resign active" means?). Independent of that there are also similar
> problems if the application goes into the background, suspend, etc.
> These things need to be handled currently in the application to prevent
> crashes and it's not clear yet how we should handle that from GStreamer
> as AFAIU you need to install application callbacks to get notified
> about these things.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160306/1fb6de22/attachment.html>


More information about the gstreamer-devel mailing list