Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(963)

Unified Diff: webrtc/examples/objc/AppRTCMobile/ARDAppClient.m

Issue 2484733002: Expose bit rate property in ARDAppClient and set max bitrate for video RTCRtcSender. (Closed)
Patch Set: Inline property instead of introducing local var Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ARDAppClient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
diff --git a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
index 9ef46b4742beb76ca9335230499d13ddfef546f3..e78057815a4f952672246b6f1d86739047290433 100644
--- a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
@@ -102,6 +102,7 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
RTCFileLogger *_fileLogger;
ARDTimerProxy *_statsTimer;
RTCMediaConstraints *_cameraConstraints;
+ NSNumber *_maxBitrate;
}
@synthesize shouldGetStats = _shouldGetStats;
@@ -326,6 +327,10 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
_cameraConstraints = mediaConstraints;
}
+- (void)setMaxBitrate:(NSNumber *)maxBitrate {
+ _maxBitrate = maxBitrate;
+}
+
#pragma mark - ARDSignalingChannelDelegate
- (void)channel:(id<ARDSignalingChannel>)channel
@@ -673,6 +678,9 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
RTCRtpSender *sender =
[_peerConnection senderWithKind:kRTCMediaStreamTrackKindVideo
streamId:kARDMediaStreamId];
+
+ [self setMaxBitrate:_maxBitrate forVideoSender:sender];
+
RTCVideoTrack *track = [self createLocalVideoTrack];
if (track) {
sender.track = track;
@@ -681,6 +689,12 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
return sender;
}
+- (void)setMaxBitrate:(NSNumber *)maxBitrate forVideoSender:(RTCRtpSender *)sender {
+ for (RTCRtpEncodingParameters *encoding in sender.parameters.encodings) {
+ encoding.maxBitrateBps = maxBitrate;
+ }
+}
+
- (RTCRtpSender *)createAudioSender {
RTCMediaConstraints *constraints = [self defaultMediaAudioConstraints];
RTCAudioSource *source = [_factory audioSourceWithConstraints:constraints];
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ARDAppClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698