Commit 8c919071 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: avoid unneeded NativePixmapHandle copy

Avoid creating a NativePixmapHandle now that we have one ready to be
used. This code was a remainder from the time where we passed dmabuf FDs
to CreateGLImage().

BUG=b:146842214
TEST=E2E video playback in Chromium working on Kukui and Kevin.

Change-Id: Icf54bacc0d62d9ca74d69174227ec7a1511aa4aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2010589
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733541}
parent 56145505
......@@ -272,14 +272,6 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage(
size_t num_planes = handle.planes.size();
DCHECK_LE(num_planes, 3u);
gfx::NativePixmapHandle native_pixmap_handle;
for (size_t p = 0; p < num_planes; ++p) {
native_pixmap_handle.planes.emplace_back(
handle.planes[p].stride, handle.planes[p].offset, handle.planes[p].size,
std::move(handle.planes[p].fd));
}
gfx::BufferFormat buffer_format = gfx::BufferFormat::BGRA_8888;
switch (fourcc.ToV4L2PixFmt()) {
case DRM_FORMAT_ARGB8888:
......@@ -299,7 +291,7 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage(
ui::OzonePlatform::GetInstance()
->GetSurfaceFactoryOzone()
->CreateNativePixmapFromHandle(0, size, buffer_format,
std::move(native_pixmap_handle));
std::move(handle));
DCHECK(pixmap);
......
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