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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc

Issue 1316493004: Add support for converting I420 software frames into NV12 hardware frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snapshot
Patch Set: Created 5 years, 4 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/gpu_memory_buffer_factory_io_surface.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
index 23412e59ac9d451ef6decd648093471f87816b13..585beb3e67b228c96af167acc72b5695ce416adf 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
@@ -32,6 +32,10 @@ int32 BytesPerElement(gfx::BufferFormat format, int plane) {
case gfx::BufferFormat::BGRA_8888:
DCHECK_EQ(plane, 0);
return 4;
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ static int32 bytes_per_element[] = {1, 2};
+ DCHECK_LT(static_cast<size_t>(plane), arraysize(bytes_per_element));
+ return bytes_per_element[plane];
case gfx::BufferFormat::UYVY_422:
DCHECK_EQ(plane, 0);
return 2;
@@ -58,6 +62,8 @@ int32 PixelFormat(gfx::BufferFormat format) {
return 'L008';
case gfx::BufferFormat::BGRA_8888:
return 'BGRA';
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ return '420v';
case gfx::BufferFormat::UYVY_422:
return '2vuy';
case gfx::BufferFormat::ATC:
@@ -85,6 +91,8 @@ const GpuMemoryBufferFactory::Configuration kSupportedConfigurations[] = {
{gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP},
{gfx::BufferFormat::UYVY_422, gfx::BufferUsage::MAP},
{gfx::BufferFormat::UYVY_422, gfx::BufferUsage::PERSISTENT_MAP},
+ {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::MAP},
+ {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::PERSISTENT_MAP},
};
} // namespace
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc ('k') | gpu/command_buffer/service/image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698