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-26 11:55:45 +00:00
|
|
|
#import "ARDVideoDecoderFactory.h"
|
2017-10-05 16:55:38 +02:00
|
|
|
|
|
|
|
|
#import "WebRTC/RTCVideoCodecH264.h"
|
|
|
|
|
#import "WebRTC/RTCVideoDecoderVP8.h"
|
|
|
|
|
#import "WebRTC/RTCVideoDecoderVP9.h"
|
|
|
|
|
|
2017-10-26 11:55:45 +00:00
|
|
|
@implementation ARDVideoDecoderFactory
|
2017-10-05 16:55:38 +02:00
|
|
|
|
|
|
|
|
- (id<RTCVideoDecoder>)createDecoder:(RTCVideoCodecInfo *)info {
|
2017-10-26 11:55:45 +00:00
|
|
|
if ([info.name isEqualToString:@"H264"]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [[RTCVideoDecoderH264 alloc] init];
|
2017-10-26 11:55:45 +00:00
|
|
|
} else if ([info.name isEqualToString:@"VP8"]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [RTCVideoDecoderVP8 vp8Decoder];
|
2017-10-26 11:55:45 +00:00
|
|
|
} else if ([info.name isEqualToString:@"VP9"]) {
|
2017-10-05 16:55:38 +02:00
|
|
|
return [RTCVideoDecoderVP9 vp9Decoder];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
|
|
|
|
|
return @[
|
2017-10-26 11:55:45 +00:00
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:@"H264" parameters:nil],
|
|
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:@"VP8" parameters:nil],
|
|
|
|
|
[[RTCVideoCodecInfo alloc] initWithName:@"VP9" parameters:nil]
|
2017-10-05 16:55:38 +02:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|