Chromium Code Reviews| 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..915cbf212def77043feb4c8a1b69f02261d8b6ce 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. |
|
brandtr
2017/08/04 11:16:24
Should we file a bug to track this issue?
sprang_webrtc
2017/08/07 08:59:12
Why did explicitly de-registering the temporal lay
åsapersson
2017/08/08 10:40:54
Using something like tl_factory->Remove is not pos
sprang_webrtc
2017/08/09 08:38:07
Ah, that's problematic. This should be fixed, but
|
| +// Causes any 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; |
| } |