From fa8a44eb5ffcc598379baa17e753e383e3e4546d Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 31 Aug 2015 17:13:57 +0200 Subject: [PATCH] SettingsViewController: do not show custom label "Disabled, build from source to enable" for MPEG4 and H264 if there are not available; it is confusing and can be misleading about the cause of non-availability --- Classes/SettingsViewController.m | 33 +++++++------------------------- submodules/cmake-builder | 2 +- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 0fb8c8f33..77cac3662 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -507,24 +507,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - -+ (IASKSpecifier *)disableCodecSpecifier:(IASKSpecifier *)specifier { - NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[specifier specifierDict]]; - - NSMutableString *type = [NSMutableString stringWithString:[dict objectForKey:kIASKType]]; - [type setString:kIASKPSTitleValueSpecifier]; - [dict setObject:type forKey:kIASKType]; - - NSMutableArray *values = - [NSMutableArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:1], nil]; - [dict setObject:values forKey:kIASKValues]; - - NSString *title = NSLocalizedString(@"Disabled, build from sources to enable", nil); - NSMutableArray *titles = [NSMutableArray arrayWithObjects:title, title, nil]; - [dict setObject:titles forKey:kIASKTitles]; - - return [[IASKSpecifier alloc] initWithSpecifier:dict]; -} - + (IASKSpecifier *)filterSpecifier:(IASKSpecifier *)specifier { if (linphone_core_sip_transport_supported([LinphoneManager getLc], LinphoneTransportTls)) { if ([[specifier key] isEqualToString:@"transport_preference"]) { @@ -568,14 +550,6 @@ static UICompositeViewDescription *compositeDescription = nil; } } - // Add "build from source" if MPEG4 or H264 disabled - if ([[specifier key] isEqualToString:@"h264_preference"] && ![LinphoneManager isCodecSupported:"h264"]) { - return [SettingsViewController disableCodecSpecifier:specifier]; - } - if ([[specifier key] isEqualToString:@"mp4v-es_preference"] && ![LinphoneManager isCodecSupported:"mp4v-es"]) { - return [SettingsViewController disableCodecSpecifier:specifier]; - } - return specifier; } @@ -614,6 +588,13 @@ static UICompositeViewDescription *compositeDescription = nil; if (!linphone_core_video_supported([LinphoneManager getLc])) [hiddenKeys addObject:@"video_menu"]; + if (![LinphoneManager isCodecSupported:"h264"]) { + [hiddenKeys addObject:@"h264_preference"]; + } + if (![LinphoneManager isCodecSupported:"mp4v-es"]) { + [hiddenKeys addObject:@"mp4v-es_preference"]; + } + if (![LinphoneManager isNotIphone3G]) [hiddenKeys addObject:@"silk_24k_preference"]; diff --git a/submodules/cmake-builder b/submodules/cmake-builder index 93910b557..5ff6590ab 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit 93910b55774ca708cc6c16c41c6a705630176ae1 +Subproject commit 5ff6590ab1b9e97bc97eadaa4f64353f266e2d9f