1、
org.webrtc.examples.androidnativeapi E/rtc: #
# Fatal error in: I:\webrtc\android\androidnativeapi\app\src\main\cpp\androidcallclient.cc, line 182
# last system error: 2
# Check failed: (&thread_checker_)->IsCurrent()
#
2021-08-03 16:28:43.573 24948-24948/org.webrtc.examples.androidnativeapi A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 24948 (ndroidnativeapi), pid 24948 (ndroidnativeapi)
解决办法:是因为界面直接调用jni native函数导致,需要在主线程调用
handler.post(() -> {
nativeConnectToPeer(nativeClient,peerid);
});
2、
最近封装janus的websocket信令,发现CreateOffer后OnSuccess无法正常回调,查资料后发现,是因为创建PeerConnectionFactory时,传入的信令线程为空指针,如下:
bool Conductor::InitializePeerConnection() {
RTC_DCHECK(!peer_connection_factory_);
RTC_DCHECK(!peer_connection_);
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
nullptr /* network_thread */, nullptr /* worker_thread */,
nullptr /* signaling_thread */, nullptr /* default_adm */,
webrtc::CreateBuiltinAudioEncoderFactory(),
webrtc::CreateBuiltinAudioDecoderFactory(),
webrtc::CreateBuiltinVideoEncoderFactory(),
webrtc::CreateBuiltinVideoDecoderFactory(), nullptr /* audio_mixer */,
nullptr /* audio_processing */);
if (!peer_connection_factory_) {
main_wnd_->MessageBox("Error", "Failed to initialize PeerConnectionFactory",
true);
DeletePeerConnection();
return false;
}
if