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

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

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Rebased. 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/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/fakewebrtccall.cc
diff --git a/webrtc/media/engine/fakewebrtccall.cc b/webrtc/media/engine/fakewebrtccall.cc
index df6febe734effbe8e61733f56888df817c2a0398..43e083fefb469a707190a9267d279814e108e94e 100644
--- a/webrtc/media/engine/fakewebrtccall.cc
+++ b/webrtc/media/engine/fakewebrtccall.cc
@@ -104,6 +104,7 @@ FakeVideoSendStream::FakeVideoSendStream(
: sending_(false),
config_(std::move(config)),
codec_settings_set_(false),
+ resolution_scaling_enabled_(false),
source_(nullptr),
num_swapped_frames_(0) {
RTC_DCHECK(config.encoder_settings.encoder != NULL);
@@ -233,13 +234,26 @@ void FakeVideoSendStream::Stop() {
}
void FakeVideoSendStream::SetSource(
- rtc::VideoSourceInterface<webrtc::VideoFrame>* source) {
+ rtc::VideoSourceInterface<webrtc::VideoFrame>* source,
+ const webrtc::VideoSendStream::DegradationPreference&
+ degradation_preference) {
RTC_DCHECK(source != source_);
if (source_)
source_->RemoveSink(this);
source_ = source;
+ resolution_scaling_enabled_ =
+ degradation_preference !=
+ webrtc::VideoSendStream::DegradationPreference::kMaintainResolution;
if (source)
- source->AddOrUpdateSink(this, rtc::VideoSinkWants());
+ source->AddOrUpdateSink(this, resolution_scaling_enabled_
+ ? sink_wants_
+ : rtc::VideoSinkWants());
+}
+
+void FakeVideoSendStream::InjectVideoSinkWants(
+ const rtc::VideoSinkWants& wants) {
+ sink_wants_ = wants;
+ source_->AddOrUpdateSink(this, wants);
}
FakeVideoReceiveStream::FakeVideoReceiveStream(
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698