Commit 513f40d2 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/v4l2VEA: Skip invalid bitrate and framerate requests

V4L2VEA DCHECKs both bitrate and framerate are more than zero.
It depends on clients and can be false due to an issue. We
would rather checks it by if-clauses and skips if they are
invalid.

Bug: b:173420909
Test: meet.google.com on trogdor
Change-Id: I0f3776368b782c8bb2691dbc5e49ebc22cf16d1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2548583
Auto-Submit: Hirokazu Honda <hiroh@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829915}
parent 81697054
......@@ -1483,15 +1483,13 @@ void V4L2VideoEncodeAccelerator::RequestEncodingParametersChangeTask(
uint32_t framerate) {
if (current_bitrate_ == bitrate && current_framerate_ == framerate)
return;
if (bitrate == 0 || framerate == 0)
return;
VLOGF(2) << "bitrate=" << bitrate << ", framerate=" << framerate;
DCHECK_CALLED_ON_VALID_SEQUENCE(encoder_sequence_checker_);
TRACE_EVENT2("media,gpu", "V4L2VEA::RequestEncodingParametersChangeTask",
"bitrate", bitrate, "framerate", framerate);
DCHECK_GT(bitrate, 0u);
DCHECK_GT(framerate, 0u);
if (current_bitrate_ != bitrate &&
!device_->SetExtCtrls(
V4L2_CTRL_CLASS_MPEG,
......
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