Problem when binding Android Surface to glimagesink

Sebastian Dröge sebastian at centricular.com
Fri May 6 07:06:08 UTC 2016


On Do, 2016-05-05 at 05:52 -0700, Wei Lee wrote:
> Hi everyone,
> 
> I am new to GStreamer. I am developing an Android app which could play video
> using GStreamer. I have a SurfaceTexture to link with video sink on the
> GStreamer side. First, I get a Surface from SurfaceTexture and pass it to
> the native GStreamer codes just like  this tutorial
>  
> . The differences are that I use GStreamer 1.0 rather than 0.1 and I
> modified my pipeline to 
> 
> "videotestsrc ! videoconvert ! glimagesink"
> 
> for simple testing. However, I cannot see the correct result. All I see is
> all blank.
> 
> But if I link a Surface which is from a SurfaceView just like the tutorial,
> I could see the result correctly.
> Also, if I bind the Surface not with GStreamer codes but with Android
> MediaPlayer object by setSurface() method of it, the result is fine too.
> 
> After using an OpenGL ES Debugger on Android, I found out that when I link
> Surface with glimagesink , it will somehow trigger eglCreateContext() and
> put data in that Context rather than the original one. I guess that is the
> reason why I get blank view. All the data is drawn on a context which is
> unseen.
> 
> Could anybody give me some hints to fix the problem ?

Can you share your code? It's expected that glimagesink is using its
own GL context for rendering into the surface and not any of the
application contexts.

You can find an example that works with 1.x here:
https://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tutorials/android-tutorial-3

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160506/348bb72f/attachment.sig>


More information about the gstreamer-devel mailing list