Use EncoderSimulcastProxy for all codecs

Some codecs don't support directly creating simulcast layers with
non-optimal parameters. This proxy will detect this and create
multiple encoders then, one for each layer as a fallback.

Bug: webrtc:10069
Change-Id: I4bcafcfdd68d9ed466e2fafe564db849de6ed4f6
Reviewed-on: https://webrtc-review.googlesource.com/c/119264
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26373}
This commit is contained in:
Florent Castelli 2019-01-23 14:17:09 +01:00 committed by Commit Bot
parent b599787969
commit 83d5e86163

View File

@ -61,11 +61,8 @@ class BuiltinVideoEncoderFactory : public VideoEncoderFactory {
std::unique_ptr<VideoEncoder> internal_encoder; std::unique_ptr<VideoEncoder> internal_encoder;
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(), if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
format)) { format)) {
internal_encoder = internal_encoder = absl::make_unique<EncoderSimulcastProxy>(
absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName) internal_encoder_factory_.get(), format);
? absl::make_unique<EncoderSimulcastProxy>(
internal_encoder_factory_.get(), format)
: internal_encoder_factory_->CreateVideoEncoder(format);
} }
return internal_encoder; return internal_encoder;