Chromium Code Reviews| 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 |
| 11 #import "webrtc/api/objc/RTCPeerConnection.h" | 11 #import "webrtc/api/objc/RTCPeerConnection.h" |
| 12 | 12 |
| 13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
| 14 | 14 |
| 15 #import "webrtc/api/objc/RTCPeerConnection+Private.h" | 15 #import "webrtc/api/objc/RTCPeerConnection+Private.h" |
| 16 #import "webrtc/api/objc/RTCConfiguration+Private.h" | 16 #import "webrtc/api/objc/RTCConfiguration+Private.h" |
| 17 #import "webrtc/api/objc/RTCDataChannel+Private.h" | 17 #import "webrtc/api/objc/RTCDataChannel+Private.h" |
| 18 #import "webrtc/api/objc/RTCIceCandidate+Private.h" | 18 #import "webrtc/api/objc/RTCIceCandidate+Private.h" |
| 19 #import "webrtc/api/objc/RTCMediaConstraints+Private.h" | 19 #import "webrtc/api/objc/RTCMediaConstraints+Private.h" |
| 20 #import "webrtc/api/objc/RTCMediaStream+Private.h" | 20 #import "webrtc/api/objc/RTCMediaStream+Private.h" |
| 21 #import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h" | 21 #import "webrtc/api/objc/RTCPeerConnectionFactory+Private.h" |
| 22 #import "webrtc/api/objc/RTCRtpSender+Private.h" | |
| 22 #import "webrtc/api/objc/RTCSessionDescription+Private.h" | 23 #import "webrtc/api/objc/RTCSessionDescription+Private.h" |
| 23 #import "webrtc/api/objc/RTCStatsReport+Private.h" | 24 #import "webrtc/api/objc/RTCStatsReport+Private.h" |
| 24 #import "webrtc/base/objc/RTCLogging.h" | 25 #import "webrtc/base/objc/RTCLogging.h" |
| 25 #import "webrtc/base/objc/NSString+StdString.h" | 26 #import "webrtc/base/objc/NSString+StdString.h" |
| 26 | 27 |
| 27 NSString * const kRTCPeerConnectionErrorDomain = | 28 NSString * const kRTCPeerConnectionErrorDomain = |
| 28 @"org.webrtc.RTCPeerConnection"; | 29 @"org.webrtc.RTCPeerConnection"; |
| 29 int const kRTCPeerConnnectionSessionDescriptionError = -1; | 30 int const kRTCPeerConnnectionSessionDescriptionError = -1; |
| 30 | 31 |
| 31 namespace webrtc { | 32 namespace webrtc { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 } | 305 } |
| 305 | 306 |
| 306 - (void)setRemoteDescription:(RTCSessionDescription *)sdp | 307 - (void)setRemoteDescription:(RTCSessionDescription *)sdp |
| 307 completionHandler:(void (^)(NSError *error))completionHandler { | 308 completionHandler:(void (^)(NSError *error))completionHandler { |
| 308 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( | 309 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( |
| 309 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( | 310 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( |
| 310 completionHandler)); | 311 completionHandler)); |
| 311 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); | 312 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); |
| 312 } | 313 } |
| 313 | 314 |
| 315 - (NSArray<RTCRtpSender*>*)senders { | |
|
tkchin_webrtc
2016/04/05 18:48:15
ditto Sender *> *)
skvlad
2016/04/05 23:21:27
Done.
| |
| 316 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders( | |
|
tkchin_webrtc
2016/04/05 18:48:15
Clearly rusty on c++ -> compiler doesn't barf on >
skvlad
2016/04/05 23:21:27
Since C++ 11 it isn't supposed to, and the Chromiu
| |
| 317 _peerConnection->GetSenders()); | |
| 318 NSMutableArray* senders = [[NSMutableArray alloc] init]; | |
|
tkchin_webrtc
2016/04/05 18:48:15
pointer style: NSMutableArray *senders =
skvlad
2016/04/05 23:21:27
Done.
| |
| 319 for (auto nativeSender : nativeSenders) { | |
|
Taylor Brandstetter
2016/04/05 17:48:03
nit: I think this creates a copy of the scoped_ref
tkchin_webrtc
2016/04/05 18:48:15
Consider adding a category in webrtc/base/objc sim
skvlad
2016/04/05 23:21:27
Is there a way to define a generic NSArray to vect
skvlad
2016/04/05 23:21:27
Done.
| |
| 320 RTCRtpSender* sender = | |
| 321 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; | |
| 322 [senders addObject:sender]; | |
| 323 } | |
| 324 return senders; | |
| 325 } | |
| 326 | |
| 314 #pragma mark - Private | 327 #pragma mark - Private |
| 315 | 328 |
| 316 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: | 329 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: |
| 317 (RTCSignalingState)state { | 330 (RTCSignalingState)state { |
| 318 switch (state) { | 331 switch (state) { |
| 319 case RTCSignalingStateStable: | 332 case RTCSignalingStateStable: |
| 320 return webrtc::PeerConnectionInterface::kStable; | 333 return webrtc::PeerConnectionInterface::kStable; |
| 321 case RTCSignalingStateHaveLocalOffer: | 334 case RTCSignalingStateHaveLocalOffer: |
| 322 return webrtc::PeerConnectionInterface::kHaveLocalOffer; | 335 return webrtc::PeerConnectionInterface::kHaveLocalOffer; |
| 323 case RTCSignalingStateHaveLocalPrAnswer: | 336 case RTCSignalingStateHaveLocalPrAnswer: |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 case RTCStatsOutputLevelDebug: | 487 case RTCStatsOutputLevelDebug: |
| 475 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 488 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
| 476 } | 489 } |
| 477 } | 490 } |
| 478 | 491 |
| 479 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 492 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
| 480 return _peerConnection; | 493 return _peerConnection; |
| 481 } | 494 } |
| 482 | 495 |
| 483 @end | 496 @end |
| OLD | NEW |