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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } | 362 } |
363 | 363 |
364 - (void)setRemoteDescription:(RTCSessionDescription *)sdp | 364 - (void)setRemoteDescription:(RTCSessionDescription *)sdp |
365 completionHandler:(void (^)(NSError *error))completionHandler { | 365 completionHandler:(void (^)(NSError *error))completionHandler { |
366 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( | 366 rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer( |
367 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( | 367 new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>( |
368 completionHandler)); | 368 completionHandler)); |
369 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); | 369 _peerConnection->SetRemoteDescription(observer, sdp.nativeDescription); |
370 } | 370 } |
371 | 371 |
| 372 - (BOOL)setBitrate:(NSNumber *_Nullable)minBitrateBps |
| 373 toCurrent:(NSNumber *_Nullable)currentBitrateBps |
| 374 toMax:(NSNumber *_Nullable)maxBitrateBps { |
| 375 webrtc::PeerConnectionInterface::BitrateParameters params; |
| 376 if (minBitrateBps != nil) { |
| 377 params.min_bitrate_bps = rtc::Optional<int>(minBitrateBps.intValue); |
| 378 } |
| 379 if (currentBitrateBps != nil) { |
| 380 params.current_bitrate_bps = rtc::Optional<int>(currentBitrateBps.intValue); |
| 381 } |
| 382 if (maxBitrateBps != nil) { |
| 383 params.max_bitrate_bps = rtc::Optional<int>(maxBitrateBps.intValue); |
| 384 } |
| 385 return _peerConnection->SetBitrate(params).ok(); |
| 386 } |
| 387 |
372 - (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath | 388 - (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath |
373 maxSizeInBytes:(int64_t)maxSizeInBytes { | 389 maxSizeInBytes:(int64_t)maxSizeInBytes { |
374 RTC_DCHECK(filePath.length); | 390 RTC_DCHECK(filePath.length); |
375 RTC_DCHECK_GT(maxSizeInBytes, 0); | 391 RTC_DCHECK_GT(maxSizeInBytes, 0); |
376 RTC_DCHECK(!_hasStartedRtcEventLog); | 392 RTC_DCHECK(!_hasStartedRtcEventLog); |
377 if (_hasStartedRtcEventLog) { | 393 if (_hasStartedRtcEventLog) { |
378 RTCLogError(@"Event logging already started."); | 394 RTCLogError(@"Event logging already started."); |
379 return NO; | 395 return NO; |
380 } | 396 } |
381 int fd = open(filePath.UTF8String, O_WRONLY | O_CREAT | O_TRUNC, | 397 int fd = open(filePath.UTF8String, O_WRONLY | O_CREAT | O_TRUNC, |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 case RTCStatsOutputLevelDebug: | 608 case RTCStatsOutputLevelDebug: |
593 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; | 609 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; |
594 } | 610 } |
595 } | 611 } |
596 | 612 |
597 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { | 613 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { |
598 return _peerConnection; | 614 return _peerConnection; |
599 } | 615 } |
600 | 616 |
601 @end | 617 @end |
OLD | NEW |