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 std::string nativeKind = [NSString stdStringForString:kind]; |
| 317 std::string nativeStreamId = [NSString stdStringForString:streamId]; |
| 318 rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeSender( |
| 319 _peerConnection->CreateSender(nativeKind, nativeStreamId)); |
| 320 return nativeSender ? |
| 321 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender] |
| 322 : nil; |
| 323 } |
| 324 |
314 - (NSArray<RTCRtpSender *> *)senders { | 325 - (NSArray<RTCRtpSender *> *)senders { |
315 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders( | 326 std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> nativeSenders( |
316 _peerConnection->GetSenders()); | 327 _peerConnection->GetSenders()); |
317 NSMutableArray *senders = [[NSMutableArray alloc] init]; | 328 NSMutableArray *senders = [[NSMutableArray alloc] init]; |
318 for (const auto &nativeSender : nativeSenders) { | 329 for (const auto &nativeSender : nativeSenders) { |
319 RTCRtpSender *sender = | 330 RTCRtpSender *sender = |
320 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; | 331 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; |
321 [senders addObject:sender]; | 332 [senders addObject:sender]; |
322 } | 333 } |
323 return senders; | 334 return senders; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 case RTCStatsOutputLevelDebug: | 497 case RTCStatsOutputLevelDebug: |
487 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 498 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
488 } | 499 } |
489 } | 500 } |
490 | 501 |
491 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 502 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
492 return _peerConnection; | 503 return _peerConnection; |
493 } | 504 } |
494 | 505 |
495 @end | 506 @end |
OLD | NEW |