I am implementing a connection between a WebRTC peer-to-peer connection for audio calls using C ++.
I have two threads _worker_thread and _signaling_thread . Now when I try to create _peerConnectionFactory by calling the webrtc::CreatePeerConnectionFactory() method, my application crashes. How can I make it work?
_signaling_thread.reset(new rtc::Thread()); if(!_signaling_thread->Start()) { printf("_signaling_thread is Failed"); return; } _worker_thread.reset(new rtc::Thread()); if (!_worker_thread->Start()) { printf( "_worker_thread is Failed"); return; } _peerConnectionFactory = webrtc::CreatePeerConnectionFactory(_worker_thread.get(),_signaling_thread.get(),NULL,NULL,NULL);
This is the backtrace I get
* thread #15: tid = 0x17e516, 0x00000001008d5674 MyAPP`rtc::MessageQueue::Get(rtc::Message*, int, bool) + 816, stop reason = EXC_BAD_ACCESS (code=1, address=0x100000038) * frame #0: 0x00000001008d5674 MyAPP`rtc::MessageQueue::Get(rtc::Message*, int, bool) + 816 frame #1: 0x00000001008e5fb0 MyAPP`rtc::Thread::ProcessMessages(int) + 100 frame #2: 0x00000001008e5e44 MyAPP`rtc::Thread::PreRun(void*) + 88 frame #3: 0x0000000199337b3c libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x0000000199337aa0 libsystem_pthread.dylib`_pthread_start + 1
source share