blob: 172635ebb464043b0af1d7576ab07ed82b13ecf2 [file] [log] [blame]
Anders Carlsson7e042812017-10-05 16:55:38 +02001/*
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import "ARDVideoDecoderFactory.h"
12
13#import "WebRTC/RTCVideoCodecH264.h"
14#import "WebRTC/RTCVideoDecoderVP8.h"
15#import "WebRTC/RTCVideoDecoderVP9.h"
16
17@implementation ARDVideoDecoderFactory
18
19- (id<RTCVideoDecoder>)createDecoder:(RTCVideoCodecInfo *)info {
20 if ([info.name isEqualToString:@"H264"]) {
21 return [[RTCVideoDecoderH264 alloc] init];
22 } else if ([info.name isEqualToString:@"VP8"]) {
23 return [RTCVideoDecoderVP8 vp8Decoder];
24 } else if ([info.name isEqualToString:@"VP9"]) {
25 return [RTCVideoDecoderVP9 vp9Decoder];
26 }
27
28 return nil;
29}
30
31- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
32 return @[
33 [[RTCVideoCodecInfo alloc] initWithName:@"H264" parameters:nil],
34 [[RTCVideoCodecInfo alloc] initWithName:@"VP8" parameters:nil],
35 [[RTCVideoCodecInfo alloc] initWithName:@"VP9" parameters:nil]
36 ];
37}
38
39@end