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 "RTCLegacyStatsReport+Private.h" | 17 #import "RTCLegacyStatsReport+Private.h" |
18 #import "RTCMediaConstraints+Private.h" | 18 #import "RTCMediaConstraints+Private.h" |
19 #import "RTCMediaStream+Private.h" | 19 #import "RTCMediaStream+Private.h" |
20 #import "RTCPeerConnectionFactory+Private.h" | 20 #import "RTCPeerConnectionFactory+Private.h" |
21 #import "RTCRtpReceiver+Private.h" | 21 #import "RTCRtpReceiver+Private.h" |
22 #import "RTCRtpSender+Private.h" | 22 #import "RTCRtpSender+Private.h" |
23 #import "RTCSessionDescription+Private.h" | 23 #import "RTCSessionDescription+Private.h" |
| 24 #import "WebRTC/RTCBitrateAllocationStrategy.h" |
24 #import "WebRTC/RTCLogging.h" | 25 #import "WebRTC/RTCLogging.h" |
25 | 26 |
26 #include <memory> | 27 #include <memory> |
27 | 28 |
28 #include "webrtc/api/jsepicecandidate.h" | 29 #include "webrtc/api/jsepicecandidate.h" |
29 #include "webrtc/rtc_base/checks.h" | 30 #include "webrtc/rtc_base/checks.h" |
30 | 31 |
31 NSString * const kRTCPeerConnectionErrorDomain = | 32 NSString * const kRTCPeerConnectionErrorDomain = |
32 @"org.webrtc.RTCPeerConnection"; | 33 @"org.webrtc.RTCPeerConnection"; |
33 int const kRTCPeerConnnectionSessionDescriptionError = -1; | 34 int const kRTCPeerConnnectionSessionDescriptionError = -1; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 _hasStartedRtcEventLog = | 404 _hasStartedRtcEventLog = |
404 _peerConnection->StartRtcEventLog(fd, maxSizeInBytes); | 405 _peerConnection->StartRtcEventLog(fd, maxSizeInBytes); |
405 return _hasStartedRtcEventLog; | 406 return _hasStartedRtcEventLog; |
406 } | 407 } |
407 | 408 |
408 - (void)stopRtcEventLog { | 409 - (void)stopRtcEventLog { |
409 _peerConnection->StopRtcEventLog(); | 410 _peerConnection->StopRtcEventLog(); |
410 _hasStartedRtcEventLog = NO; | 411 _hasStartedRtcEventLog = NO; |
411 } | 412 } |
412 | 413 |
| 414 - (void)setBitrateAllocationStrategy: |
| 415 (RTCBitrateAllocationStrategy *_Nullable)bitrateAllocationStrategy { |
| 416 if (bitrateAllocationStrategy) |
| 417 _peerConnection->SetBitrateAllocationStrategy(bitrateAllocationStrategy.stra
tegy); |
| 418 else |
| 419 _peerConnection->SetBitrateAllocationStrategy(nullptr); |
| 420 } |
| 421 |
413 - (RTCRtpSender *)senderWithKind:(NSString *)kind | 422 - (RTCRtpSender *)senderWithKind:(NSString *)kind |
414 streamId:(NSString *)streamId { | 423 streamId:(NSString *)streamId { |
415 std::string nativeKind = [NSString stdStringForString:kind]; | 424 std::string nativeKind = [NSString stdStringForString:kind]; |
416 std::string nativeStreamId = [NSString stdStringForString:streamId]; | 425 std::string nativeStreamId = [NSString stdStringForString:streamId]; |
417 rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeSender( | 426 rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeSender( |
418 _peerConnection->CreateSender(nativeKind, nativeStreamId)); | 427 _peerConnection->CreateSender(nativeKind, nativeStreamId)); |
419 return nativeSender ? | 428 return nativeSender ? |
420 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender] | 429 [[RTCRtpSender alloc] initWithNativeRtpSender:nativeSender] |
421 : nil; | 430 : nil; |
422 } | 431 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 case RTCStatsOutputLevelDebug: | 617 case RTCStatsOutputLevelDebug: |
609 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 618 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
610 } | 619 } |
611 } | 620 } |
612 | 621 |
613 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 622 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
614 return _peerConnection; | 623 return _peerConnection; |
615 } | 624 } |
616 | 625 |
617 @end | 626 @end |
OLD | NEW |