2017-10-05 16:55:38 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 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>
|
|
|
|
|
|
2024-03-21 16:46:42 +01:00
|
|
|
#import "RTCNativeVideoEncoder.h"
|
|
|
|
|
#import "RTCNativeVideoEncoderBuilder+Native.h"
|
2018-08-30 09:30:29 +02:00
|
|
|
#import "RTCVideoEncoderVP8.h"
|
2024-08-29 12:38:07 +02:00
|
|
|
#import "helpers/NSString+StdString.h"
|
2024-09-16 11:41:17 +03:00
|
|
|
#import "sdk/objc/base/RTCMacros.h"
|
2017-10-05 16:55:38 +02:00
|
|
|
|
2024-08-29 12:38:07 +02:00
|
|
|
#include "api/video_codecs/scalability_mode.h"
|
2017-10-05 16:55:38 +02:00
|
|
|
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
2024-08-29 12:38:07 +02:00
|
|
|
#include "modules/video_coding/codecs/vp8/vp8_scalability.h"
|
2017-10-05 16:55:38 +02:00
|
|
|
|
2024-03-21 16:46:42 +01:00
|
|
|
@interface RTC_OBJC_TYPE (RTCVideoEncoderVP8Builder)
|
|
|
|
|
: RTC_OBJC_TYPE(RTCNativeVideoEncoder) <RTC_OBJC_TYPE (RTCNativeVideoEncoderBuilder)>
|
|
|
|
|
@end
|
2017-10-05 16:55:38 +02:00
|
|
|
|
2024-03-21 16:46:42 +01:00
|
|
|
@implementation RTC_OBJC_TYPE (RTCVideoEncoderVP8Builder)
|
2017-10-05 16:55:38 +02:00
|
|
|
|
2025-01-08 05:45:56 -08:00
|
|
|
- (std::unique_ptr<webrtc::VideoEncoder>)build:
|
|
|
|
|
(const webrtc::Environment&)env {
|
2024-03-21 16:46:42 +01:00
|
|
|
return webrtc::CreateVp8Encoder(env);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation RTC_OBJC_TYPE (RTCVideoEncoderVP8)
|
|
|
|
|
|
|
|
|
|
+ (id<RTC_OBJC_TYPE(RTCVideoEncoder)>)vp8Encoder {
|
|
|
|
|
return [[RTC_OBJC_TYPE(RTCVideoEncoderVP8Builder) alloc] init];
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-29 12:38:07 +02:00
|
|
|
+ (NSArray<NSString*>*)supportedScalabilityModes {
|
2025-01-08 05:45:56 -08:00
|
|
|
NSMutableArray<NSString*>* result = [NSMutableArray
|
|
|
|
|
arrayWithCapacity:std::size(webrtc::kVP8SupportedScalabilityModes)];
|
|
|
|
|
for (webrtc::ScalabilityMode mode :
|
|
|
|
|
webrtc::kVP8SupportedScalabilityModes) {
|
|
|
|
|
[result addObject:[NSString stringForAbslStringView:
|
|
|
|
|
webrtc::ScalabilityModeToString(mode)]];
|
2024-08-29 12:38:07 +02:00
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 16:46:42 +01:00
|
|
|
@end
|