



其实就是共享了纹理id和glcontext,感觉类似于多surface渲染统一画面,只不过MediaCodec的surface我们看不见而已。
大致流程:首先是CameraView继承了自定义的GLSurfaceView,CameraView通过摄像头实时预览,然后将自定义的GLSurfaceView的纹理id和glcontext共享给MediaCodec的surface,这样MediaCodec的surface就能实时获取到摄像头的数据,然后就可以利用MediaMuxer对MediaCodec的surface中的数据进行编码了。
网友评论