Don't create VP9 codec factories when building without VP9.

This fixes a bug where AppRTCMobile would crash at runtime when
built without VP9 support.

Bug: webrtc:8602
Change-Id: Id2db79c3ff8136f06dc049afcc5197e9356fd25b
Reviewed-on: https://webrtc-review.googlesource.com/27983
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20982}
This commit is contained in:
Kári Tristan Helgason
2017-12-01 14:27:07 +01:00
committed by Commit Bot
parent 897e136762
commit 9555e67db5
2 changed files with 19 additions and 1 deletions

View File

@ -12,7 +12,9 @@
#import "WebRTC/RTCVideoCodecH264.h"
#import "WebRTC/RTCVideoDecoderVP8.h"
#if !defined(RTC_DISABLE_VP9)
#import "WebRTC/RTCVideoDecoderVP9.h"
#endif
@implementation RTCDefaultVideoDecoderFactory
@ -21,8 +23,10 @@
return [[RTCVideoDecoderH264 alloc] init];
} else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) {
return [RTCVideoDecoderVP8 vp8Decoder];
#if !defined(RTC_DISABLE_VP9)
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) {
return [RTCVideoDecoderVP9 vp9Decoder];
#endif
}
return nil;
@ -32,7 +36,9 @@
return @[
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecH264Name],
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name],
#if !defined(RTC_DISABLE_VP9)
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name]
#endif
];
}