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:

committed by
Commit Bot

parent
897e136762
commit
9555e67db5
@ -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
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,9 @@
|
||||
#import "WebRTC/RTCVideoCodec.h"
|
||||
#import "WebRTC/RTCVideoCodecH264.h"
|
||||
#import "WebRTC/RTCVideoEncoderVP8.h"
|
||||
#if !defined(RTC_DISABLE_VP9)
|
||||
#import "WebRTC/RTCVideoEncoderVP9.h"
|
||||
#endif
|
||||
|
||||
@implementation RTCDefaultVideoEncoderFactory
|
||||
|
||||
@ -40,9 +42,17 @@
|
||||
|
||||
RTCVideoCodecInfo *vp8Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name];
|
||||
|
||||
#if !defined(RTC_DISABLE_VP9)
|
||||
RTCVideoCodecInfo *vp9Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name];
|
||||
#endif
|
||||
|
||||
return @[ constrainedHighInfo, constrainedBaselineInfo, vp8Info, vp9Info ];
|
||||
return @[ constrainedHighInfo,
|
||||
constrainedBaselineInfo,
|
||||
vp8Info,
|
||||
#if !defined(RTC_DISABLE_VP9)
|
||||
vp9Info
|
||||
#endif
|
||||
];
|
||||
}
|
||||
|
||||
- (id<RTCVideoEncoder>)createEncoder:(RTCVideoCodecInfo *)info {
|
||||
@ -50,8 +60,10 @@
|
||||
return [[RTCVideoEncoderH264 alloc] initWithCodecInfo:info];
|
||||
} else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) {
|
||||
return [RTCVideoEncoderVP8 vp8Encoder];
|
||||
#if !defined(RTC_DISABLE_VP9)
|
||||
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) {
|
||||
return [RTCVideoEncoderVP9 vp9Encoder];
|
||||
#endif
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
Reference in New Issue
Block a user