Index: content/common/gpu/media/v4l2_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
index 3deddf07105a6aefae69a934681d3d9e8752cc0c..57a579dd9e08c1e32598f817fb413e16d1d48bbf 100644 |
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
@@ -215,6 +215,11 @@ bool V4L2VideoDecodeAccelerator::Initialize(const Config& config, |
return false; |
} |
+ if (config.output_mode != Config::OutputMode::ALLOCATE) { |
+ NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; |
+ return false; |
+ } |
+ |
if (!device_->SupportsDecodeProfileForV4L2PixelFormats( |
config.profile, arraysize(supported_input_fourccs_), |
supported_input_fourccs_)) { |
@@ -374,13 +379,21 @@ void V4L2VideoDecodeAccelerator::AssignPictureBuffers( |
DCHECK_EQ(output_record.picture_id, -1); |
DCHECK_EQ(output_record.cleared, false); |
+ std::vector<base::ScopedFD> dmabuf_fds; |
+ dmabuf_fds = device_->GetDmabufsForV4L2Buffer( |
+ i, output_planes_count_, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); |
+ if (dmabuf_fds.empty()) { |
+ NOTIFY_ERROR(PLATFORM_FAILURE); |
+ return; |
+ } |
+ |
EGLImageKHR egl_image = device_->CreateEGLImage(egl_display_, |
gl_context->GetHandle(), |
buffers[i].texture_id(), |
coded_size_, |
i, |
output_format_fourcc_, |
- output_planes_count_); |
+ dmabuf_fds); |
if (egl_image == EGL_NO_IMAGE_KHR) { |
LOG(ERROR) << "AssignPictureBuffers(): could not create EGLImageKHR"; |
// Ownership of EGLImages allocated in previous iterations of this loop |