| 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..7514689add53b0d5ee747aeae930f0c27a977a13 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();
|
| +}
|
| +
|
| +- (NSString *)currentVideoCodecSettingFromStore {
|
| + NSString *videoCodec = [[self settingsStore] videoCodec];
|
| + if (!videoCodec) {
|
| + videoCodec = [self defaultVideoCodecSetting];
|
| + [[self settingsStore] setVideoCodec:videoCodec];
|
| + }
|
| + return videoCodec;
|
| +}
|
| +
|
| +- (BOOL)storeVideoCodecSetting:(NSString *)videoCodec {
|
| + 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 {
|
|
|