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

Unified Diff: webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m

Issue 2492693003: Propagate bitrate setting to RTCRtpSender. (Closed)
Patch Set: Replace UITextFieldDelegate method with method with lesser availability value 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
Index: webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
index 6b3642e00697f1581b04a487ae86da6f22f49818..04c78ea428b1e2623e244bf64b673877c7e3e5a9 100644
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
@@ -10,19 +10,31 @@
#import "ARDSettingsStore.h"
-static NSString *const kUserDefaultsMediaConstraintsKey =
+static NSString *const kMediaConstraintsKey =
@"rtc_video_resolution_media_constraints_key";
+static NSString *const kBitrateKey = @"rtc_max_bitrate_key";
NS_ASSUME_NONNULL_BEGIN
@implementation ARDSettingsStore
+- (NSUserDefaults *)storage {
tkchin_webrtc 2016/11/14 21:14:32 Why not store this as an instance variable?
daniela-webrtc 2016/11/16 13:21:17 Done.
+ return [NSUserDefaults standardUserDefaults];
+}
+
- (nullable NSString *)videoResolutionConstraintsSetting {
tkchin_webrtc 2016/11/14 21:14:32 nit: a bit redundant to have a settingsstore objec
daniela-webrtc 2016/11/16 13:21:17 Done.
- return [[NSUserDefaults standardUserDefaults] objectForKey:kUserDefaultsMediaConstraintsKey];
+ return [[self storage] objectForKey:kMediaConstraintsKey];
}
- (void)setVideoResolutionConstraintsSetting:(NSString *)constraintsString {
- [[NSUserDefaults standardUserDefaults] setObject:constraintsString
- forKey:kUserDefaultsMediaConstraintsKey];
+ [[self storage] setObject:constraintsString forKey:kMediaConstraintsKey];
tkchin_webrtc 2016/11/14 21:14:32 It's more predictable if you force a sync after se
daniela-webrtc 2016/11/16 13:21:17 Done.
+}
+
+- (nullable NSNumber *)maxBitrateSetting {
+ return [[self storage] objectForKey:kBitrateKey];
+}
+
+- (void)setMaxBitrateSetting:(nullable NSNumber *)value {
+ [[self storage] setObject:value forKey:kBitrateKey];
}
@end

Powered by Google App Engine
This is Rietveld 408576698