Problem when binding Android Surface to glimagesink

Sebastian Dröge sebastian at centricular.com
Fri May 6 14:35:35 UTC 2016


On Fr, 2016-05-06 at 01:42 -0700, Wei Lee wrote:
> Hi Sebastian, 
> 
> Thanks for your reply. The following is my GStreamer code. 
> 
> http://paste.ofcode.org/3npqJKDwgavsxnGvL8ws5k
> 
> 
> Basically, I follow the tutorial and does not modify a lot. And it
> could work well if I use SurfaceView and get Surface just like the
> tutorial does. 
> 
> However, since I want to play video using Google cardboard SDK, I use
> an OpenGL ES engine on Android called Rajawali. It gives me a Surface
> which is created by a SurfaceTexture. If I use the Surface like
> this: 
> 
> SufaceTexture surfaceTexture; // Created by engine 
> Surface surface = new Surface(surfaceTexture); 
> nativeSurfaceInit(surface); 
> 
> In this case, it will draw the content on a new Context which is not
> rendered by the engine. 
> However, if I use Surface by Android MediaPlayer like this: 
> 
> SufaceTexture surfaceTexture; // Created by engine 
> Surface surface = new Surface(surfaceTexture); 
> MediaPlayer mp = MediaPlayer.create(mContext, R.raw.test); 
> mp.setSurface(surface); 
> mp.start(); 
> 
> It will not create a new context and render on the current context so
> I can see the result. 
> It seems glimagesink will create a new context to draw by default. 
> Is it possible to do some operations to make glimagesink draw content
> on original context just like the MediaPlayer does? 

If you can get access to the context that should be used, and also can
use that in your own thread or otherwise have a way of using it, sure.

Take a look at how gtkglsink or qmlvideosink or caopengllayersink are
working. Something similar can be done in your case too then.

-- 
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/aef518dd/attachment.sig>


More information about the gstreamer-devel mailing list