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

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

Issue 2684993005: (NotForReview) Enable YUV video overlay on Skylake ChromeOS.
Patch Set: rebase to ToT (Mar/27) Created 3 years, 9 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/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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698