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 "webrtc/base/checks.h" | 26 #include "webrtc/base/checks.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; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 _peerConnection->GetSenders()); | 317 _peerConnection->GetSenders()); |
317 NSMutableArray *senders = [[NSMutableArray alloc] init]; | 318 NSMutableArray *senders = [[NSMutableArray alloc] init]; |
318 for (const auto &nativeSender : nativeSenders) { | 319 for (const auto &nativeSender : nativeSenders) { |
319 RTCRtpSender *sender = | 320 RTCRtpSender *sender = |
320 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; | 321 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender]; |
321 [senders addObject:sender]; | 322 [senders addObject:sender]; |
322 } | 323 } |
323 return senders; | 324 return senders; |
324 } | 325 } |
325 | 326 |
| 327 - (NSArray<RTCRtpReceiver *> *)receivers { |
| 328 std::vector<rtc::scoped_refptr<webrtc::RtpReceiverInterface>> nativeReceivers( |
| 329 _peerConnection->GetReceivers()); |
| 330 NSMutableArray *receivers = [[NSMutableArray alloc] init]; |
| 331 for (const auto &nativeReceiver : nativeReceivers) { |
| 332 RTCRtpReceiver *receiver = |
| 333 [[RTCRtpReceiver alloc] initWithNativeRtpReceiver:nativeReceiver]; |
| 334 [receivers addObject:receiver]; |
| 335 } |
| 336 return receivers; |
| 337 } |
| 338 |
326 #pragma mark - Private | 339 #pragma mark - Private |
327 | 340 |
328 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: | 341 + (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState: |
329 (RTCSignalingState)state { | 342 (RTCSignalingState)state { |
330 switch (state) { | 343 switch (state) { |
331 case RTCSignalingStateStable: | 344 case RTCSignalingStateStable: |
332 return webrtc::PeerConnectionInterface::kStable; | 345 return webrtc::PeerConnectionInterface::kStable; |
333 case RTCSignalingStateHaveLocalOffer: | 346 case RTCSignalingStateHaveLocalOffer: |
334 return webrtc::PeerConnectionInterface::kHaveLocalOffer; | 347 return webrtc::PeerConnectionInterface::kHaveLocalOffer; |
335 case RTCSignalingStateHaveLocalPrAnswer: | 348 case RTCSignalingStateHaveLocalPrAnswer: |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 case RTCStatsOutputLevelDebug: | 499 case RTCStatsOutputLevelDebug: |
487 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 500 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
488 } | 501 } |
489 } | 502 } |
490 | 503 |
491 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 504 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
492 return _peerConnection; | 505 return _peerConnection; |
493 } | 506 } |
494 | 507 |
495 @end | 508 @end |
OLD | NEW |