Commit 9d901acb authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/v4l2VEA: Invoke error if the requested visible_rect is adjusted by driver

V4L2 encoder driver may need to adjust visible rectangle because of
their restrictions of hardware and firmware. If the adjusted visible
rectangle is different from the requested one, we should invoke the
error rather than processing the encoding.

Bug: 1033799
Test: video.EncodeAccel.* on scarlet
Change-Id: I686f3dc30ee325bb6020ffc87534971291602020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078522Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748520}
parent 5b3514b5
...@@ -1430,11 +1430,16 @@ bool V4L2VideoEncodeAccelerator::ApplyCrop() { ...@@ -1430,11 +1430,16 @@ bool V4L2VideoEncodeAccelerator::ApplyCrop() {
visible_rect = crop.c; visible_rect = crop.c;
} }
encoder_input_visible_rect_ = const gfx::Rect adjusted_visible_rect(visible_rect.left, visible_rect.top,
gfx::Rect(visible_rect.left, visible_rect.top, visible_rect.width, visible_rect.width,
visible_rect.height); visible_rect.height);
VLOGF(2) << "After adjusted by driver, encoder_input_visible_rect_=" if (encoder_input_visible_rect_ != adjusted_visible_rect) {
<< encoder_input_visible_rect_.ToString(); VLOGF(1) << "Unsupported visible rectangle: "
<< encoder_input_visible_rect_.ToString()
<< ", the rectangle adjusted by the driver: "
<< adjusted_visible_rect.ToString();
return false;
}
return true; return true;
} }
......
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