Improve the style of the objc wrapper for PeerConnectionInterface::SetBitrate.
BUG=webrtc:7395 Review-Url: https://codereview.webrtc.org/3011013002 Cr-Commit-Position: refs/heads/master@{#19697}
This commit is contained in:
parent
e5abac443a
commit
8b476173d8
@ -369,9 +369,9 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
|||||||
_peerConnection->SetRemoteDescription(observer, sdp.nativeDescription);
|
_peerConnection->SetRemoteDescription(observer, sdp.nativeDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)setBitrateToMin:(NSNumber *_Nullable)minBitrateBps
|
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
|
||||||
toCurrent:(NSNumber *_Nullable)currentBitrateBps
|
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
|
||||||
toMax:(NSNumber *_Nullable)maxBitrateBps {
|
maxBitrateBps:(nullable NSNumber *)maxBitrateBps {
|
||||||
webrtc::PeerConnectionInterface::BitrateParameters params;
|
webrtc::PeerConnectionInterface::BitrateParameters params;
|
||||||
if (minBitrateBps != nil) {
|
if (minBitrateBps != nil) {
|
||||||
params.min_bitrate_bps = rtc::Optional<int>(minBitrateBps.intValue);
|
params.min_bitrate_bps = rtc::Optional<int>(minBitrateBps.intValue);
|
||||||
|
|||||||
@ -184,12 +184,14 @@ RTC_EXPORT
|
|||||||
completionHandler:
|
completionHandler:
|
||||||
(nullable void (^)(NSError * _Nullable error))completionHandler;
|
(nullable void (^)(NSError * _Nullable error))completionHandler;
|
||||||
|
|
||||||
/** Updates bandwidth estimation parameters. Null parameters will be unchanged.
|
/** Limits the bandwidth allocated for all RTP streams sent by this
|
||||||
* Returns true iff the parameters were successfully updated.
|
* 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
|
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
|
||||||
toCurrent:(NSNumber *_Nullable)currentBitrateBps
|
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
|
||||||
toMax:(NSNumber *_Nullable)maxBitrateBps;
|
maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
|
||||||
|
|
||||||
/** Start or stop recording an Rtc EventLog. */
|
/** Start or stop recording an Rtc EventLog. */
|
||||||
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath
|
||||||
@ -200,8 +202,7 @@ RTC_EXPORT
|
|||||||
|
|
||||||
@interface RTCPeerConnection (Media)
|
@interface RTCPeerConnection (Media)
|
||||||
|
|
||||||
/**
|
/** Create an RTCRtpSender with the specified kind and media stream ID.
|
||||||
* Create an RTCRtpSender with the specified kind and media stream ID.
|
|
||||||
* See RTCMediaStreamTrack.h for available kinds.
|
* See RTCMediaStreamTrack.h for available kinds.
|
||||||
*/
|
*/
|
||||||
- (RTCRtpSender *)senderWithKind:(NSString *)kind streamId:(NSString *)streamId;
|
- (RTCRtpSender *)senderWithKind:(NSString *)kind streamId:(NSString *)streamId;
|
||||||
|
|||||||
@ -60,12 +60,12 @@
|
|||||||
[factory peerConnectionWithConfiguration:config constraints:contraints delegate:nil];
|
[factory peerConnectionWithConfiguration:config constraints:contraints delegate:nil];
|
||||||
newConfig = peerConnection.configuration;
|
newConfig = peerConnection.configuration;
|
||||||
|
|
||||||
EXPECT_TRUE([peerConnection setBitrateToMin:[NSNumber numberWithInt:100000]
|
EXPECT_TRUE([peerConnection setBweMinBitrateBps:[NSNumber numberWithInt:100000]
|
||||||
toCurrent:[NSNumber numberWithInt:5000000]
|
currentBitrateBps:[NSNumber numberWithInt:5000000]
|
||||||
toMax:[NSNumber numberWithInt:500000000]]);
|
maxBitrateBps:[NSNumber numberWithInt:500000000]]);
|
||||||
EXPECT_FALSE([peerConnection setBitrateToMin:[NSNumber numberWithInt:2]
|
EXPECT_FALSE([peerConnection setBweMinBitrateBps:[NSNumber numberWithInt:2]
|
||||||
toCurrent:[NSNumber numberWithInt:1]
|
currentBitrateBps:[NSNumber numberWithInt:1]
|
||||||
toMax:nullptr]);
|
maxBitrateBps:nil]);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]);
|
EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user