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 "RTCPeerConnection+Private.h" | 11 #import "RTCPeerConnection+Private.h" |
12 | 12 |
13 #import "NSString+StdString.h" | 13 #import "NSString+StdString.h" |
14 #import "RTCConfiguration+Private.h" | 14 #import "RTCConfiguration+Private.h" |
15 #import "RTCDataChannel+Private.h" | 15 #import "RTCDataChannel+Private.h" |
16 #import "RTCIceCandidate+Private.h" | 16 #import "RTCIceCandidate+Private.h" |
17 #import "RTCMediaConstraints+Private.h" | 17 #import "RTCMediaConstraints+Private.h" |
18 #import "RTCMediaStream+Private.h" | 18 #import "RTCMediaStream+Private.h" |
19 #import "RTCPeerConnectionFactory+Private.h" | 19 #import "RTCPeerConnectionFactory+Private.h" |
| 20 #import "RTCRtpReceiver+Private.h" |
20 #import "RTCRtpSender+Private.h" | 21 #import "RTCRtpSender+Private.h" |
21 #import "RTCSessionDescription+Private.h" | 22 #import "RTCSessionDescription+Private.h" |
22 #import "RTCStatsReport+Private.h" | 23 #import "RTCStatsReport+Private.h" |
23 #import "WebRTC/RTCLogging.h" | 24 #import "WebRTC/RTCLogging.h" |
24 | 25 |
25 #include <memory> | 26 #include <memory> |
26 | 27 |
27 #include "webrtc/base/checks.h" | 28 #include "webrtc/base/checks.h" |
28 | 29 |
29 NSString * const kRTCPeerConnectionErrorDomain = | 30 NSString * const kRTCPeerConnectionErrorDomain = |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 _peerConnection->GetSenders()); | 336 _peerConnection->GetSenders()); |
336 NSMutableArray *senders = [[NSMutableArray alloc] init]; | 337 NSMutableArray *senders = [[NSMutableArray alloc] init]; |
337 for (const auto &nativeSender : nativeSenders) { | 338 for (const auto &nativeSender : nativeSenders) { |
338 RTCRtpSender *sender = | 339 RTCRtpSender *sender = |
339 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; | 340 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; |
340 [senders addObject:sender]; | 341 [senders addObject:sender]; |
341 } | 342 } |
342 return senders; | 343 return senders; |
343 } | 344 } |
344 | 345 |
| 346 - (NSArray<RTCRtpReceiver *> *)receivers { |
| 347 std::vector<rtc::scoped_refptr<webrtc::RtpReceiverInterface>> nativeReceivers( |
| 348 _peerConnection->GetReceivers()); |
| 349 NSMutableArray *receivers = [[NSMutableArray alloc] init]; |
| 350 for (const auto &nativeReceiver : nativeReceivers) { |
| 351 RTCRtpReceiver *receiver = |
| 352 [[RTCRtpReceiver alloc] initWithNativeRtpReceiver:nativeReceiver]; |
| 353 [receivers addObject:receiver]; |
| 354 } |
| 355 return receivers; |
| 356 } |
| 357 |
345 #pragma mark - Private | 358 #pragma mark - Private |
346 | 359 |
347 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: | 360 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: |
348 (RTCSignalingState)state { | 361 (RTCSignalingState)state { |
349 switch (state) { | 362 switch (state) { |
350 case RTCSignalingStateStable: | 363 case RTCSignalingStateStable: |
351 return webrtc::PeerConnectionInterface::kStable; | 364 return webrtc::PeerConnectionInterface::kStable; |
352 case RTCSignalingStateHaveLocalOffer: | 365 case RTCSignalingStateHaveLocalOffer: |
353 return webrtc::PeerConnectionInterface::kHaveLocalOffer; | 366 return webrtc::PeerConnectionInterface::kHaveLocalOffer; |
354 case RTCSignalingStateHaveLocalPrAnswer: | 367 case RTCSignalingStateHaveLocalPrAnswer: |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 case RTCStatsOutputLevelDebug: | 518 case RTCStatsOutputLevelDebug: |
506 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 519 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
507 } | 520 } |
508 } | 521 } |
509 | 522 |
510 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 523 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
511 return _peerConnection; | 524 return _peerConnection; |
512 } | 525 } |
513 | 526 |
514 @end | 527 @end |
OLD | NEW |