I want to get the image stream when I render in glsurfaceview with finger The purpose is record the render form glsurfaceview , I was done it with camera use surfacetexture to encode the .mp4, but I can't get the render from glsurfaceview when I draw.
How to get the image stream when I use GLsurfaceview renderer
747 views Asked by Capybara Chan At
1
Get your
GLSurfaceView'sEGLContextwithEGL14.eglGetCurrentContext()Use the
EGLContextabove as shared context in a separated thread to create anotherEGLContextfor recordingThe recording
EGLContextwill render into aSurfaceget fromMediaCodec.createInputSurface, also it use the same texture fromGLSurfaceViewUse
MediaMuxerto mux yourMediaCodecoutput to mp4Then you can record your
GLSurfaceViewto mp4See the example in sample code