Improve the style of the objc wrapper for PeerConnectionInterface::SetBitrate.
BUG=webrtc:7395
Review-Url: https://codereview.webrtc.org/3011013002
Cr-Original-Commit-Position: refs/heads/master@{#19697}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 8b476173d897c8e88330de683f9f9e9c81e76589
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm
index 1709047..c08503e 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection.mm
@@ -369,9 +369,9 @@
_peerConnection->SetRemoteDescription(observer, sdp.nativeDescription);
}
-- (BOOL)setBitrateToMin:(NSNumber *_Nullable)minBitrateBps
- toCurrent:(NSNumber *_Nullable)currentBitrateBps
- toMax:(NSNumber *_Nullable)maxBitrateBps {
+- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
+ currentBitrateBps:(nullable NSNumber *)currentBitrateBps
+ maxBitrateBps:(nullable NSNumber *)maxBitrateBps {
webrtc::PeerConnectionInterface::BitrateParameters params;
if (minBitrateBps != nil) {
params.min_bitrate_bps = rtc::Optional<int>(minBitrateBps.intValue);
diff --git a/sdk/objc/Framework/Headers/WebRTC/RTCPeerConnection.h b/sdk/objc/Framework/Headers/WebRTC/RTCPeerConnection.h
index ce2df4d..7b0c449 100644
--- a/sdk/objc/Framework/Headers/WebRTC/RTCPeerConnection.h
+++ b/sdk/objc/Framework/Headers/WebRTC/RTCPeerConnection.h
@@ -184,12 +184,14 @@
completionHandler:
(nullable void (^)(NSError * _Nullable error))completionHandler;
-/** Updates bandwidth estimation parameters. Null parameters will be unchanged.
- * Returns true iff the parameters were successfully updated.
+/** Limits the bandwidth allocated for all RTP streams sent by this
+ * PeerConnection. Nil parameters will be unchanged. Setting
+ * |currentBitrateBps| will force the available bitrate estimate to the given
+ * value. Returns YES if the parameters were successfully updated.
*/
-- (BOOL)setBitrateToMin:(NSNumber *_Nullable)minBitrateBps
- toCurrent:(NSNumber *_Nullable)currentBitrateBps
- toMax:(NSNumber *_Nullable)maxBitrateBps;
+- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
+ currentBitrateBps:(nullable NSNumber *)currentBitrateBps
+ maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
/** Start or stop recording an Rtc EventLog. */
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
@@ -200,9 +202,8 @@
@interface RTCPeerConnection (Media)
-/**
- * Create an RTCRtpSender with the specified kind and media stream ID.
- * See RTCMediaStreamTrack.h for available kinds.
+/** Create an RTCRtpSender with the specified kind and media stream ID.
+ * See RTCMediaStreamTrack.h for available kinds.
*/
- (RTCRtpSender *)senderWithKind:(NSString *)kind streamId:(NSString *)streamId;
diff --git a/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm b/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
index 429962d..bf3fc33 100644
--- a/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
+++ b/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
@@ -60,12 +60,12 @@
[factory peerConnectionWithConfiguration:config constraints:contraints delegate:nil];
newConfig = peerConnection.configuration;
- EXPECT_TRUE([peerConnection setBitrateToMin:[NSNumber numberWithInt:100000]
- toCurrent:[NSNumber numberWithInt:5000000]
- toMax:[NSNumber numberWithInt:500000000]]);
- EXPECT_FALSE([peerConnection setBitrateToMin:[NSNumber numberWithInt:2]
- toCurrent:[NSNumber numberWithInt:1]
- toMax:nullptr]);
+ EXPECT_TRUE([peerConnection setBweMinBitrateBps:[NSNumber numberWithInt:100000]
+ currentBitrateBps:[NSNumber numberWithInt:5000000]
+ maxBitrateBps:[NSNumber numberWithInt:500000000]]);
+ EXPECT_FALSE([peerConnection setBweMinBitrateBps:[NSNumber numberWithInt:2]
+ currentBitrateBps:[NSNumber numberWithInt:1]
+ maxBitrateBps:nil]);
}
EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]);