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
718 views Asked by Capybara Chan At
1
Get your
GLSurfaceView
'sEGLContext
withEGL14.eglGetCurrentContext()
Use the
EGLContext
above as shared context in a separated thread to create anotherEGLContext
for recordingThe recording
EGLContext
will render into aSurface
get fromMediaCodec.createInputSurface
, also it use the same texture fromGLSurfaceView
Use
MediaMuxer
to mux yourMediaCodec
output to mp4Then you can record your
GLSurfaceView
to mp4See the example in sample code