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

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

Issue 2735303004: Add video codec setting to AppRTCMobile on iOS. (Closed)
Patch Set: Remove unneeded handlers. 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..c0235f7a9dc9bddb90f4dbaa9d54c1cfd5e5d7da 100644
--- a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
@@ -99,6 +99,7 @@ static int const kKbpsMultiplier = 1000;
RTCFileLogger *_fileLogger;
ARDTimerProxy *_statsTimer;
RTCMediaConstraints *_cameraConstraints;
+ NSString *_videoCodec;
kthelgason 2017/03/09 13:39:43 Maybe make this a property and @synthesize it. The
sakal 2017/03/10 10:25:27 Done.
NSNumber *_maxBitrate;
}
@@ -320,6 +321,10 @@ static int const kKbpsMultiplier = 1000;
_cameraConstraints = mediaConstraints;
}
+- (void)setVideoCodec:(NSString *)videoCodec {
+ _videoCodec = videoCodec;
+}
+
- (void)setMaxBitrate:(NSNumber *)maxBitrate {
_maxBitrate = maxBitrate;
}
@@ -452,12 +457,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 +470,7 @@ static int const kKbpsMultiplier = 1000;
}];
ARDSessionDescriptionMessage *message =
[[ARDSessionDescriptionMessage alloc]
- initWithDescription:sdpPreferringH264];
+ initWithDescription:sdpPreferringCodec];
[self sendSignalingMessage:message];
[self setMaxBitrateForPeerConnectionVideoSender];
});
@@ -606,12 +611,12 @@ static int const kKbpsMultiplier = 1000;
ARDSessionDescriptionMessage *sdpMessage =
(ARDSessionDescriptionMessage *)message;
RTCSessionDescription *description = sdpMessage.sessionDescription;
- // Prefer H264 if available.
- RTCSessionDescription *sdpPreferringH264 =
+ // Prefer codec set in 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