Commit 5fb9a6ed authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

[MediaStream] Enforce max frame rates

Prior to this CL, explicit max frame rates were not enforced
if the configured frame rate for the source was less than or
equal to the requested max frame rate. This has led to problems
with webcams that produce a higher frame rate than configured.

This CL changes the VideoTrackAdapter so that frame rate
adjustments are disabled only for tracks that do not explicitly
request a maximum frame rate.

Bug: 1133796
Change-Id: I2e3769493449b552f9440c2a809b512bf9e3690c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2534952
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Auto-Submit: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarMarina Ciocea <marinaciocea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826877}
parent 22e138ff
...@@ -408,11 +408,8 @@ bool VideoTrackAdapter::VideoFrameResolutionAdapter::MaybeDropFrame( ...@@ -408,11 +408,8 @@ bool VideoTrackAdapter::VideoFrameResolutionAdapter::MaybeDropFrame(
media::VideoCaptureFrameDropReason* reason) { media::VideoCaptureFrameDropReason* reason) {
DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_);
// Do not drop frames if max frame rate hasn't been specified or the source // Do not drop frames if max frame rate hasn't been specified.
// frame rate is known and is lower than max. if (settings_.max_frame_rate() == 0.0f) {
if (settings_.max_frame_rate() == 0.0f ||
(source_frame_rate > 0 &&
source_frame_rate <= settings_.max_frame_rate())) {
last_time_stamp_ = frame.timestamp(); last_time_stamp_ = frame.timestamp();
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment