in test::FrameGeneratorCapturer try to keep up with fps when overloaded

this reverts behavior change of
https://webrtc-review.googlesource.com/c/src/+/98844
where capturere prefer to skip frames when overloaded.

Bug: webrtc:9739
Change-Id: Ib1c8bb27cc0e160bf6db87926630bbc176c73204
Reviewed-on: https://webrtc-review.googlesource.com/99900
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24709}
This commit is contained in:
Danil Chapovalov
2018-09-12 12:53:10 +02:00
committed by Commit Bot
parent 984bd576cc
commit afc3eb1a73

View File

@ -50,17 +50,16 @@ class FrameGeneratorCapturer::InsertFrameTask : public rtc::QueuedTask {
int64_t now_ms = rtc::TimeMillis(); int64_t now_ms = rtc::TimeMillis();
if (next_run_time_ms_ < now_ms) { if (next_run_time_ms_ < now_ms) {
int skipped_frames = 1 + (now_ms - next_run_time_ms_) / interval_ms;
next_run_time_ms_ += skipped_frames * interval_ms;
RTC_LOG(LS_ERROR) << "Frame Generator Capturer can't keep up with " RTC_LOG(LS_ERROR) << "Frame Generator Capturer can't keep up with "
"requested fps, skipped " "requested fps.";
<< skipped_frames << " frame(s)."; rtc::TaskQueue::Current()->PostTask(absl::WrapUnique(this));
} } else {
int64_t delay_ms = next_run_time_ms_ - now_ms; int64_t delay_ms = next_run_time_ms_ - now_ms;
RTC_DCHECK_GE(delay_ms, 0); RTC_DCHECK_GE(delay_ms, 0);
RTC_DCHECK_LE(delay_ms, interval_ms); RTC_DCHECK_LE(delay_ms, interval_ms);
rtc::TaskQueue::Current()->PostDelayedTask(absl::WrapUnique(this), rtc::TaskQueue::Current()->PostDelayedTask(absl::WrapUnique(this),
delay_ms); delay_ms);
}
return false; return false;
} }