Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc

Issue 2988963002: Add support for a forced software encoder fallback. (Closed)
Patch Set: address comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/videoencodersoftwarefallbackwrapper_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « webrtc/media/engine/videoencodersoftwarefallbackwrapper_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698