Commit 87167af3 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2svda: fix GL image size

The size of the GL image is supposed to be the visible size, while the
buffer itself shall be imported with its own coded size and stride.

Before crrev.com/c/1982499, we did not pass any size information with
the buffer, so as a workaround the size was set to the coded size and
the buffer imported with its coded size into the GPU or DC, which
resulted in visible green lines on the right or lower end of the image
when coded_size != visible_size.

Now that we are importing the buffer using a NativePixmapHandle, we can
set the GL image to be the correct visible size.

BUG=b:141579960
TEST=240p h.264 video plays in Youtube web without visible green line on
Kukui.
TEST=video playback working on Kevin.

Change-Id: I870892c41197ed210c7b7455975669a3473891f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2010243
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733513}
parent 4c751358
......@@ -1381,7 +1381,6 @@ void V4L2SliceVideoDecodeAccelerator::CreateGLImageFor(
gfx::NativePixmapHandle handle,
GLuint client_texture_id,
GLuint texture_id,
const gfx::Size& size,
const Fourcc fourcc) {
DVLOGF(3) << "index=" << buffer_index;
DCHECK(child_task_runner_->BelongsToCurrentThread());
......@@ -1402,8 +1401,8 @@ void V4L2SliceVideoDecodeAccelerator::CreateGLImageFor(
V4L2Device* gl_device =
image_processor_device_ ? image_processor_device_.get() : device_.get();
scoped_refptr<gl::GLImage> gl_image =
gl_device->CreateGLImage(size, fourcc, std::move(handle));
scoped_refptr<gl::GLImage> gl_image = gl_device->CreateGLImage(
decoder_->GetVisibleRect().size(), fourcc, std::move(handle));
if (!gl_image) {
VLOGF(1) << "Could not create GLImage,"
<< " index=" << buffer_index << " texture_id=" << texture_id;
......@@ -1570,7 +1569,7 @@ void V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask(
base::BindOnce(&V4L2SliceVideoDecodeAccelerator::CreateGLImageFor,
weak_this_, index, picture_buffer_id, std::move(handle),
iter->client_texture_id, iter->texture_id,
gl_image_size_, *gl_image_format_fourcc_));
*gl_image_format_fourcc_));
}
// Buffer is now ready to be used.
......@@ -2231,7 +2230,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,
gl_image_size_, *gl_image_format_fourcc_));
*gl_image_format_fourcc_));
}
DCHECK(!surfaces_at_ip_.empty());
......
......@@ -279,7 +279,6 @@ class MEDIA_GPU_EXPORT V4L2SliceVideoDecodeAccelerator
gfx::NativePixmapHandle handle,
GLuint client_texture_id,
GLuint texture_id,
const gfx::Size& size,
const Fourcc fourcc);
// Performed on decoder_thread_ as a consequence of poll() on decoder_thread_
......
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