Closed jinyingfeng closed 6 years ago
cameraPreviewTextureView.setOnCreateGLContextListener(new GLThread.OnCreateGLContextListener() { @Override public void onCreate(EglContextWrapper eglContext) { streamPublisher = new StreamPublisher(eglContext, muxer); } }); streamPublisher = new StreamPublisher(eglContext, muxer); 这一句经常没有执行,这个oncreate是在哪里调用的?没有执行导致streamPublisher =null。
这个只会在GL线程创建的时候创建,除了初始化外,只有彻底关闭后重新初始化才会重新执行。可以参考 例子里onResume和onPause里的调用
cameraPreviewTextureView.setOnCreateGLContextListener(new GLThread.OnCreateGLContextListener() { @Override public void onCreate(EglContextWrapper eglContext) { streamPublisher = new StreamPublisher(eglContext, muxer); } }); streamPublisher = new StreamPublisher(eglContext, muxer); 这一句经常没有执行,这个oncreate是在哪里调用的?没有执行导致streamPublisher =null。