Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 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 <Foundation/Foundation.h> |
| 12 | |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 13 | #import "RTCWrappedNativeVideoDecoder.h" |
Mirko Bonadei | 5923083 | 2020-08-24 22:08:52 +0200 | [diff] [blame] | 14 | #import "base/RTCMacros.h" |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 15 | #import "helpers/NSString+StdString.h" |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 16 | |
Mirko Bonadei | 5923083 | 2020-08-24 22:08:52 +0200 | [diff] [blame] | 17 | @implementation RTC_OBJC_TYPE (RTCWrappedNativeVideoDecoder) { |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 18 | std::unique_ptr<webrtc::VideoDecoder> _wrappedDecoder; |
| 19 | } |
| 20 | |
| 21 | - (instancetype)initWithNativeDecoder:(std::unique_ptr<webrtc::VideoDecoder>)decoder { |
| 22 | if (self = [super init]) { |
| 23 | _wrappedDecoder = std::move(decoder); |
| 24 | } |
| 25 | |
| 26 | return self; |
| 27 | } |
| 28 | |
| 29 | - (std::unique_ptr<webrtc::VideoDecoder>)releaseWrappedDecoder { |
| 30 | return std::move(_wrappedDecoder); |
| 31 | } |
| 32 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 33 | #pragma mark - RTC_OBJC_TYPE(RTCVideoDecoder) |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 34 | |
| 35 | - (void)setCallback:(RTCVideoDecoderCallback)callback { |
| 36 | RTC_NOTREACHED(); |
| 37 | } |
| 38 | |
Anders Carlsson | 2a1bbc3 | 2018-04-04 12:49:43 +0200 | [diff] [blame] | 39 | - (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores { |
| 40 | RTC_NOTREACHED(); |
| 41 | return 0; |
| 42 | } |
| 43 | |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 44 | - (NSInteger)releaseDecoder { |
| 45 | RTC_NOTREACHED(); |
| 46 | return 0; |
| 47 | } |
| 48 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 49 | - (NSInteger)decode:(RTC_OBJC_TYPE(RTCEncodedImage) *)encodedImage |
Niels Möller | c199fae | 2018-04-26 09:54:25 +0200 | [diff] [blame] | 50 | missingFrames:(BOOL)missingFrames |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 51 | codecSpecificInfo:(nullable id<RTC_OBJC_TYPE(RTCCodecSpecificInfo)>)info |
Niels Möller | c199fae | 2018-04-26 09:54:25 +0200 | [diff] [blame] | 52 | renderTimeMs:(int64_t)renderTimeMs { |
| 53 | RTC_NOTREACHED(); |
| 54 | return 0; |
| 55 | } |
| 56 | |
Anders Carlsson | 7e04281 | 2017-10-05 16:55:38 +0200 | [diff] [blame] | 57 | - (NSString *)implementationName { |
| 58 | RTC_NOTREACHED(); |
| 59 | return nil; |
| 60 | } |
| 61 | |
| 62 | @end |