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

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

Issue 137023008: Add support for Tegra V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 285c96b0f8b6cde259b9c4876c5e5bf9531cbebf..ed5d218d16102f37987c1f19580f764e00c5e6b8 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
@@ -370,16 +370,14 @@ void V4L2VideoDecodeAccelerator::AssignPictureBuffers(
attrs[13] = output_record.fds[1];
attrs[15] = 0;
attrs[17] = frame_buffer_size_.width();
- EGLImageKHR egl_image = eglCreateImageKHR(
- egl_display_, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attrs);
+ EGLImageKHR egl_image = device_->CreateEGLImage(
+ egl_display_, attrs, buffers[i].texture_id(), i);
if (egl_image == EGL_NO_IMAGE_KHR) {
DLOG(ERROR) << "AssignPictureBuffers(): could not create EGLImageKHR";
Ami GONE FROM CHROMIUM 2014/02/07 09:09:30 already logged in the Device method; unnecessary
NOTIFY_ERROR(PLATFORM_FAILURE);
return;
}
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, buffers[i].texture_id());
- glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, egl_image);
Pawel Osciak 2014/02/10 06:36:17 I would like to understand the big picture here pl
shivdasp 2014/02/10 13:31:17 The decoder's output buffers are created when REQB
Pawel Osciak 2014/02/12 09:15:13 By decoder do you mean V4L2VDA class?
shivdasp 2014/02/12 10:11:55 No I meant the decoder entity within the library.
Pawel Osciak 2014/02/13 10:42:54 So the YUV buffers are tied to the textures someho
shivdasp 2014/02/14 03:06:45 We send texture_id to eglCreateImageKHR and bind i
Pawel Osciak 2014/02/14 07:36:10 Wait, where do you send texture_id to eglCreateIma
shivdasp 2014/02/14 09:18:58 The texture_id is sent in eglCreateImageKHR parame
picture_buffers_ref->picture_buffers.push_back(
PictureBufferArrayRef::PictureBufferRef(egl_image, buffers[i].id()));
}
@@ -1640,7 +1638,8 @@ bool V4L2VideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
*again = false;
memset(format, 0, sizeof(*format));
format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- if (HANDLE_EINTR(device_->Ioctl(VIDIOC_G_FMT, format)) != 0) {
+
+ if (HANDLE_EINTR(device_->Ioctl(VIDIOC_G_FMT, format) != 0)) {
Ami GONE FROM CHROMIUM 2014/02/07 09:09:30 This is a bug!
if (errno == EINVAL) {
// EINVAL means we haven't seen sufficient stream to decode the format.
*again = true;
@@ -1652,6 +1651,11 @@ bool V4L2VideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
}
}
+ // Since the underlying library at the moment is not updated this hack
Ami GONE FROM CHROMIUM 2014/02/07 09:09:30 This comment is opaque to me. Also, if something i
Pawel Osciak 2014/02/10 06:36:17 Could this hack be moved into the library itself t
shivdasp 2014/02/10 13:31:17 Apologies. This code was not meant to be here. Wil
+ LOG(ERROR) << "Hardcoding the values here ";
+ format->fmt.pix_mp.num_planes = 2;
+ format->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12M;
+
return true;
}
@@ -1785,7 +1789,7 @@ bool V4L2VideoDecodeAccelerator::CreateOutputBuffers() {
client_,
output_buffer_map_.size(),
frame_buffer_size_,
- GL_TEXTURE_EXTERNAL_OES));
+ device_->GetTextureTarget()));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698