<div dir="ltr"><div>Ok, I replaced PAUSED with NULL I hope to solve the issue. Thanks!<br></div><div><div><br></div><div>Yes I was referring to problems when the application goes in background, suspend, etc... and according with Apple documentation:</div><div><div><a class="" href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive:" title="Tells the delegate that the app is about to become inactive." style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none;font-family:Menlo,monospace;display:inline!important;background-image:initial;background-repeat:initial">applicationWillResignActive:</a><span style="color:rgb(80,0,80)">  </span><font color="#000000">is called <span style="font-family:Helvetica,Arial,sans-serif;line-height:20.3px"> when </span></font><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif;line-height:20.3px">leaving the foreground state(before the application is suspended.. ),</span></div><div><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif;line-height:20.3px">Usually the right callback to use is </span><a class="" href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationDidEnterBackground:" title="Tells the delegate that the app is now in the background." style="color:rgb(0,136,204);border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;text-decoration:none;font-family:Menlo,monospace;display:inline!important;background-image:initial;background-repeat:initial">applicationDidEnterBackground</a> (<span style="color:rgb(65,65,65);line-height:20.3px;font-family:Helvetica,Arial,sans-serif;background-color:transparent">Tells the delegate that the app is now in the background.</span>) , but IMHO it's too late because the EGLContext is already disposed and it's too late to stop the pipeline. </div><div>So I'm using the callback <a class="" href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive:" title="Tells the delegate that the app is about to become inactive." style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none;font-family:Menlo,monospace;display:inline!important;background-image:initial;background-repeat:initial">applicationWillResignActive:</a><span style="color:rgb(80,0,80)"> </span><font color="#000000">where the EGLContext is still valid</font><font color="#500050">.</font><br></div><div>What do you think?</div></div></div><div>Elio</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-06 9:05 GMT+01:00 Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sa, 2016-03-05 at 18:24 +0100, elio francesconi wrote:<br>
> Hi all,<br>
> I'm facing a crash with my iOS application. It seems the pipeline<br>
> tries to draw video when graphical context is already disposed and<br>
> the application crashes.<br>
> I solved executing in applicationWillResignActive (immediately before<br>
> the graphical context is destroyed gst_element_set_state (pPipeline,<br>
> GST_STATE_PAUSED);<br>
> This is the pseudocode:<br>
> - (void)applicationWillResignActive:(UIApplication *)application {<br>
> gst_element_set_state (pPipeline, GST_STATE_PAUSED);<br>
> }<br>
> It is not the best solution to solve the issue because sometimes my<br>
> pipeline hangs pausing and the iOS application crashes due to<br>
> WATCHDOG in the main thread..<br>
><br>
> How can I solve this issue?<br>
><br>
> Is there a best way to stop immediately the pipeline?<br>
<br>
</span>Setting it to NULL state. If that hangs, you found a bug and should<br>
report that. It should never ever hang :)<br>
<br>
Setting the pipeline to NULL state also generally seems the right thing<br>
to do when the application shuts down (I assume that's what "will<br>
resign active" means?). Independent of that there are also similar<br>
problems if the application goes into the background, suspend, etc.<br>
These things need to be handled currently in the application to prevent<br>
crashes and it's not clear yet how we should handle that from GStreamer<br>
as AFAIU you need to install application callbacks to get notified<br>
about these things.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>