webrtc_m130/examples/objc/AppRTCMobile/ARDVideoDecoderFactory.m

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.2 KiB
Mathematica
Raw Normal View History

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