| Index: webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
|
| diff --git a/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc b/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
|
| index ce7faf9f986943dcef44567e867686361d548c5d..979c64e24324bca7493001b16f37b94ed14b18d1 100644
|
| --- a/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
|
| +++ b/webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc
|
| @@ -19,6 +19,7 @@
|
| #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
|
| #include "webrtc/modules/video_coding/include/video_codec_interface.h"
|
| #include "webrtc/rtc_base/checks.h"
|
| +#include "webrtc/system_wrappers/include/field_trial.h"
|
|
|
| #include "vpx/vpx_encoder.h"
|
| #include "vpx/vp8cx.h"
|
| @@ -248,6 +249,16 @@ std::vector<TemporalLayers::FrameConfig> GetTemporalPattern(size_t num_layers) {
|
| TemporalLayers::kNone, TemporalLayers::kNone, TemporalLayers::kNone)};
|
| }
|
|
|
| +// Temporary fix for forced SW fallback.
|
| +// For VP8 SW codec, |TemporalLayers| is created and reported to
|
| +// SimulcastRateAllocator::OnTemporalLayersCreated but not for VP8 HW.
|
| +// Causes an issue when going from forced SW -> HW as |TemporalLayers| is not
|
| +// deregistred when deleted by SW codec (tl factory might not exist, owned by
|
| +// SimulcastRateAllocator).
|
| +bool ExcludeOnTemporalLayersCreated(int num_temporal_layers) {
|
| + return webrtc::field_trial::IsEnabled("WebRTC-VP8-Forced-Fallback-Encoder") &&
|
| + num_temporal_layers == 1;
|
| +}
|
| } // namespace
|
|
|
| DefaultTemporalLayers::DefaultTemporalLayers(int number_of_temporal_layers,
|
| @@ -372,7 +383,7 @@ TemporalLayers* TemporalLayersFactory::Create(
|
| uint8_t initial_tl0_pic_idx) const {
|
| TemporalLayers* tl =
|
| new DefaultTemporalLayers(temporal_layers, initial_tl0_pic_idx);
|
| - if (listener_)
|
| + if (listener_ && !ExcludeOnTemporalLayersCreated(temporal_layers))
|
| listener_->OnTemporalLayersCreated(simulcast_id, tl);
|
| return tl;
|
| }
|
|
|