Propogate network-worker thread split to api

BUG=webrtc:5645

Review-Url: https://codereview.webrtc.org/1968393002
Cr-Commit-Position: refs/heads/master@{#12767}
This commit is contained in:
danilchap
2016-05-17 01:52:02 -07:00
committed by Commit bot
parent c561479841
commit e9021a3601
18 changed files with 190 additions and 107 deletions

View File

@ -23,23 +23,30 @@
#include <memory>
@implementation RTCPeerConnectionFactory {
std::unique_ptr<rtc::Thread> _signalingThread;
std::unique_ptr<rtc::Thread> _networkThread;
std::unique_ptr<rtc::Thread> _workerThread;
std::unique_ptr<rtc::Thread> _signalingThread;
}
@synthesize nativeFactory = _nativeFactory;
- (instancetype)init {
if ((self = [super init])) {
_signalingThread.reset(new rtc::Thread());
BOOL result = _signalingThread->Start();
NSAssert(result, @"Failed to start signaling thread.");
_workerThread.reset(new rtc::Thread());
_networkThread = rtc::Thread::CreateWithSocketServer();
BOOL result = _networkThread->Start();
NSAssert(result, @"Failed to start network thread.");
_workerThread = rtc::Thread::Create();
result = _workerThread->Start();
NSAssert(result, @"Failed to start worker thread.");
_signalingThread = rtc::Thread::Create();
result = _signalingThread->Start();
NSAssert(result, @"Failed to start signaling thread.");
_nativeFactory = webrtc::CreatePeerConnectionFactory(
_workerThread.get(), _signalingThread.get(), nullptr, nullptr, nullptr);
_networkThread.get(), _workerThread.get(), _signalingThread.get(),
nullptr, nullptr, nullptr);
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
}
return self;