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

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2783183003: Revert of Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Created 3 years, 9 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/webrtcvideoengine2.h ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 742b34c5f072e2e8c5ca50779e5a33f5a92f9695..8c3f958bfb95643475c877460db71069a55d30f2 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -38,10 +38,9 @@
#include "webrtc/video_decoder.h"
#include "webrtc/video_encoder.h"
-using DegradationPreference = webrtc::VideoSendStream::DegradationPreference;
-
namespace cricket {
namespace {
+
// If this field trial is enabled, we will enable sending FlexFEC and disable
// sending ULPFEC whenever the former has been negotiated. Receiving FlexFEC
// is enabled whenever FlexFEC has been negotiated.
@@ -1638,33 +1637,24 @@
}
if (source_ && stream_) {
- stream_->SetSource(nullptr, DegradationPreference::kDegradationDisabled);
+ stream_->SetSource(
+ nullptr, webrtc::VideoSendStream::DegradationPreference::kBalanced);
}
// Switch to the new source.
source_ = source;
if (source && stream_) {
- stream_->SetSource(this, GetDegradationPreference());
+ // Do not adapt resolution for screen content as this will likely
+ // result in blurry and unreadable text.
+ // |this| acts like a VideoSource to make sure SinkWants are handled on the
+ // correct thread.
+ stream_->SetSource(
+ this, enable_cpu_overuse_detection_ &&
+ !parameters_.options.is_screencast.value_or(false)
+ ? webrtc::VideoSendStream::DegradationPreference::kBalanced
+ : webrtc::VideoSendStream::DegradationPreference::
+ kMaintainResolution);
}
return true;
-}
-
-webrtc::VideoSendStream::DegradationPreference
-WebRtcVideoChannel2::WebRtcVideoSendStream::GetDegradationPreference() const {
- // Do not adapt resolution for screen content as this will likely
- // result in blurry and unreadable text.
- // |this| acts like a VideoSource to make sure SinkWants are handled on the
- // correct thread.
- DegradationPreference degradation_preference;
- if (!enable_cpu_overuse_detection_) {
- degradation_preference = DegradationPreference::kDegradationDisabled;
- } else {
- if (parameters_.options.is_screencast.value_or(false)) {
- degradation_preference = DegradationPreference::kMaintainResolution;
- } else {
- degradation_preference = DegradationPreference::kMaintainFramerate;
- }
- }
- return degradation_preference;
}
const std::vector<uint32_t>&
@@ -2105,7 +2095,16 @@
parameters_.encoder_config.encoder_specific_settings = NULL;
if (source_) {
- stream_->SetSource(this, GetDegradationPreference());
+ // Do not adapt resolution for screen content as this will likely result in
+ // blurry and unreadable text.
+ // |this| acts like a VideoSource to make sure SinkWants are handled on the
+ // correct thread.
+ stream_->SetSource(
+ this, enable_cpu_overuse_detection_ &&
+ !parameters_.options.is_screencast.value_or(false)
+ ? webrtc::VideoSendStream::DegradationPreference::kBalanced
+ : webrtc::VideoSendStream::DegradationPreference::
+ kMaintainResolution);
}
// Call stream_->Start() if necessary conditions are met.
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698