xref: /aosp_15_r20/external/webrtc/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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
13#import "RTCWrappedNativeVideoEncoder.h"
14#import "base/RTCMacros.h"
15#import "helpers/NSString+StdString.h"
16
17@implementation RTC_OBJC_TYPE (RTCWrappedNativeVideoEncoder) {
18  std::unique_ptr<webrtc::VideoEncoder> _wrappedEncoder;
19}
20
21- (instancetype)initWithNativeEncoder:(std::unique_ptr<webrtc::VideoEncoder>)encoder {
22  if (self = [super init]) {
23    _wrappedEncoder = std::move(encoder);
24  }
25
26  return self;
27}
28
29- (std::unique_ptr<webrtc::VideoEncoder>)releaseWrappedEncoder {
30  return std::move(_wrappedEncoder);
31}
32
33#pragma mark - RTC_OBJC_TYPE(RTCVideoEncoder)
34
35- (void)setCallback:(RTCVideoEncoderCallback)callback {
36  RTC_DCHECK_NOTREACHED();
37}
38
39- (NSInteger)startEncodeWithSettings:(RTC_OBJC_TYPE(RTCVideoEncoderSettings) *)settings
40                       numberOfCores:(int)numberOfCores {
41  RTC_DCHECK_NOTREACHED();
42  return 0;
43}
44
45- (NSInteger)releaseEncoder {
46  RTC_DCHECK_NOTREACHED();
47  return 0;
48}
49
50- (NSInteger)encode:(RTC_OBJC_TYPE(RTCVideoFrame) *)frame
51    codecSpecificInfo:(nullable id<RTC_OBJC_TYPE(RTCCodecSpecificInfo)>)info
52           frameTypes:(NSArray<NSNumber *> *)frameTypes {
53  RTC_DCHECK_NOTREACHED();
54  return 0;
55}
56
57- (int)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate {
58  RTC_DCHECK_NOTREACHED();
59  return 0;
60}
61
62- (NSString *)implementationName {
63  RTC_DCHECK_NOTREACHED();
64  return nil;
65}
66
67- (nullable RTC_OBJC_TYPE(RTCVideoEncoderQpThresholds) *)scalingSettings {
68  RTC_DCHECK_NOTREACHED();
69  return nil;
70}
71
72- (NSInteger)resolutionAlignment {
73  RTC_DCHECK_NOTREACHED();
74  return 1;
75}
76
77- (BOOL)applyAlignmentToAllSimulcastLayers {
78  RTC_DCHECK_NOTREACHED();
79  return NO;
80}
81
82- (BOOL)supportsNativeHandle {
83  RTC_DCHECK_NOTREACHED();
84  return NO;
85}
86@end
87