OLD | NEW |
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 Loading... |
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_disabled_(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 Loading... |
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 bool disable_resolution_scaling) { |
237 RTC_DCHECK(source != source_); | 239 RTC_DCHECK(source != source_); |
238 if (source_) | 240 if (source_) |
239 source_->RemoveSink(this); | 241 source_->RemoveSink(this); |
240 source_ = source; | 242 source_ = source; |
| 243 resolution_scaling_disabled_ = disable_resolution_scaling; |
241 if (source) | 244 if (source) |
242 source->AddOrUpdateSink(this, rtc::VideoSinkWants()); | 245 source->AddOrUpdateSink( |
| 246 this, disable_resolution_scaling ? rtc::VideoSinkWants() : sink_wants_); |
| 247 } |
| 248 |
| 249 void FakeVideoSendStream::InjectVideoSinkWants( |
| 250 const rtc::VideoSinkWants& wants) { |
| 251 sink_wants_ = wants; |
| 252 source_->AddOrUpdateSink(this, wants); |
243 } | 253 } |
244 | 254 |
245 FakeVideoReceiveStream::FakeVideoReceiveStream( | 255 FakeVideoReceiveStream::FakeVideoReceiveStream( |
246 webrtc::VideoReceiveStream::Config config) | 256 webrtc::VideoReceiveStream::Config config) |
247 : config_(std::move(config)), receiving_(false) {} | 257 : config_(std::move(config)), receiving_(false) {} |
248 | 258 |
249 const webrtc::VideoReceiveStream::Config& FakeVideoReceiveStream::GetConfig() { | 259 const webrtc::VideoReceiveStream::Config& FakeVideoReceiveStream::GetConfig() { |
250 return config_; | 260 return config_; |
251 } | 261 } |
252 | 262 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 514 } |
505 | 515 |
506 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { | 516 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { |
507 last_sent_packet_ = sent_packet; | 517 last_sent_packet_ = sent_packet; |
508 if (sent_packet.packet_id >= 0) { | 518 if (sent_packet.packet_id >= 0) { |
509 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; | 519 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; |
510 } | 520 } |
511 } | 521 } |
512 | 522 |
513 } // namespace cricket | 523 } // namespace cricket |
OLD | NEW |