Let ViEEncoder express resolution requests as Sinkwants.
This removes the VideoSendStream::LoadObserver interface and the implementation in WebrtcVideoSendStream and replace it with VideoSinkWants through the VideoSourceInterface.
To do that that, some stats for CPU adaptation is moved into VideoSendStream. Also handling of the CVO rtp header extension is moved to VideoSendStreamImpl.
BUG=webrtc:5687
TBR=mflodman@webrtc.org
Review-Url: https://codereview.webrtc.org/2304363002
Cr-Commit-Position: refs/heads/master@{#14877}
diff --git a/webrtc/test/fake_encoder.cc b/webrtc/test/fake_encoder.cc
index ac1c6de..065b529 100644
--- a/webrtc/test/fake_encoder.cc
+++ b/webrtc/test/fake_encoder.cc
@@ -109,6 +109,7 @@
encoded._frameType = (*frame_types)[i];
encoded._encodedWidth = config_.simulcastStream[i].width;
encoded._encodedHeight = config_.simulcastStream[i].height;
+ encoded.rotation_ = input_image.rotation();
RTC_DCHECK(callback_ != NULL);
specifics.codec_name = ImplementationName();
if (callback_->Encoded(encoded, &specifics, NULL) != 0)
@@ -204,10 +205,20 @@
: test::FakeEncoder(clock),
delay_ms_(delay_ms) {}
+void DelayedEncoder::SetDelay(int delay_ms) {
+ rtc::CritScope lock(&lock_);
+ delay_ms_ = delay_ms;
+}
+
int32_t DelayedEncoder::Encode(const VideoFrame& input_image,
const CodecSpecificInfo* codec_specific_info,
const std::vector<FrameType>* frame_types) {
- SleepMs(delay_ms_);
+ int delay_ms = 0;
+ {
+ rtc::CritScope lock(&lock_);
+ delay_ms = delay_ms_;
+ }
+ SleepMs(delay_ms);
return FakeEncoder::Encode(input_image, codec_specific_info, frame_types);
}
} // namespace test