2

MediaCodec can render directly to a Surface, which can be setted by the configure method:

public void configure (MediaFormat format, 
                Surface surface, 
                MediaCrypto crypto, 
                int flags)

I have working code that renders to a SurfaceTexture. Also, Surface's documentation says that

A Surface is generally created by or from a consumer of image buffers (such as a SurfaceTexture, MediaRecorder, or Allocation),

But I didn't find any methods in SurfaceTexture or Surface that permits conversion between them

PPP
  • 1,279
  • 1
  • 28
  • 71
  • Hello, there is no conversion per se. Surface is produced from a SurfaceTexture, not the other way around. Check this post for a more complete explanation : https://stackoverflow.com/questions/32161526/surfacetexture-attachtoglcontext-and-surface – Edouard Brèthes Jan 07 '20 at 12:48

0 Answers0