Android OpenGL combination of SurfaceTexture (external image) and ordinary texture

前端 未结 8 556
深忆病人
深忆病人 2020-12-28 10:09

I would like to mix camera preview SurfaceTexture with some overlay texture. I am using these shaders for processing:

private final String vss =          


        
8条回答
  •  伪装坚强ぢ
    2020-12-28 10:32

    This is not an answer, but rather an elaboration of the question - maybe it will help an OpenGl ES expert to get an idea of the problem.


    I have 3 textures used for overlay, and one external texture, used to capture output from media player. If I use only external texture, output is as expected, frames from MPlayer. The same full code works fine on Nexus4, Samsung Galaxy S3, S4, etc. (all devices use either adreno gpus, or Arm's Mali400) The difference in hardware is that Nexus 7 uses Nvidia Tegra 3 board.


    Edit (how was solved on my side):

    Nvidia Tegra 3 requires that external texture sampler is called with a name with lowest alphabetical ordering among samplers, while Adreno 220 seem to require the reverse. Also, T3 require that external texture is sampled last. With devices using Android 4.3 and newer, these bugs may be solved. On Nvidia side, it was a bug, solved long ago but Nexus drivers were updated only later. So I had to check which gpu was present, and adapt code accordingly.

提交回复
热议问题