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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 } | 304 } |
305 | 305 |
306 - (void)setRemoteDescription:(RTCSessionDescription *)sdp | 306 - (void)setRemoteDescription:(RTCSessionDescription *)sdp |
307 completionHandler:(void (^)(NSError *error))completionHandler { | 307 completionHandler:(void (^)(NSError *error))completionHandler { |
308 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( | 308 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( |
309 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( | 309 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( |
310 completionHandler)); | 310 completionHandler)); |
311 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); | 311 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); |
312 } | 312 } |
313 | 313 |
314 - (RTCRtpSender *)senderWithKind:(NSString *)kind | |
315 streamId:(NSString *)streamId { | |
316 rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeSender( | |
317 _peerConnection->CreateSender([NSString stdStringForString:kind], | |
tkchin_webrtc
2016/04/27 20:22:20
nit: use locals for the stdStrings to make this mo
skvlad
2016/04/27 23:00:58
Done.
| |
318 [NSString stdStringForString:streamId])); | |
319 return nativeSender ? | |
320 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender] | |
321 : nil; | |
322 } | |
323 | |
314 - (NSArray<RTCRtpSender *> *)senders { | 324 - (NSArray<RTCRtpSender *> *)senders { |
315 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders( | 325 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders( |
316 _peerConnection->GetSenders()); | 326 _peerConnection->GetSenders()); |
317 NSMutableArray *senders = [[NSMutableArray alloc] init]; | 327 NSMutableArray *senders = [[NSMutableArray alloc] init]; |
318 for (const auto &nativeSender : nativeSenders) { | 328 for (const auto &nativeSender : nativeSenders) { |
319 RTCRtpSender *sender = | 329 RTCRtpSender *sender = |
320 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; | 330 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; |
321 [senders addObject:sender]; | 331 [senders addObject:sender]; |
322 } | 332 } |
323 return senders; | 333 return senders; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 case RTCStatsOutputLevelDebug: | 496 case RTCStatsOutputLevelDebug: |
487 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 497 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
488 } | 498 } |
489 } | 499 } |
490 | 500 |
491 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 501 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
492 return _peerConnection; | 502 return _peerConnection; |
493 } | 503 } |
494 | 504 |
495 @end | 505 @end |
OLD | NEW |