Index: webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsModel.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsModel.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsModel.m |
index eda02758198cfe7e5a2e09a5c89fd43ac1d6bc87..1c3427da58971aa5135155f9acf978ad21afbce6 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsModel.m |
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDSettingsModel.m |
@@ -17,6 +17,10 @@ static NSArray<NSString *> *videoResolutionsStaticValues() { |
return @[ @"640x480", @"960x540", @"1280x720" ]; |
} |
+static NSArray<NSString *> *videoCodecsStaticValues() { |
+ return @[ @"H264", @"VP8", @"VP9" ]; |
+} |
+ |
@interface ARDSettingsModel () { |
ARDSettingsStore *_settingsStore; |
} |
@@ -46,6 +50,27 @@ static NSArray<NSString *> *videoResolutionsStaticValues() { |
return YES; |
} |
+- (NSArray<NSString *> *)availableVideoCodecs { |
+ return videoCodecsStaticValues(); |
+} |
+ |
+- (nullable NSString *)currentVideoCodecSettingFromStore { |
kthelgason
2017/03/09 13:39:43
AFAIKT we don't ever store null so this needs not
sakal
2017/03/10 10:25:28
Done.
|
+ NSString *videoCodec = [[self settingsStore] videoCodec]; |
+ if (!videoCodec) { |
+ videoCodec = [self defaultVideoCodecSetting]; |
+ [[self settingsStore] setVideoCodec:videoCodec]; |
+ } |
+ return videoCodec; |
+} |
+ |
+- (BOOL)storeVideoCodecSetting:(nullable NSString *)videoCodec { |
kthelgason
2017/03/09 13:39:43
should this be nullable?
sakal
2017/03/10 10:25:27
Done.
|
+ if (![[self availableVideoCodecs] containsObject:videoCodec]) { |
+ return NO; |
+ } |
+ [[self settingsStore] setVideoCodec:videoCodec]; |
+ return YES; |
+} |
+ |
- (nullable NSNumber *)currentMaxBitrateSettingFromStore { |
return [[self settingsStore] maxBitrate]; |
} |
@@ -92,6 +117,10 @@ static NSArray<NSString *> *videoResolutionsStaticValues() { |
return components[index]; |
} |
+- (NSString *)defaultVideoCodecSetting { |
+ return videoCodecsStaticValues()[0]; |
+} |
+ |
#pragma mark - Conversion to RTCMediaConstraints |
- (nullable NSDictionary *)currentMediaConstraintFromStoreAsRTCDictionary { |