From 9e981f0e4352779ab0a09c838446c649a0111f5b Mon Sep 17 00:00:00 2001 From: Sam Zackrisson Date: Wed, 28 Feb 2018 16:20:58 +0100 Subject: [PATCH] Clean up iOS API audio settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the routing for the deprecated audio control setting Change-Id: Id83ff548625279d5b34c9e3cadc097c25a00ef05 Bug: none Reviewed-on: https://webrtc-review.googlesource.com/58900 Reviewed-by: Kári Helgason Commit-Queue: Sam Zackrisson Cr-Commit-Position: refs/heads/master@{#22279} --- examples/objc/AppRTCMobile/ARDAppClient.m | 5 +---- examples/objc/AppRTCMobile/ARDSettingsModel.h | 13 ------------- examples/objc/AppRTCMobile/ARDSettingsModel.m | 9 --------- examples/objc/AppRTCMobile/ARDSettingsStore.h | 2 -- examples/objc/AppRTCMobile/ARDSettingsStore.m | 12 ------------ .../AppRTCMobile/ios/ARDSettingsViewController.m | 11 +---------- .../Classes/PeerConnection/RTCMediaConstraints.mm | 2 -- .../Framework/Headers/WebRTC/RTCMediaConstraints.h | 1 - 8 files changed, 2 insertions(+), 53 deletions(-) diff --git a/examples/objc/AppRTCMobile/ARDAppClient.m b/examples/objc/AppRTCMobile/ARDAppClient.m index b238784993..b5c3e24547 100644 --- a/examples/objc/AppRTCMobile/ARDAppClient.m +++ b/examples/objc/AppRTCMobile/ARDAppClient.m @@ -754,10 +754,7 @@ static int const kKbpsMultiplier = 1000; #pragma mark - Defaults - (RTCMediaConstraints *)defaultMediaAudioConstraints { - NSString *valueLevelControl = [_settings currentUseLevelControllerSettingFromStore] ? - kRTCMediaConstraintsValueTrue : - kRTCMediaConstraintsValueFalse; - NSDictionary *mandatoryConstraints = @{ kRTCMediaConstraintsLevelControl : valueLevelControl }; + NSDictionary *mandatoryConstraints = @{}; RTCMediaConstraints *constraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:mandatoryConstraints optionalConstraints:nil]; diff --git a/examples/objc/AppRTCMobile/ARDSettingsModel.h b/examples/objc/AppRTCMobile/ARDSettingsModel.h index 625b533a0e..597ab38fbf 100644 --- a/examples/objc/AppRTCMobile/ARDSettingsModel.h +++ b/examples/objc/AppRTCMobile/ARDSettingsModel.h @@ -106,19 +106,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)storeCreateAecDumpSetting:(BOOL)createAecDump; -/** - * Returns current setting whether to use level controller from store if present or default (NO) - * otherwise. - */ -- (BOOL)currentUseLevelControllerSettingFromStore; - -/** - * Stores the provided use level controller setting into the store. - * - * @param setting the boolean value to be stored. - */ -- (void)storeUseLevelControllerSetting:(BOOL)useLevelController; - /** * Returns current setting whether to use manual audio config from store if present or default (YES) * otherwise. diff --git a/examples/objc/AppRTCMobile/ARDSettingsModel.m b/examples/objc/AppRTCMobile/ARDSettingsModel.m index 7d731fd4bf..ecd6111a8b 100644 --- a/examples/objc/AppRTCMobile/ARDSettingsModel.m +++ b/examples/objc/AppRTCMobile/ARDSettingsModel.m @@ -109,14 +109,6 @@ NS_ASSUME_NONNULL_BEGIN [[self settingsStore] setCreateAecDump:createAecDump]; } -- (BOOL)currentUseLevelControllerSettingFromStore { - return [[self settingsStore] useLevelController]; -} - -- (void)storeUseLevelControllerSetting:(BOOL)useLevelController { - [[self settingsStore] setUseLevelController:useLevelController]; -} - - (BOOL)currentUseManualAudioConfigSettingFromStore { return [[self settingsStore] useManualAudioConfig]; } @@ -174,7 +166,6 @@ NS_ASSUME_NONNULL_BEGIN bitrate:nil audioOnly:NO createAecDump:NO - useLevelController:NO useManualAudioConfig:YES]; } diff --git a/examples/objc/AppRTCMobile/ARDSettingsStore.h b/examples/objc/AppRTCMobile/ARDSettingsStore.h index b68adb737a..bb051dbb26 100644 --- a/examples/objc/AppRTCMobile/ARDSettingsStore.h +++ b/examples/objc/AppRTCMobile/ARDSettingsStore.h @@ -28,7 +28,6 @@ NS_ASSUME_NONNULL_BEGIN bitrate:(nullable NSNumber *)bitrate audioOnly:(BOOL)audioOnly createAecDump:(BOOL)createAecDump - useLevelController:(BOOL)useLevelController useManualAudioConfig:(BOOL)useManualAudioConfig; @property(nonatomic) NSString *videoResolution; @@ -47,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic) BOOL audioOnly; @property(nonatomic) BOOL createAecDump; -@property(nonatomic) BOOL useLevelController; @property(nonatomic) BOOL useManualAudioConfig; @end diff --git a/examples/objc/AppRTCMobile/ARDSettingsStore.m b/examples/objc/AppRTCMobile/ARDSettingsStore.m index 86bdaaf54c..a3713e2f0e 100644 --- a/examples/objc/AppRTCMobile/ARDSettingsStore.m +++ b/examples/objc/AppRTCMobile/ARDSettingsStore.m @@ -15,7 +15,6 @@ static NSString *const kVideoCodecKey = @"rtc_video_codec_info_key"; static NSString *const kBitrateKey = @"rtc_max_bitrate_key"; static NSString *const kAudioOnlyKey = @"rtc_audio_only_key"; static NSString *const kCreateAecDumpKey = @"rtc_create_aec_dump_key"; -static NSString *const kUseLevelControllerKey = @"rtc_use_level_controller_key"; static NSString *const kUseManualAudioConfigKey = @"rtc_use_manual_audio_config_key"; NS_ASSUME_NONNULL_BEGIN @@ -32,12 +31,10 @@ NS_ASSUME_NONNULL_BEGIN bitrate:(nullable NSNumber *)bitrate audioOnly:(BOOL)audioOnly createAecDump:(BOOL)createAecDump - useLevelController:(BOOL)useLevelController useManualAudioConfig:(BOOL)useManualAudioConfig { NSMutableDictionary *defaultsDictionary = [@{ kAudioOnlyKey : @(audioOnly), kCreateAecDumpKey : @(createAecDump), - kUseLevelControllerKey : @(useLevelController), kUseManualAudioConfigKey : @(useManualAudioConfig) } mutableCopy]; @@ -105,15 +102,6 @@ NS_ASSUME_NONNULL_BEGIN [self.storage synchronize]; } -- (BOOL)useLevelController { - return [self.storage boolForKey:kUseLevelControllerKey]; -} - -- (void)setUseLevelController:(BOOL)useLevelController { - [self.storage setBool:useLevelController forKey:kUseLevelControllerKey]; - [self.storage synchronize]; -} - - (BOOL)useManualAudioConfig { return [self.storage boolForKey:kUseManualAudioConfigKey]; } diff --git a/examples/objc/AppRTCMobile/ios/ARDSettingsViewController.m b/examples/objc/AppRTCMobile/ios/ARDSettingsViewController.m index 27aa757ff7..f2fea15c09 100644 --- a/examples/objc/AppRTCMobile/ios/ARDSettingsViewController.m +++ b/examples/objc/AppRTCMobile/ios/ARDSettingsViewController.m @@ -24,7 +24,6 @@ typedef NS_ENUM(int, ARDSettingsSections) { typedef NS_ENUM(int, ARDAudioSettingsOptions) { ARDAudioSettingsAudioOnly = 0, ARDAudioSettingsCreateAecDump, - ARDAudioSettingsUseLevelController, ARDAudioSettingsUseManualAudioConfig, }; @@ -92,7 +91,7 @@ typedef NS_ENUM(int, ARDAudioSettingsOptions) { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { switch (section) { case ARDSettingsSectionAudioSettings: - return 4; + return 3; case ARDSettingsSectionVideoResolution: return self.videoResolutionArray.count; case ARDSettingsSectionVideoCodec: @@ -319,8 +318,6 @@ updateListSelectionAtIndexPath:(NSIndexPath *)indexPath return @"Audio only"; case ARDAudioSettingsCreateAecDump: return @"Create AecDump"; - case ARDAudioSettingsUseLevelController: - return @"Use level controller"; case ARDAudioSettingsUseManualAudioConfig: return @"Use manual audio config"; default: @@ -334,8 +331,6 @@ updateListSelectionAtIndexPath:(NSIndexPath *)indexPath return [_settingsModel currentAudioOnlySettingFromStore]; case ARDAudioSettingsCreateAecDump: return [_settingsModel currentCreateAecDumpSettingFromStore]; - case ARDAudioSettingsUseLevelController: - return [_settingsModel currentUseLevelControllerSettingFromStore]; case ARDAudioSettingsUseManualAudioConfig: return [_settingsModel currentUseManualAudioConfigSettingFromStore]; default: @@ -353,10 +348,6 @@ updateListSelectionAtIndexPath:(NSIndexPath *)indexPath [_settingsModel storeCreateAecDumpSetting:sender.isOn]; break; } - case ARDAudioSettingsUseLevelController: { - [_settingsModel storeUseLevelControllerSetting:sender.isOn]; - break; - } case ARDAudioSettingsUseManualAudioConfig: { [_settingsModel storeUseManualAudioConfigSetting:sender.isOn]; break; diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm index c686b5643c..34e5899ad4 100644 --- a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm +++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints.mm @@ -30,8 +30,6 @@ NSString * const kRTCMediaConstraintsMinFrameRate = @(webrtc::MediaConstraintsInterface::kMinFrameRate); NSString * const kRTCMediaConstraintsMaxFrameRate = @(webrtc::MediaConstraintsInterface::kMaxFrameRate); -NSString * const kRTCMediaConstraintsLevelControl = - @(webrtc::MediaConstraintsInterface::kLevelControl); NSString * const kRTCMediaConstraintsAudioNetworkAdaptorConfig = @(webrtc::MediaConstraintsInterface::kAudioNetworkAdaptorConfig); diff --git a/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h b/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h index 26a116888a..f93e5b5afc 100644 --- a/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h +++ b/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h @@ -23,7 +23,6 @@ RTC_EXTERN NSString * const kRTCMediaConstraintsMaxHeight; RTC_EXTERN NSString * const kRTCMediaConstraintsMinHeight; RTC_EXTERN NSString * const kRTCMediaConstraintsMaxFrameRate; RTC_EXTERN NSString * const kRTCMediaConstraintsMinFrameRate; -RTC_EXTERN NSString * const kRTCMediaConstraintsLevelControl; /** The value for this key should be a base64 encoded string containing * the data from the serialized configuration proto. */