Always include the actual encoder implementation when RTCVideoEncoderAV1 is used.
Bug: webrtc:13573, b/236813931 Change-Id: I943ce51dac23bcbd6efe10413cfa9478f4ce6f55 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266485 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37352}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
ce80886bf2
commit
91c05abd9b
32
sdk/BUILD.gn
32
sdk/BUILD.gn
@ -673,8 +673,8 @@ if (is_ios || is_mac) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
":av1",
|
|
||||||
":base_objc",
|
":base_objc",
|
||||||
|
":libaom_av1_decoder",
|
||||||
":native_video",
|
":native_video",
|
||||||
":videocodec_objc",
|
":videocodec_objc",
|
||||||
":videotoolbox_objc",
|
":videotoolbox_objc",
|
||||||
@ -682,6 +682,12 @@ if (is_ios || is_mac) {
|
|||||||
":vp9",
|
":vp9",
|
||||||
":vpx_codec_constants",
|
":vpx_codec_constants",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
defines = []
|
||||||
|
if (enable_libaom) {
|
||||||
|
defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
|
||||||
|
deps += [ ":libaom_av1_encoder" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_library("vpx_codec_constants") {
|
rtc_library("vpx_codec_constants") {
|
||||||
@ -732,14 +738,12 @@ if (is_ios || is_mac) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_library("av1") {
|
rtc_library("libaom_av1_decoder") {
|
||||||
visibility = [ "*" ]
|
visibility = [ "*" ]
|
||||||
allow_poison = [ "software_video_codecs" ]
|
allow_poison = [ "software_video_codecs" ]
|
||||||
sources = [
|
sources = [
|
||||||
"objc/api/video_codec/RTCVideoDecoderAV1.h",
|
"objc/api/video_codec/RTCVideoDecoderAV1.h",
|
||||||
"objc/api/video_codec/RTCVideoDecoderAV1.mm",
|
"objc/api/video_codec/RTCVideoDecoderAV1.mm",
|
||||||
"objc/api/video_codec/RTCVideoEncoderAV1.h",
|
|
||||||
"objc/api/video_codec/RTCVideoEncoderAV1.mm",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
@ -748,12 +752,22 @@ if (is_ios || is_mac) {
|
|||||||
"../media:rtc_media_base",
|
"../media:rtc_media_base",
|
||||||
"../modules/video_coding/codecs/av1:libaom_av1_decoder",
|
"../modules/video_coding/codecs/av1:libaom_av1_decoder",
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
defines = []
|
rtc_library("libaom_av1_encoder") {
|
||||||
if (enable_libaom) {
|
visibility = [ "*" ]
|
||||||
defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
|
allow_poison = [ "software_video_codecs" ]
|
||||||
deps += [ "../modules/video_coding/codecs/av1:libaom_av1_encoder" ]
|
sources = [
|
||||||
}
|
"objc/api/video_codec/RTCVideoEncoderAV1.h",
|
||||||
|
"objc/api/video_codec/RTCVideoEncoderAV1.mm",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":base_objc",
|
||||||
|
":wrapped_native_codec_objc",
|
||||||
|
"../media:rtc_media_base",
|
||||||
|
"../modules/video_coding/codecs/av1:libaom_av1_encoder",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_library("mediaconstraints_objc") {
|
rtc_library("mediaconstraints_objc") {
|
||||||
|
@ -14,29 +14,18 @@
|
|||||||
#import "RTCMacros.h"
|
#import "RTCMacros.h"
|
||||||
#import "RTCVideoEncoderAV1.h"
|
#import "RTCVideoEncoderAV1.h"
|
||||||
#import "RTCWrappedNativeVideoEncoder.h"
|
#import "RTCWrappedNativeVideoEncoder.h"
|
||||||
|
#include "modules/video_coding/codecs/av1/libaom_av1_encoder.h"
|
||||||
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
|
||||||
#include "modules/video_coding/codecs/av1/libaom_av1_encoder.h" // nogncheck
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@implementation RTC_OBJC_TYPE (RTCVideoEncoderAV1)
|
@implementation RTC_OBJC_TYPE (RTCVideoEncoderAV1)
|
||||||
|
|
||||||
+ (id<RTC_OBJC_TYPE(RTCVideoEncoder)>)av1Encoder {
|
+ (id<RTC_OBJC_TYPE(RTCVideoEncoder)>)av1Encoder {
|
||||||
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
|
||||||
std::unique_ptr<webrtc::VideoEncoder> nativeEncoder(webrtc::CreateLibaomAv1Encoder());
|
std::unique_ptr<webrtc::VideoEncoder> nativeEncoder(webrtc::CreateLibaomAv1Encoder());
|
||||||
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) alloc]
|
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) alloc]
|
||||||
initWithNativeEncoder:std::move(nativeEncoder)];
|
initWithNativeEncoder:std::move(nativeEncoder)];
|
||||||
#else
|
|
||||||
return nil;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (bool)isSupported {
|
+ (bool)isSupported {
|
||||||
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -13,11 +13,14 @@
|
|||||||
#import "RTCH264ProfileLevelId.h"
|
#import "RTCH264ProfileLevelId.h"
|
||||||
#import "RTCVideoEncoderH264.h"
|
#import "RTCVideoEncoderH264.h"
|
||||||
#import "api/video_codec/RTCVideoCodecConstants.h"
|
#import "api/video_codec/RTCVideoCodecConstants.h"
|
||||||
#import "api/video_codec/RTCVideoEncoderAV1.h"
|
|
||||||
#import "api/video_codec/RTCVideoEncoderVP8.h"
|
#import "api/video_codec/RTCVideoEncoderVP8.h"
|
||||||
#import "api/video_codec/RTCVideoEncoderVP9.h"
|
#import "api/video_codec/RTCVideoEncoderVP9.h"
|
||||||
#import "base/RTCVideoCodecInfo.h"
|
#import "base/RTCVideoCodecInfo.h"
|
||||||
|
|
||||||
|
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
||||||
|
#import "api/video_codec/RTCVideoEncoderAV1.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
@implementation RTC_OBJC_TYPE (RTCDefaultVideoEncoderFactory)
|
@implementation RTC_OBJC_TYPE (RTCDefaultVideoEncoderFactory)
|
||||||
|
|
||||||
@synthesize preferredCodec;
|
@synthesize preferredCodec;
|
||||||
@ -55,10 +58,9 @@
|
|||||||
addObject:[[RTC_OBJC_TYPE(RTCVideoCodecInfo) alloc] initWithName:kRTCVideoCodecVp9Name]];
|
addObject:[[RTC_OBJC_TYPE(RTCVideoCodecInfo) alloc] initWithName:kRTCVideoCodecVp9Name]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([RTC_OBJC_TYPE(RTCVideoEncoderAV1) isSupported]) {
|
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
||||||
[result
|
[result addObject:[[RTC_OBJC_TYPE(RTCVideoCodecInfo) alloc] initWithName:kRTCVideoCodecAv1Name]];
|
||||||
addObject:[[RTC_OBJC_TYPE(RTCVideoCodecInfo) alloc] initWithName:kRTCVideoCodecAv1Name]];
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -71,10 +73,13 @@
|
|||||||
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name] &&
|
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name] &&
|
||||||
[RTC_OBJC_TYPE(RTCVideoEncoderVP9) isSupported]) {
|
[RTC_OBJC_TYPE(RTCVideoEncoderVP9) isSupported]) {
|
||||||
return [RTC_OBJC_TYPE(RTCVideoEncoderVP9) vp9Encoder];
|
return [RTC_OBJC_TYPE(RTCVideoEncoderVP9) vp9Encoder];
|
||||||
} else if ([info.name isEqualToString:kRTCVideoCodecAv1Name] &&
|
}
|
||||||
[RTC_OBJC_TYPE(RTCVideoEncoderAV1) isSupported]) {
|
|
||||||
|
#if defined(RTC_USE_LIBAOM_AV1_ENCODER)
|
||||||
|
if ([info.name isEqualToString:kRTCVideoCodecAv1Name]) {
|
||||||
return [RTC_OBJC_TYPE(RTCVideoEncoderAV1) av1Encoder];
|
return [RTC_OBJC_TYPE(RTCVideoEncoderAV1) av1Encoder];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user