ChillingVan / AndroidInstantVideo

展现Android硬编码下的视频数据流动,可以对视频做处理,例如加滤镜,加水印等,做直播推流(用RTMP)。 Show the stream of Android video hardware encode, including video processing and video publishing by RTMP.
Apache License 2.0
718 stars 196 forks source link

streamPublisher 为null的问题 #19

Closed jinyingfeng closed 6 years ago

jinyingfeng commented 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。

ChillingVan commented 6 years ago

这个只会在GL线程创建的时候创建,除了初始化外,只有彻底关闭后重新初始化才会重新执行。可以参考 例子里onResume和onPause里的调用