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

Unified Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 2648633005: cros: Support YUYV format for GPU memory buffer video frames
Patch Set: Enable YUYV GPU memory buffer video frames Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_gpu_video_accelerator_factories.cc
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
index 9ba79d4aa0e5a095c48cca0e87caced04f0330e0..1fc02dd2da8721502aab33d1b34f38d25fdb8c55 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
@@ -17,6 +17,7 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/ipc/client/gpu_channel_host.h"
+#include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "media/gpu/gpu_video_accelerator_util.h"
#include "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h"
#include "media/gpu/ipc/client/gpu_video_encode_accelerator_host.h"
@@ -275,8 +276,21 @@ RendererGpuVideoAcceleratorFactories::VideoFrameOutputFormat() {
auto capabilities = context_provider_->ContextCapabilities();
if (capabilities.image_ycbcr_420v)
return media::GpuVideoAcceleratorFactories::OutputFormat::NV12_SINGLE_GMB;
- if (capabilities.image_ycbcr_422)
+ if (capabilities.image_ycbcr_422) {
+#if defined(OS_MACOSX)
+ // Mac supports UYVY IOSurface.
return media::GpuVideoAcceleratorFactories::OutputFormat::UYVY;
+#elif defined(OS_CHROMEOS)
+ // Native GPU memory buffers are required.
+ if (gpu::IsNativeGpuMemoryBufferConfigurationSupported(
+ gfx::BufferFormat::YUYV_422,
+ gfx::BufferUsage::GPU_READ_CPU_READ_WRITE)) {
+ // Ozone supports YUYV NativePixmap.
+ return media::GpuVideoAcceleratorFactories::OutputFormat::YUYV;
+ }
+#endif
+ }
+
if (capabilities.texture_rg)
return media::GpuVideoAcceleratorFactories::OutputFormat::NV12_DUAL_GMB;
return media::GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED;
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698