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

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

Issue 839523002: V4L2VDA: Generalize EGLImage import and query driver for output formats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_video_device.cc
diff --git a/content/common/gpu/media/tegra_v4l2_video_device.cc b/content/common/gpu/media/tegra_v4l2_video_device.cc
index 991f54a76d3fdfa0dc541795df2a8a5f957d2867..8e7713e6db8c3ff650d59447d05efab128d1111e 100644
--- a/content/common/gpu/media/tegra_v4l2_video_device.cc
+++ b/content/common/gpu/media/tegra_v4l2_video_device.cc
@@ -170,13 +170,23 @@ bool TegraV4L2Device::Initialize() {
return true;
}
+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,
- size_t /* planes_count */) {
+ uint32_t v4l2_pixfmt,
+ size_t /* num_v4l2_planes */) {
DVLOG(3) << "CreateEGLImage()";
+ if (!CanCreateEGLImageFrom(v4l2_pixfmt)) {
+ LOG(ERROR) << "Unsupported V4L2 pixel format";
+ return EGL_NO_IMAGE_KHR;
+ }
+
EGLint attr = EGL_NONE;
EGLImageKHR egl_image =
eglCreateImageKHR(egl_display,
@@ -210,11 +220,4 @@ uint32 TegraV4L2Device::PreferredInputFormat() {
return V4L2_PIX_FMT_YUV420M;
}
-uint32 TegraV4L2Device::PreferredOutputFormat() {
- // TODO(posciak): We should support "dontcare" returns here once we
- // implement proper handling (fallback, negotiation) for this in users.
- CHECK_EQ(type_, kDecoder);
- return V4L2_PIX_FMT_NV12M;
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698