Android surface corruption

Damien Dejean damien.dejean at bt-ground.com
Mon Apr 20 23:49:13 PDT 2015


Hi gstreamer team !

We’re currently using GStreamer 1.4.5 on Android to read a RTP/VP8 stream from the network, decode it and display it on an Android native surface using the glimagesink. We’re facing a strange interaction between GStreamer and the surface we delegated to it. The typical use case for us is to set up the pipeline, and when the pipeline is READY we’re injecting him the surface. When the network stream comes, the pipeline move from PAUSED to PLAYING and it plays correctly. Then we stop playing, remove the surface and we destroy the pipeline.

But if after the injection, in PAUSED state, we remove the surface and we destroy the pipeline, the surface is set to a wrong state, and Android is not able to use it anymore. In the logs joined below, we see that the thread that runs the GST loop issues an eglTerminate() which does not happen on the « normal » use-case described above.

Below are the log generated by our app, do you have any hint on what’s going on there ? Do we made a bad use of the pipeline or is there a bad behavior in glimagesink ?

Thanks in advance for your help

Best regards,

Damien.

01-02 05:40:21.700  5268  5327 D GStreamerPipelineFactoryImpl: Playing from SDP file, src=filesrc, URL=/sdcard/Movies/stream.sdp
01-02 05:40:21.700  5268  5348 D GStreamerPipelineImpl: handleMessage(CREATE)
01-02 05:40:21.700  5268  5348 D GStreamerPipelineImpl: handleMessage(RUN)
01-02 05:40:21.710  5268  5348 D GStreamerPipelineImpl: onStateChange(READY)
01-02 05:40:21.710  5268  5348 I GStreamerManager: Pipeline state: READY
01-02 05:40:21.710  5268  5348 D GStreamerPipelineImpl: attachToSurface()
01-02 05:40:21.750  5268  5348 D GStreamerPipelineImpl: onStateChange(PAUSED)
01-02 05:40:21.750  5268  5348 I GStreamerManager: Pipeline state: PAUSED
01-02 05:40:21.750  5268  5350 W GStreamer+GST_PADS: 0:00:30.697555337 0x54ab7800 gstpad.c:3739:gst_pad_peer_query:<rtpsession1:recv_rtp_src> could not send sticky events
01-02 05:40:22.490  5268  5349 I PresenterWatcherImpl: Presenter left, notifying ...
01-02 05:40:22.490  5268  5349 D StreamingSessionManager: onDeath()
01-02 05:40:22.490  5268  5349 D GStreamerPipelineImpl: detachFromSurface()
01-02 05:40:22.490  5268  5348 D GStreamerPipelineImpl: onStateChange(PAUSED)
01-02 05:40:22.490  5268  5348 I GStreamerManager: Pipeline state: PAUSED
01-02 05:40:22.500  5268  5348 D GStreamerPipelineImpl: onStateChange(READY)
01-02 05:40:22.500  5268  5348 W libEGL  : eglTerminate() called w/ 2 objects remaining
01-02 05:40:22.500  5268  5348 D GStreamerPipelineImpl: handleMessage(DESTROY)
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 W HardwareRenderer: EGL error: EGL_NOT_INITIALIZED
[...]
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 E libEGL  : eglMakeCurrent:696 error 3008 (EGL_BAD_DISPLAY)
01-02 05:40:22.750  5268  5268 E libEGL  : validate_display:256 error 3001 (EGL_NOT_INITIALIZED)
01-02 05:40:22.750  5268  5268 W HardwareRenderer: Mountain View, we've had a problem here. Switching back to software rendering.
01-02 05:40:22.760  1399  1504 E BufferQueue: [com.btground.btbox/com.btground.btbox.activities.DisplayActivity] connect: already connected (cur=1, req=2)
01-02 05:40:22.770  5268  5268 E ViewRootImpl: Could not lock surface
01-02 05:40:22.770  5268  5268 E ViewRootImpl: java.lang.IllegalArgumentException
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Surface.nativeLockCanvas(Native Method)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Surface.lockCanvas(Surface.java:243)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Choreographer.doCallbacks(Choreographer.java:574)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Choreographer.doFrame(Choreographer.java:544)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.os.Handler.handleCallback(Handler.java:733)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.os.Handler.dispatchMessage(Handler.java:95)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.os.Looper.loop(Looper.java:136)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at android.app.ActivityThread.main(ActivityThread.java:5017)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at java.lang.reflect.Method.invokeNative(Native Method)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at java.lang.reflect.Method.invoke(Method.java:515)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
01-02 05:40:22.770  5268  5268 E ViewRootImpl:  at dalvik.system.NativeStart.main(Native Method)



More information about the gstreamer-devel mailing list