Handle visible_rect in V4L2/VAAPI VDAs when origin != (0, 0).
This CL modifies the V4L2 and VAAPI video decode accelerators to handle the case where the visible rectangle is not (0, 0). This can happen with some H.264 videos. The solution is to make sure that when we create the GL image for a frame, the size should include the visible rectangle plus the non-visible area to the left and on the top of that rectangle. This way, the compositor can calculate the UV coordinates correctly so that we can sample only the visible rectangle. V4L2VideoDecodeAccelerator is unchanged. The reason is that the assumption that the visible rectangle starts at (0, 0) will be harder to remove there. We currently have a check that deals with that case [1]. CL:2041712 + (CL:2122484 + this) make it possible to handle exotic visible rectangles in most Chrome OS devices (the ones that use V4L2VideoDecodeAccelerator still need work). [2] contains before/after tests for this CL for a variety of devices (where before is 822a983f minus CL:2122484). [1] https://cs.chromium.org/chromium/src/media/gpu/v4l2/v4l2_video_decode_accelerator.cc?l=2272-2277&rcl=10aaea0473eb652966b359c2b751974b97c5ab13 [2] https://drive.google.com/open?id=1wtX7jDkzvIxCMmsQlIV7zjwaWMrmikUy Bug: 1062002 Test: H.264 with unusual rect in kevin, kukui, eve, hana, nyan_kitty. Change-Id: Iac712fbf1b2cea3556b39fc38f5639c91c73b746 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128707 Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org> Reviewed-by:Dan Sanders <sandersd@chromium.org> Reviewed-by:
Alexandre Courbot <acourbot@chromium.org> Cr-Commit-Position: refs/heads/master@{#755273}
Showing
Please register or sign in to comment