Commit d6b5ecbe authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2svda: pass the actual visible size to CreateGLImageFor()

http://crrev.com/c/2026852 fixed a race condition when passing the
visible size of the buffers we import into GL. However since I cannot do
a proper copy/paste, the new code calls decoder_->GetPicSize() instead
of the original decoder_->GetVisibleRect().size(). This results in a
size larger than expected sometimes being passed to CreateGLImageFor(),
and an EGL_BAD_ALLOC failure happening, leaving the video area entirely
black.

Fix this by using decoder_->GetVisibleRect().size() as it should have
been in the original CL.

BUG=b:149067939
BUG=b:148421581
TEST=Youtube video resolution switch on Krane without black screen.
TEST=tast run video.Seek.switch_* on kevin64
TEST=tast run video.Seek.switch_h264 on krane

Change-Id: I97147421ac271143b74f267bbcb7627e607a19bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2043264
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739326}
parent 4d641118
......@@ -1585,7 +1585,8 @@ void V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask(
base::BindOnce(&V4L2SliceVideoDecodeAccelerator::CreateGLImageFor,
weak_this_, index, picture_buffer_id, std::move(handle),
iter->client_texture_id, iter->texture_id,
decoder_->GetPicSize(), *gl_image_format_fourcc_));
decoder_->GetVisibleRect().size(),
*gl_image_format_fourcc_));
}
// Buffer is now ready to be used.
......@@ -2247,7 +2248,7 @@ void V4L2SliceVideoDecodeAccelerator::FrameProcessed(
ip_buffer_index, ip_output_record.picture_id,
CreateGpuMemoryBufferHandle(frame.get()).native_pixmap_handle,
ip_output_record.client_texture_id, ip_output_record.texture_id,
decoder_->GetPicSize(), *gl_image_format_fourcc_));
decoder_->GetVisibleRect().size(), *gl_image_format_fourcc_));
}
DCHECK(!surfaces_at_ip_.empty());
......
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