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
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000011#import "ARDVideoDecoderFactory.h"
Anders Carlsson7e042812017-10-05 16:55:38 +020012
13#import "WebRTC/RTCVideoCodecH264.h"
14#import "WebRTC/RTCVideoDecoderVP8.h"
15#import "WebRTC/RTCVideoDecoderVP9.h"
16
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000017@implementation ARDVideoDecoderFactory
Anders Carlsson7e042812017-10-05 16:55:38 +020018
19- (id<RTCVideoDecoder>)createDecoder:(RTCVideoCodecInfo *)info {
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000020 if ([info.name isEqualToString:@"H264"]) {
Anders Carlsson7e042812017-10-05 16:55:38 +020021 return [[RTCVideoDecoderH264 alloc] init];
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000022 } else if ([info.name isEqualToString:@"VP8"]) {
Anders Carlsson7e042812017-10-05 16:55:38 +020023 return [RTCVideoDecoderVP8 vp8Decoder];
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000024 } else if ([info.name isEqualToString:@"VP9"]) {
Anders Carlsson7e042812017-10-05 16:55:38 +020025 return [RTCVideoDecoderVP9 vp9Decoder];
26 }
27
28 return nil;
29}
30
31- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs {
32 return @[
Oskar Sundbom4556f3c2017-10-26 11:55:45 +000033 [[RTCVideoCodecInfo alloc] initWithName:@"H264" parameters:nil],
34 [[RTCVideoCodecInfo alloc] initWithName:@"VP8" parameters:nil],
35 [[RTCVideoCodecInfo alloc] initWithName:@"VP9" parameters:nil]
Anders Carlsson7e042812017-10-05 16:55:38 +020036 ];
37}
38
39@end