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

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

Issue 2735303004: Add video codec setting to AppRTCMobile on iOS. (Closed)
Patch Set: Replace if statements with switches. Created 3 years, 9 months 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
Index: webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
diff --git a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
index ef21ab617b7efdc279a465b0a477de4d3e8fd12e..69759ac7370ec9ca09e3363e720127b9eabd4dc9 100644
--- a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
@@ -126,6 +126,7 @@ static int const kKbpsMultiplier = 1000;
@synthesize isAudioOnly = _isAudioOnly;
@synthesize shouldMakeAecDump = _shouldMakeAecDump;
@synthesize shouldUseLevelControl = _shouldUseLevelControl;
+@synthesize videoCodec = _videoCodec;
- (instancetype)init {
return [self initWithDelegate:nil];
@@ -452,12 +453,12 @@ static int const kKbpsMultiplier = 1000;
[_delegate appClient:self didError:sdpError];
return;
}
- // Prefer H264 if available.
- RTCSessionDescription *sdpPreferringH264 =
+ // Prefer codec from settings if available.
+ RTCSessionDescription *sdpPreferringCodec =
[ARDSDPUtils descriptionForDescription:sdp
- preferredVideoCodec:@"H264"];
+ preferredVideoCodec:_videoCodec];
__weak ARDAppClient *weakSelf = self;
- [_peerConnection setLocalDescription:sdpPreferringH264
+ [_peerConnection setLocalDescription:sdpPreferringCodec
completionHandler:^(NSError *error) {
ARDAppClient *strongSelf = weakSelf;
[strongSelf peerConnection:strongSelf.peerConnection
@@ -465,7 +466,7 @@ static int const kKbpsMultiplier = 1000;
}];
ARDSessionDescriptionMessage *message =
[[ARDSessionDescriptionMessage alloc]
- initWithDescription:sdpPreferringH264];
+ initWithDescription:sdpPreferringCodec];
[self sendSignalingMessage:message];
[self setMaxBitrateForPeerConnectionVideoSender];
});
@@ -606,12 +607,12 @@ static int const kKbpsMultiplier = 1000;
ARDSessionDescriptionMessage *sdpMessage =
(ARDSessionDescriptionMessage *)message;
RTCSessionDescription *description = sdpMessage.sessionDescription;
- // Prefer H264 if available.
- RTCSessionDescription *sdpPreferringH264 =
+ // Prefer codec from settings if available.
+ RTCSessionDescription *sdpPreferringCodec =
[ARDSDPUtils descriptionForDescription:description
- preferredVideoCodec:@"H264"];
+ preferredVideoCodec:_videoCodec];
__weak ARDAppClient *weakSelf = self;
- [_peerConnection setRemoteDescription:sdpPreferringH264
+ [_peerConnection setRemoteDescription:sdpPreferringCodec
completionHandler:^(NSError *error) {
ARDAppClient *strongSelf = weakSelf;
[strongSelf peerConnection:strongSelf.peerConnection

Powered by Google App Engine
This is Rietveld 408576698