2017-10-05 16:55:38 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-10-30 13:07:07 +01:00
|
|
|
#import "WebRTC/RTCVideoCodecFactory.h"
|
2017-10-05 16:55:38 +02:00
|
|
|
|
|
|
|
|
#import "WebRTC/RTCVideoCodecH264.h"
|
2018-04-13 15:36:43 +02:00
|
|
|
#import "WebRTC/RTCVideoDecoderVP8.h"
|
2017-12-01 14:27:07 +01:00
|
|
|
#if !defined(RTC_DISABLE_VP9)
|
2018-04-13 15:36:43 +02:00
|
|
|
#import "WebRTC/RTCVideoDecoderVP9.h"
|
2018-01-30 10:32:13 +01:00
|
|
|
#endif
|
2017-10-05 16:55:38 +02:00
|
|
|
|
2017-10-30 13:07:07 +01:00
|
|
|
@implementation RTCDefaultVideoDecoderFactory
|
2017-10-05 16:55:38 +02:00
|
|
|
|
|
|
|
|
- (id<RTCVideoDecoder>)createDecoder:(RTCVideoCodecInfo *)info {
|
2017-10-30 13:07:07 +01:00
|
|
|
if ([info.name isEqualToString:kRTCVideoCodecH264Name]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [[RTCVideoDecoderH264 alloc] init];
|
2017-10-30 13:07:07 +01:00
|
|
|
} else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [RTCVideoDecoderVP8 vp8Decoder];
|
2017-12-01 14:27:07 +01:00
|
|
|
#if !defined(RTC_DISABLE_VP9)
|
2017-10-30 13:07:07 +01:00
|
|
|
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [RTCVideoDecoderVP9 vp9Decoder];
|
2017-12-01 14:27:07 +01:00
|
|
|
#endif
|
2017-10-05 16:55:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
|
|
|
|
|
return @[
|
2017-10-30 13:07:07 +01:00
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecH264Name],
|
|
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name],
|
2017-12-01 14:27:07 +01:00
|
|
|
#if !defined(RTC_DISABLE_VP9)
|
2018-01-30 10:32:13 +01:00
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name],
|
2017-12-01 14:27:07 +01:00
|
|
|
#endif
|
2017-10-05 16:55:38 +02:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|