Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: content/common/gpu/media/v4l2_video_decode_accelerator.cc

Issue 1822983002: Support external buffer import in VDA interface and add a V4L2SVDA impl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698