Remove suppression of the unguarded-availability warning.

It's not clear why the availability check doesn't work,
but the plain old macro works just fine, so we can get rid of
the suppression of another compiler warning.

Fixed: webrtc:10837
Change-Id: I4f5bcba794a0e34103e581c3e6495c9542e07342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228701
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34819}
This commit is contained in:
Byoungchan Lee 2021-08-14 09:39:32 +09:00 committed by WebRTC LUCI CQ
parent 4d0760e7f9
commit 9e0abe5090
2 changed files with 26 additions and 16 deletions

View File

@ -239,11 +239,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
config("apprtc_signaling_config") {
include_dirs = [ "objc/AppRTCMobile" ]
cflags_objc = [
# TODO(bugs.webrtc.org/10837): Remove this when usage of
# archivedDataWithRootObject will be removed.
"-Wno-unguarded-availability",
]
}
rtc_library("apprtc_signaling") {

View File

@ -77,6 +77,7 @@ NS_ASSUME_NONNULL_BEGIN
- (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)currentVideoCodecSettingFromStore {
[self registerStoreDefaults];
NSData *codecData = [[self settingsStore] videoCodec];
#if defined(WEBRTC_IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13
Class expectedClass = [RTC_OBJC_TYPE(RTCVideoCodecInfo) class];
NSError *error;
RTC_OBJC_TYPE(RTCVideoCodecInfo) *videoCodecSetting =
@ -85,6 +86,9 @@ NS_ASSUME_NONNULL_BEGIN
return videoCodecSetting;
}
return nil;
#else
return [NSKeyedUnarchiver unarchiveObjectWithData:codecData];
#endif
}
- (BOOL)storeVideoCodecSetting:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)videoCodec {
@ -92,15 +96,20 @@ NS_ASSUME_NONNULL_BEGIN
return NO;
}
#if defined(WEBRTC_IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13
NSError *error;
NSData *codecData = [NSKeyedArchiver archivedDataWithRootObject:videoCodec
requiringSecureCoding:NO
error:&error];
if (!error) {
[[self settingsStore] setVideoCodec:codecData];
return YES;
if (error) {
return NO;
}
return NO;
#else
NSData *codecData = [NSKeyedArchiver archivedDataWithRootObject:videoCodec];
#endif
[[self settingsStore] setVideoCodec:codecData];
return YES;
}
- (nullable NSNumber *)currentMaxBitrateSettingFromStore {
@ -179,18 +188,24 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)registerStoreDefaults {
#if defined(WEBRTC_IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13
NSError *error;
NSData *codecData = [NSKeyedArchiver archivedDataWithRootObject:[self defaultVideoCodecSetting]
requiringSecureCoding:NO
error:&error];
if (!error) {
[ARDSettingsStore setDefaultsForVideoResolution:[self defaultVideoResolutionSetting]
videoCodec:codecData
bitrate:nil
audioOnly:NO
createAecDump:NO
useManualAudioConfig:YES];
if (error) {
return;
}
#else
NSData *codecData = [NSKeyedArchiver archivedDataWithRootObject:[self defaultVideoCodecSetting]];
#endif
[ARDSettingsStore setDefaultsForVideoResolution:[self defaultVideoResolutionSetting]
videoCodec:codecData
bitrate:nil
audioOnly:NO
createAecDump:NO
useManualAudioConfig:YES];
}
@end
NS_ASSUME_NONNULL_END