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

Unified Diff: webrtc/modules/video_coding/video_codec_initializer.cc

Issue 2532053002: Turn off error resilience for VP9 if no spatial or temporal layers are configured and NACK is enabl… (Closed)
Patch Set: Created 4 years, 1 month 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/modules/video_coding/codecs/vp9/vp9_impl.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/video_codec_initializer.cc
diff --git a/webrtc/modules/video_coding/video_codec_initializer.cc b/webrtc/modules/video_coding/video_codec_initializer.cc
index 57f9b268c0429749b3b4e86d0d5497527daf5b0e..698c89ba805b7224b072c6294b0a70d321690c2e 100644
--- a/webrtc/modules/video_coding/video_codec_initializer.cc
+++ b/webrtc/modules/video_coding/video_codec_initializer.cc
@@ -21,6 +21,15 @@
#include "webrtc/system_wrappers/include/clock.h"
namespace webrtc {
+namespace {
+bool TemporalLayersConfigured(const std::vector<VideoStream>& streams) {
+ for (const VideoStream& stream : streams) {
+ if (stream.temporal_layer_thresholds_bps.size() > 0)
+ return true;
+ }
+ return false;
+}
+} // namespace
bool VideoCodecInitializer::SetupCodec(
const VideoEncoderConfig& config,
@@ -119,12 +128,8 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
*video_codec.VP8() = VideoEncoder::GetDefaultVp8Settings();
video_codec.VP8()->numberOfTemporalLayers = static_cast<unsigned char>(
streams.back().temporal_layer_thresholds_bps.size() + 1);
- bool temporal_layers_configured = false;
- for (const VideoStream& stream : streams) {
- if (stream.temporal_layer_thresholds_bps.size() > 0)
- temporal_layers_configured = true;
- }
- if (nack_enabled && !temporal_layers_configured) {
+
+ if (nack_enabled && !TemporalLayersConfigured(streams)) {
LOG(LS_INFO) << "No temporal layers and nack enabled -> resilience off";
video_codec.VP8()->resilience = kResilienceOff;
}
@@ -142,6 +147,13 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
}
video_codec.VP9()->numberOfTemporalLayers = static_cast<unsigned char>(
streams.back().temporal_layer_thresholds_bps.size() + 1);
+
+ if (nack_enabled && !TemporalLayersConfigured(streams) &&
+ video_codec.VP9()->numberOfSpatialLayers == 1) {
+ LOG(LS_INFO) << "No temporal or spatial layers and nack enabled -> "
+ << "resilience off";
+ video_codec.VP9()->resilienceOn = false;
+ }
break;
}
case kVideoCodecH264: {
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698