Hi,
Is there any way to use SurfaceTexture in GStreamer (Android) to render video directly in OpenGL textures? SurfaceTexture is supported by Android MediaPlayer. However, MediaPlayer has higher latency for rendering live video (~2 Sec.). Therefore, I was hoping to use GStreamer instead of MediaPlayer in Android side to reduce this latency. However, not sure GStreamer can support SurfaceTexture type OpenGL rendering. I will appreciate any input! Thanks! |
Le jeudi 05 juin 2014 à 09:30 -0700, sazzad1009 a écrit :
> Hi, > Is there any way to use SurfaceTexture in GStreamer (Android) to render > video directly in OpenGL textures? > SurfaceTexture is supported by Android MediaPlayer. However, MediaPlayer has > higher latency for rendering live video (~2 Sec.). Therefore, I was hoping > to use GStreamer instead of MediaPlayer in Android side to reduce this > latency. However, not sure GStreamer can support SurfaceTexture type OpenGL > rendering. > > I will appreciate any input! > > Thanks! > started by Andoni Morales and now being resumed by Matthieu Bouron. He reports his progress at: https://bugzilla.gnome.org/show_bug.cgi?id=731204 cheers, Nicolas _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (205 bytes) Download Attachment |
Hello everyone.
I was trying to use https://github.com/sdroege/gst-player as a base for my project. If i try to set openGL surface, in following way: mSurface = new SurfaceTexture(mTextureID); mSurface.setOnFrameAvailableListener(this); Surface surface = new Surface(mSurface); mGstMediaPlayer.setSurface(surface); // This is Player code from example above I hear sound, everything seems ok, but texture is black. Also, frame available notification is received properly. Method above works by simply replacing gstreamer with Android MediaPlayer or VLC or whatever else. Any advice? Thanks people :) |
Hello,
This is probably a layout issue. Android does not know the size of the surface texture during the mesure pass (onMeasure() method of SurfaceTexture class) because the underlying surface property is not published. You have two solutions, either you extends SurfaceTexture to return a size in the onMeasure() method, or you layout this surface in a layout like AnimatorView that will change its properties. Note that all those information are only deduced from my own experiment. I'm not very clear about what's going on in such situation. BR, Damien. Le 09/12/2016 à 04:13 PM, pedjaman a écrit : > Hello everyone. > > I was trying to use > https://github.com/sdroege/gst-player > <https://github.com/sdroege/gst-player> > as a base for my project. > > If i try to set openGL surface, in following way: > > mSurface = new SurfaceTexture(mTextureID); > mSurface.setOnFrameAvailableListener(this); > > Surface surface = new Surface(mSurface); > mGstMediaPlayer.setSurface(surface); // This is Player code > from example above > > I hear sound, everything seems ok, but texture is black. > Also, frame available notification is received properly. > Method above works by simply replacing gstreamer with Android MediaPlayer or > VLC or whatever else. > > Any advice? > > Thanks people :) > > > > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/SurfaceTexture-in-GStreamer-Android-tp4667379p4679535.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thank you for fast response.
Surfaces do not have onMeasure methods. They also cannot be used in layout as they are not visible elements. I assume you are referring to SurfaceView. But i need to render to a Surface. Size of this surface is known as it is constructed from openGL texture of known size. Other players recognize it properly. |
For these who are interested:
Problem was in SurfaceTexture reporting size as 1 x 1 (despite of being 1920, 1080) Therefore, gstreamer was rendering to a single pixel. by calling: mSurface.setDefaultBufferSize(1920, 1080); everything was resolved. Thansk everyone :) |
Free forum by Nabble | Edit this page |