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

Unified Diff: ui/ozone/gl/gl_image_ozone_native_pixmap.cc

Issue 2648633005: cros: Support YUYV format for GPU memory buffer video frames
Patch Set: Created 3 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: ui/ozone/gl/gl_image_ozone_native_pixmap.cc
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
index 594a09db88a0a0a6a1602ca1d3e336af8c5f2a03..2745ee51432a513dded80f7ca3631c6783563998 100644
--- a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
+++ b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
@@ -22,6 +22,7 @@
#define DRM_FORMAT_XBGR8888 FOURCC('X', 'B', '2', '4')
#define DRM_FORMAT_YV12 FOURCC('Y', 'V', '1', '2')
#define DRM_FORMAT_NV12 FOURCC('N', 'V', '1', '2')
+#define DRM_FORMAT_YUYV FOURCC('Y', 'U', 'Y', 'V')
namespace ui {
namespace {
@@ -36,6 +37,8 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) {
return format == gfx::BufferFormat::YVU_420;
case GL_RGB_YCBCR_420V_CHROMIUM:
return format == gfx::BufferFormat::YUV_420_BIPLANAR;
+ case GL_RGB_YCBCR_422_CHROMIUM:
+ return format == gfx::BufferFormat::YUYV_422;
case GL_RGBA:
return format == gfx::BufferFormat::RGBA_8888;
case GL_BGRA_EXT:
@@ -60,6 +63,7 @@ bool ValidFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
+ case gfx::BufferFormat::YUYV_422:
return true;
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
@@ -95,6 +99,8 @@ EGLint FourCC(gfx::BufferFormat format) {
return DRM_FORMAT_YV12;
case gfx::BufferFormat::YUV_420_BIPLANAR:
return DRM_FORMAT_NV12;
+ case gfx::BufferFormat::YUYV_422:
+ return DRM_FORMAT_YUYV;
case gfx::BufferFormat::ATC:
case gfx::BufferFormat::ATCIA:
case gfx::BufferFormat::DXT1:
@@ -270,6 +276,7 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting(
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::RGBA_4444:
case gfx::BufferFormat::UYVY_422:
+ case gfx::BufferFormat::YUYV_422:
NOTREACHED();
return GL_NONE;
}

Powered by Google App Engine
This is Rietveld 408576698