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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/fakewebrtccall.h ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void FakeAudioReceiveStream::SetGain(float gain) { 97 void FakeAudioReceiveStream::SetGain(float gain) {
98 gain_ = gain; 98 gain_ = gain;
99 } 99 }
100 100
101 FakeVideoSendStream::FakeVideoSendStream( 101 FakeVideoSendStream::FakeVideoSendStream(
102 webrtc::VideoSendStream::Config config, 102 webrtc::VideoSendStream::Config config,
103 webrtc::VideoEncoderConfig encoder_config) 103 webrtc::VideoEncoderConfig encoder_config)
104 : sending_(false), 104 : sending_(false),
105 config_(std::move(config)), 105 config_(std::move(config)),
106 codec_settings_set_(false), 106 codec_settings_set_(false),
107 resolution_scaling_enabled_(false),
107 source_(nullptr), 108 source_(nullptr),
108 num_swapped_frames_(0) { 109 num_swapped_frames_(0) {
109 RTC_DCHECK(config.encoder_settings.encoder != NULL); 110 RTC_DCHECK(config.encoder_settings.encoder != NULL);
110 ReconfigureVideoEncoder(std::move(encoder_config)); 111 ReconfigureVideoEncoder(std::move(encoder_config));
111 } 112 }
112 113
113 FakeVideoSendStream::~FakeVideoSendStream() { 114 FakeVideoSendStream::~FakeVideoSendStream() {
114 if (source_) 115 if (source_)
115 source_->RemoveSink(this); 116 source_->RemoveSink(this);
116 } 117 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 227
227 void FakeVideoSendStream::Start() { 228 void FakeVideoSendStream::Start() {
228 sending_ = true; 229 sending_ = true;
229 } 230 }
230 231
231 void FakeVideoSendStream::Stop() { 232 void FakeVideoSendStream::Stop() {
232 sending_ = false; 233 sending_ = false;
233 } 234 }
234 235
235 void FakeVideoSendStream::SetSource( 236 void FakeVideoSendStream::SetSource(
236 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) { 237 rtc::VideoSourceInterface<webrtc::VideoFrame>* source,
238 const webrtc::VideoSendStream::DegradationPreference&
239 degradation_preference) {
237 RTC_DCHECK(source != source_); 240 RTC_DCHECK(source != source_);
238 if (source_) 241 if (source_)
239 source_->RemoveSink(this); 242 source_->RemoveSink(this);
240 source_ = source; 243 source_ = source;
244 resolution_scaling_enabled_ =
245 degradation_preference !=
246 webrtc::VideoSendStream::DegradationPreference::kMaintainResolution;
241 if (source) 247 if (source)
242 source->AddOrUpdateSink(this, rtc::VideoSinkWants()); 248 source->AddOrUpdateSink(this, resolution_scaling_enabled_
249 ? sink_wants_
250 : rtc::VideoSinkWants());
251 }
252
253 void FakeVideoSendStream::InjectVideoSinkWants(
254 const rtc::VideoSinkWants& wants) {
255 sink_wants_ = wants;
256 source_->AddOrUpdateSink(this, wants);
243 } 257 }
244 258
245 FakeVideoReceiveStream::FakeVideoReceiveStream( 259 FakeVideoReceiveStream::FakeVideoReceiveStream(
246 webrtc::VideoReceiveStream::Config config) 260 webrtc::VideoReceiveStream::Config config)
247 : config_(std::move(config)), receiving_(false) {} 261 : config_(std::move(config)), receiving_(false) {}
248 262
249 const webrtc::VideoReceiveStream::Config& FakeVideoReceiveStream::GetConfig() { 263 const webrtc::VideoReceiveStream::Config& FakeVideoReceiveStream::GetConfig() {
250 return config_; 264 return config_;
251 } 265 }
252 266
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 } 529 }
516 530
517 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { 531 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) {
518 last_sent_packet_ = sent_packet; 532 last_sent_packet_ = sent_packet;
519 if (sent_packet.packet_id >= 0) { 533 if (sent_packet.packet_id >= 0) {
520 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; 534 last_sent_nonnegative_packet_id_ = sent_packet.packet_id;
521 } 535 }
522 } 536 }
523 537
524 } // namespace cricket 538 } // namespace cricket
OLDNEW
« 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