OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 if (self = [super init]) { | 225 if (self = [super init]) { |
226 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); | 226 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); |
227 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = | 227 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = |
228 constraints.nativeConstraints; | 228 constraints.nativeConstraints; |
229 _peerConnection = | 229 _peerConnection = |
230 factory.nativeFactory->CreatePeerConnection(*config, | 230 factory.nativeFactory->CreatePeerConnection(*config, |
231 nativeConstraints.get(), | 231 nativeConstraints.get(), |
232 nullptr, | 232 nullptr, |
233 nullptr, | 233 nullptr, |
234 _observer.get()); | 234 _observer.get()); |
| 235 if (!_peerConnection) { |
| 236 return nil; |
| 237 } |
235 _localStreams = [[NSMutableArray alloc] init]; | 238 _localStreams = [[NSMutableArray alloc] init]; |
236 _delegate = delegate; | 239 _delegate = delegate; |
237 } | 240 } |
238 return self; | 241 return self; |
239 } | 242 } |
240 | 243 |
241 - (NSArray *)localStreams { | 244 - (NSArray *)localStreams { |
242 return [_localStreams copy]; | 245 return [_localStreams copy]; |
243 } | 246 } |
244 | 247 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 case RTCStatsOutputLevelDebug: | 583 case RTCStatsOutputLevelDebug: |
581 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 584 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
582 } | 585 } |
583 } | 586 } |
584 | 587 |
585 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 588 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
586 return _peerConnection; | 589 return _peerConnection; |
587 } | 590 } |
588 | 591 |
589 @end | 592 @end |
OLD | NEW |