I have a single, fullscreen SurfaceView
. And I have multiple network streams with h264 video which I can decode using MediaCodec
. Is it possible to specify to which coordinates of the Surface
will the video be rendered? So I can create kind of video mozaic?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No, that's not possible. You'll need to use multiple SurfaceTexture
s instead, one per video decoder, and render all the textures into one view using Open GL.
See https://source.android.com/devices/graphics/architecture.html for more explanations on how this works; in particular, each Surface
can only have one producer and one consumer.
回答2:
In single SurfaceView - no. For more information you can explore SurfaceView source code. Maybe some effect of mosaic you can create using the few SurfaceView and adding special byte buffer trimer - to combine one video to several SV and getting full video.
But anyway! It will not be a good idea, if we talk about performance.