aboutsummaryrefslogtreecommitdiff
path: root/talk
diff options
context:
space:
mode:
authortkchin@webrtc.org <tkchin@webrtc.org>2015-01-07 06:35:18 +0000
committertkchin@webrtc.org <tkchin@webrtc.org>2015-01-07 06:35:18 +0000
commit4e5115ae73098cdb60c2d442777c169d2a6c2925 (patch)
tree319e38b8594d48295b436867f1e8de67f3877071 /talk
parentf6a97147602776c672d757e2d598f8643ce6d339 (diff)
downloadwebrtc-4e5115ae73098cdb60c2d442777c169d2a6c2925.tar.gz
RTCPeerConnectionFactory: Explicitly create new worker and signaling threads.
There should be no change in behavior, since this is what the default constructor does. BUG= R=jiayl@webrtc.org Review URL: https://webrtc-codereview.appspot.com/39419004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8007 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'talk')
-rw-r--r--talk/app/webrtc/objc/RTCPeerConnectionFactory.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm b/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm
index b7d2ce3085..845a5f8f8f 100644
--- a/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm
+++ b/talk/app/webrtc/objc/RTCPeerConnectionFactory.mm
@@ -52,6 +52,7 @@
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/app/webrtc/videotrack.h"
#include "webrtc/base/logging.h"
+#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/ssladapter.h"
@interface RTCPeerConnectionFactory ()
@@ -61,7 +62,10 @@
@end
-@implementation RTCPeerConnectionFactory
+@implementation RTCPeerConnectionFactory {
+ rtc::scoped_ptr<rtc::Thread> _signalingThread;
+ rtc::scoped_ptr<rtc::Thread> _workerThread;
+}
@synthesize nativeFactory = _nativeFactory;
@@ -77,7 +81,12 @@
- (id)init {
if ((self = [super init])) {
- _nativeFactory = webrtc::CreatePeerConnectionFactory();
+ _signalingThread.reset(new rtc::Thread());
+ NSAssert(_signalingThread->Start(), @"Failed to start signaling thread.");
+ _workerThread.reset(new rtc::Thread());
+ NSAssert(_workerThread->Start(), @"Failed to start worker thread.");
+ _nativeFactory = webrtc::CreatePeerConnectionFactory(
+ _signalingThread.get(), _workerThread.get(), NULL, NULL, NULL);
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
// Uncomment to get sensitive logs emitted (to stderr or logcat).
// rtc::LogMessage::LogToDebug(rtc::LS_SENSITIVE);