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

Unified Diff: content/common/gpu/media/tegra_v4l2_device.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/tegra_v4l2_device.cc
diff --git a/content/common/gpu/media/tegra_v4l2_device.cc b/content/common/gpu/media/tegra_v4l2_device.cc
index 003c14246c36fd3e2460051ba87854f6cc127722..5be688907a908922a53c2f8233672b911b2edee1 100644
--- a/content/common/gpu/media/tegra_v4l2_device.cc
+++ b/content/common/gpu/media/tegra_v4l2_device.cc
@@ -172,17 +172,31 @@ bool TegraV4L2Device::Initialize() {
return true;
}
+std::vector<base::ScopedFD> TegraV4L2Device::GetDmabufsForV4L2Buffer(
+ int index,
kcwu 2016/03/22 05:42:54 /* index */ and /* type */
Pawel Osciak 2016/03/28 01:31:28 Done.
+ size_t num_planes,
+ enum v4l2_buf_type type) {
+ std::vector<base::ScopedFD> dmabuf_fds;
+ // Tegra does not actually provide dmabuf fds currently. Fill the vector with
+ // invalid descriptors to prevent the caller from failing on an empty vector
+ // being returned. TegraV4L2Device::CreateEGLImage() will ignore the invalid
+ // descriptors and create images based on V4L2 index passed to it.
+ dmabuf_fds.resize(num_planes);
+ return dmabuf_fds;
+}
+
bool TegraV4L2Device::CanCreateEGLImageFrom(uint32_t v4l2_pixfmt) {
return v4l2_pixfmt == V4L2_PIX_FMT_NV12M;
}
-EGLImageKHR TegraV4L2Device::CreateEGLImage(EGLDisplay egl_display,
- EGLContext egl_context,
- GLuint texture_id,
- gfx::Size /* frame_buffer_size */,
- unsigned int buffer_index,
- uint32_t v4l2_pixfmt,
- size_t /* num_v4l2_planes */) {
+EGLImageKHR TegraV4L2Device::CreateEGLImage(
+ EGLDisplay egl_display,
+ EGLContext egl_context,
+ GLuint texture_id,
+ const gfx::Size& /* size */,
+ unsigned int buffer_index,
+ uint32_t v4l2_pixfmt,
+ const std::vector<base::ScopedFD>& /* dmabuf_fds */) {
DVLOG(3) << "CreateEGLImage()";
if (!CanCreateEGLImageFrom(v4l2_pixfmt)) {
LOG(ERROR) << "Unsupported V4L2 pixel format";

Powered by Google App Engine
This is Rietveld 408576698