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

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

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: windows warning 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
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 8b4c5df1814601757b5d74b80eccf9087c745be5..1bc93ef24a0c3a66110e1a2ed4998109c01f2a95 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -38,9 +38,10 @@
#include "webrtc/video_decoder.h"
#include "webrtc/video_encoder.h"
+using DegradationPreference = webrtc::VideoSendStream::DegradationPreference;
nisse-webrtc 2017/03/14 09:00:29 Perhaps not for this cl, but if DegradationPrefere
sprang_webrtc 2017/03/14 14:15:02 Agreed. I think we need to overhaul a few pieces o
+
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.
@@ -1627,7 +1628,8 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend(
if (source_ && stream_) {
stream_->SetSource(
- nullptr, webrtc::VideoSendStream::DegradationPreference::kBalanced);
+ nullptr,
+ webrtc::VideoSendStream::DegradationPreference::kDegradationDisabled);
kthelgason 2017/03/14 10:01:20 just DegradationPreference::kDegradationDisabled g
sprang_webrtc 2017/03/14 14:15:02 Done.
}
// Switch to the new source.
source_ = source;
@@ -1636,12 +1638,17 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend(
// 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);
+ DegradationPreference degradation_preference;
+ if (!enable_cpu_overuse_detection_) {
+ degradation_preference = DegradationPreference::kDegradationDisabled;
nisse-webrtc 2017/03/14 09:00:29 I wonder if this disable value should be made avai
sprang_webrtc 2017/03/14 14:15:02 |enable_cpu_overuse_detection_| is currently popul
+ } else {
+ if (parameters_.options.is_screencast.value_or(false)) {
+ degradation_preference = DegradationPreference::kMaintainResolution;
+ } else {
+ degradation_preference = DegradationPreference::kMaintainFramerate;
+ }
+ }
+ stream_->SetSource(this, degradation_preference);
}
return true;
}
@@ -2088,11 +2095,12 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::RecreateWebRtcStream() {
// |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);
+ this,
+ enable_cpu_overuse_detection_ &&
+ !parameters_.options.is_screencast.value_or(false)
+ ? webrtc::VideoSendStream::DegradationPreference::kMaintainFramerate
nisse-webrtc 2017/03/14 09:00:29 Why is this logic different from logic in SetVideo
sprang_webrtc 2017/03/14 14:15:02 Done.
+ : webrtc::VideoSendStream::DegradationPreference::
+ kMaintainResolution);
}
// Call stream_->Start() if necessary conditions are met.

Powered by Google App Engine
This is Rietveld 408576698