GStreamer on iOS, how to handle background properly for OpenGL ES?

Dmytro Kabyshev dkabyshev at gmail.com
Tue Feb 10 02:14:08 PST 2015


Hello,

Found on GStreamer 1.4.5, iOS 8.1.2. 
While testing our application on iOS, we’ve faced with a crash when going to background with a running pipeline.
The crash happened inside draw_cb (OpenGL ES related code).
I assume this is because Apple’s strict rules regarding background task:

“
Do not make any OpenGL ES calls from your code. You must not create an EAGLContext object or issue any OpenGL ES drawing commands of any kind while running in the background. Using these calls causes your app to be killed immediately. Apps must also ensure that any previously submitted commands have completed before moving to the background. For information about how to handle OpenGL ES when moving to and from the background, see Implementing a Multitasking-aware OpenGL ES Application in OpenGL ES Programming Guide for iOS.
“
Link to guide: https://developer.apple.com/library/ios/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html#//apple_ref/doc/uid/TP40008793-CH5

Could you please help me with some instructions how we could overcome this.
We can’t stop the pipeline, because it is a Lifestream. 

Here’s a pipeline:
avfvideosrc ! video/x-raw,format=NV12,width=960,height=540,framerate=30/1 ! tee name=tp tp. ! queue ! autovideosink tp. ! queue ! videoconvert ! vtenc_h264 bitrate=2500 max-keyframe-interval-duration=2000000000 max-keyframe-interval=60 allow-frame-reordering=false realtime=true quality=0.5 ! h264parse ! video/x-h264,framerate=30/1,width=960,height=540,stream-format=(string)avc,level=(string)3.1,profile=(string)main ! queue ! mux. autoaudiosrc ! audioconvert ! voaacenc bitrate=64000 ! aacparse ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! flvmux streamable=true name=mux ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! rtmpsink location=‘%url_was_here% live=1’

Thanks,
Dmytro Kabyshev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150210/ca9a61d8/attachment.html>


More information about the gstreamer-devel mailing list