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

Side by Side Diff: content/common/gpu/media/exynos_v4l2_video_device.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <linux/videodev2.h> 6 #include <linux/videodev2.h>
7 #include <poll.h> 7 #include <poll.h>
8 #include <sys/eventfd.h> 8 #include <sys/eventfd.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
11 11
12 #include "base/debug/trace_event.h" 12 #include "base/debug/trace_event.h"
13 #include "base/posix/eintr_wrapper.h" 13 #include "base/posix/eintr_wrapper.h"
14 #include "content/common/gpu/media/exynos_v4l2_video_device.h" 14 #include "content/common/gpu/media/exynos_v4l2_video_device.h"
15 #include "ui/gl/gl_bindings.h"
15 16
16 namespace content { 17 namespace content {
17 18
18 namespace { 19 namespace {
19 const char kDevice[] = "/dev/mfc-dec"; 20 const char kDevice[] = "/dev/mfc-dec";
20 } 21 }
21 22
22 ExynosV4L2Device::ExynosV4L2Device() 23 ExynosV4L2Device::ExynosV4L2Device()
23 : device_fd_(-1), device_poll_interrupt_fd_(-1) {} 24 : device_fd_(-1), device_poll_interrupt_fd_(-1) {}
24 25
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (device_fd_ == -1) { 108 if (device_fd_ == -1) {
108 return false; 109 return false;
109 } 110 }
110 111
111 device_poll_interrupt_fd_ = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 112 device_poll_interrupt_fd_ = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
112 if (device_poll_interrupt_fd_ == -1) { 113 if (device_poll_interrupt_fd_ == -1) {
113 return false; 114 return false;
114 } 115 }
115 return true; 116 return true;
116 } 117 }
118
119 EGLImageKHR ExynosV4L2Device::CreateEGLImage(EGLDisplay egl_display,
120 EGLint attrib[],
121 unsigned int texture_id,
122 unsigned int buffer_index) {
Ami GONE FROM CHROMIUM 2014/02/07 09:09:30 Please /* comment out */ unused params.
123 EGLImageKHR egl_image = eglCreateImageKHR(
Pawel Osciak 2014/02/10 06:36:17 We need to make GL context current to be able to c
shivdasp 2014/02/14 03:06:45 make_context_current_ is already done before calli
Pawel Osciak 2014/02/14 07:36:10 Yes, I'm just saying this method should explicitly
124 egl_display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attrib);
125 if (egl_image == EGL_NO_IMAGE_KHR) {
126 DLOG(ERROR) << "CreateEGLImage(): could not create EGLImageKHR";
127 return egl_image;
128 }
129 glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture_id);
130 glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, egl_image);
131 return egl_image;
132 }
133
134 unsigned int ExynosV4L2Device::GetTextureTarget() {
135 return GL_TEXTURE_EXTERNAL_OES;
136 }
137
117 } // namespace content 138 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698