2019-09-27 19:16:03 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
#import "RTCCodecSpecificInfo.h"
|
|
|
|
#import "RTCEncodedImage.h"
|
|
|
|
#import "RTCMacros.h"
|
|
|
|
#import "RTCRtpFragmentationHeader.h"
|
|
|
|
#import "RTCVideoEncoderQpThresholds.h"
|
|
|
|
#import "RTCVideoEncoderSettings.h"
|
|
|
|
#import "RTCVideoFrame.h"
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
/** Callback block for encoder. */
|
2020-11-03 14:18:15 +00:00
|
|
|
typedef BOOL (^RTCVideoEncoderCallback)(RTC_OBJC_TYPE(RTCEncodedImage) * frame,
|
|
|
|
id<RTC_OBJC_TYPE(RTCCodecSpecificInfo)> info,
|
|
|
|
RTC_OBJC_TYPE(RTCRtpFragmentationHeader) * header);
|
2019-09-27 19:16:03 +00:00
|
|
|
|
|
|
|
/** Protocol for encoder implementations. */
|
|
|
|
RTC_OBJC_EXPORT
|
2020-11-03 14:18:15 +00:00
|
|
|
@protocol RTC_OBJC_TYPE
|
|
|
|
(RTCVideoEncoder)<NSObject>
|
2019-09-27 19:16:03 +00:00
|
|
|
|
2020-11-03 14:18:15 +00:00
|
|
|
- (void)setCallback : (RTCVideoEncoderCallback)callback;
|
|
|
|
- (NSInteger)startEncodeWithSettings:(RTC_OBJC_TYPE(RTCVideoEncoderSettings) *)settings
|
2019-09-27 19:16:03 +00:00
|
|
|
numberOfCores:(int)numberOfCores;
|
|
|
|
- (NSInteger)releaseEncoder;
|
2020-11-03 14:18:15 +00:00
|
|
|
- (NSInteger)encode:(RTC_OBJC_TYPE(RTCVideoFrame) *)frame
|
|
|
|
codecSpecificInfo:(nullable id<RTC_OBJC_TYPE(RTCCodecSpecificInfo)>)info
|
2019-09-27 19:16:03 +00:00
|
|
|
frameTypes:(NSArray<NSNumber *> *)frameTypes;
|
|
|
|
- (int)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate;
|
|
|
|
- (NSString *)implementationName;
|
|
|
|
|
|
|
|
/** Returns QP scaling settings for encoder. The quality scaler adjusts the resolution in order to
|
|
|
|
* keep the QP from the encoded images within the given range. Returning nil from this function
|
|
|
|
* disables quality scaling. */
|
2020-11-03 14:18:15 +00:00
|
|
|
- (nullable RTC_OBJC_TYPE(RTCVideoEncoderQpThresholds) *)scalingSettings;
|
2019-09-27 19:16:03 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|