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

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

Issue 2492693003: Propagate bitrate setting to RTCRtpSender. (Closed)
Patch Set: Address comments 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..fd396b53815bacf2f4e144d7d0a3e108d1f60600 100644
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsStore.m
@@ -10,19 +10,41 @@
#import "ARDSettingsStore.h"
-static NSString *const kUserDefaultsMediaConstraintsKey =
- @"rtc_video_resolution_media_constraints_key";
+static NSString *const kMediaConstraintsKey = @"rtc_video_resolution_media_constraints_key";
+static NSString *const kBitrateKey = @"rtc_max_bitrate_key";
NS_ASSUME_NONNULL_BEGIN
+@interface ARDSettingsStore () {
+ NSUserDefaults *_storage;
+}
+@property(nonatomic, strong) NSUserDefaults *storage;
+@end
+
@implementation ARDSettingsStore
-- (nullable NSString *)videoResolutionConstraintsSetting {
- return [[NSUserDefaults standardUserDefaults] objectForKey:kUserDefaultsMediaConstraintsKey];
+- (NSUserDefaults *)storage {
+ if (!_storage) {
+ _storage = [NSUserDefaults standardUserDefaults];
+ }
+ return _storage;
+}
+
+- (nullable NSString *)videoResolutionConstraints {
+ return [self.storage objectForKey:kMediaConstraintsKey];
+}
+
+- (void)setVideoResolutionConstraints:(NSString *)constraintsString {
+ [self.storage setObject:constraintsString forKey:kMediaConstraintsKey];
+ [self.storage synchronize];
+}
+
+- (nullable NSNumber *)maxBitrate {
+ return [self.storage objectForKey:kBitrateKey];
}
-- (void)setVideoResolutionConstraintsSetting:(NSString *)constraintsString {
- [[NSUserDefaults standardUserDefaults] setObject:constraintsString
- forKey:kUserDefaultsMediaConstraintsKey];
+- (void)setMaxBitrate:(nullable NSNumber *)value {
+ [self.storage setObject:value forKey:kBitrateKey];
+ [self.storage synchronize];
}
@end

Powered by Google App Engine
This is Rietveld 408576698