Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 1 | /* |
| 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 <Foundation/Foundation.h> |
| 12 | |
| 13 | #import "RTCCodecSpecificInfo.h" |
| 14 | #import "RTCEncodedImage.h" |
| 15 | #import "RTCMacros.h" |
| 16 | #import "RTCVideoEncoderSettings.h" |
| 17 | #import "RTCVideoFrame.h" |
| 18 | |
| 19 | NS_ASSUME_NONNULL_BEGIN |
| 20 | |
| 21 | /** Callback block for decoder. */ |
| 22 | typedef void (^RTCVideoDecoderCallback)(RTCVideoFrame *frame); |
| 23 | |
| 24 | /** Protocol for decoder implementations. */ |
Mirko Bonadei | e8d5724 | 2018-09-17 10:22:56 +0200 | [diff] [blame^] | 25 | RTC_OBJC_EXPORT |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 26 | @protocol RTCVideoDecoder <NSObject> |
| 27 | |
| 28 | - (void)setCallback:(RTCVideoDecoderCallback)callback; |
| 29 | - (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings |
| 30 | numberOfCores:(int)numberOfCores |
| 31 | DEPRECATED_MSG_ATTRIBUTE("use startDecodeWithNumberOfCores: instead"); |
| 32 | - (NSInteger)releaseDecoder; |
| 33 | - (NSInteger)decode:(RTCEncodedImage *)encodedImage |
| 34 | missingFrames:(BOOL)missingFrames |
| 35 | codecSpecificInfo:(nullable id<RTCCodecSpecificInfo>)info |
| 36 | renderTimeMs:(int64_t)renderTimeMs; |
| 37 | - (NSString *)implementationName; |
| 38 | |
| 39 | // TODO(andersc): Make non-optional when `startDecodeWithSettings:numberOfCores:` is removed. |
| 40 | @optional |
| 41 | - (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores; |
| 42 | |
| 43 | @end |
| 44 | |
| 45 | NS_ASSUME_NONNULL_END |