diff options
5 files changed, 22 insertions, 12 deletions
diff --git a/chrome/browser/media/chrome_webrtc_browsertest.cc b/chrome/browser/media/chrome_webrtc_browsertest.cc index b6a89be..4b774f0 100644 --- a/chrome/browser/media/chrome_webrtc_browsertest.cc +++ b/chrome/browser/media/chrome_webrtc_browsertest.cc @@ -53,9 +53,6 @@ class WebrtcBrowserTest : public WebRtcTestBase { EXPECT_FALSE(command_line->HasSwitch( switches::kUseFakeUIForMediaStream)); - // The video playback will not work without a GPU, so force its use here. - command_line->AppendSwitch(switches::kUseGpuInTests); - // Flag used by TestWebAudioMediaStream to force garbage collection. command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); } diff --git a/content/browser/media/webrtc_aecdump_browsertest.cc b/content/browser/media/webrtc_aecdump_browsertest.cc index f65b1a4..cf98c4b 100644 --- a/content/browser/media/webrtc_aecdump_browsertest.cc +++ b/content/browser/media/webrtc_aecdump_browsertest.cc @@ -27,6 +27,9 @@ class WebrtcAecDumpBrowserTest : public ContentBrowserTest { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(CreateTemporaryFileInDir(temp_dir_.path(), &dump_file_)); + // These tests expect pixel output. + UseRealGLContexts(); + ContentBrowserTest::SetUp(); } @@ -38,10 +41,6 @@ class WebrtcAecDumpBrowserTest : public ContentBrowserTest { ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( switches::kUseFakeUIForMediaStream)); - // The video playback will not work without a GPU, so force its use here. - // This may not be available on all VMs though. - command_line->AppendSwitch(switches::kUseGpuInTests); - // Enable AEC dump with the command line flag. command_line->AppendSwitchPath(switches::kEnableWebRtcAecRecordings, dump_file_); diff --git a/content/browser/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc index 77e1afb..0ed0be4 100644 --- a/content/browser/media/webrtc_browsertest.cc +++ b/content/browser/media/webrtc_browsertest.cc @@ -88,6 +88,12 @@ class WebrtcBrowserTest: public ContentBrowserTest { WebrtcBrowserTest() {} virtual ~WebrtcBrowserTest() {} + virtual void SetUp() OVERRIDE { + // These tests require pixel output. + UseRealGLContexts(); + ContentBrowserTest::SetUp(); + } + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { // We need fake devices in this test since we want to run on naked VMs. We // assume these switches are set by default in content_browsertests. @@ -95,10 +101,6 @@ class WebrtcBrowserTest: public ContentBrowserTest { switches::kUseFakeDeviceForMediaStream)); ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( switches::kUseFakeUIForMediaStream)); - - // The video playback will not work without a GPU, so force its use here. - // This may not be available on all VMs though. - command_line->AppendSwitch(switches::kUseGpuInTests); } void DumpChromeTraceCallback( diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index 86b90ef..c3e5fae 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc @@ -28,8 +28,9 @@ #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) -#include "ui/gl/gl_context_glx.h" #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" +#include "ui/gl/gl_context_glx.h" +#include "ui/gl/gl_implementation.h" #elif defined(OS_ANDROID) #include "content/common/gpu/media/android_video_decode_accelerator.h" #endif @@ -278,6 +279,12 @@ void GpuVideoDecodeAccelerator::Initialize( make_context_current_, io_message_loop_)); #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) + if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { + VLOG(1) << "HW video decode acceleration not available without " + "DesktopGL (GLX)."; + NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); + return; + } gfx::GLContextGLX* glx_context = static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc index 4c7f764..cde011d 100644 --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc @@ -59,6 +59,9 @@ #elif defined(ARCH_CPU_X86_FAMILY) #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" #include "content/common/gpu/media/vaapi_wrapper.h" +#if defined(USE_X11) +#include "ui/gl/gl_implementation.h" +#endif // USE_X11 #endif // ARCH_CPU_ARMEL #else #error The VideoAccelerator tests are not supported on this platform. @@ -553,6 +556,8 @@ void GLRenderingVDAClient::CreateAndStartDecoder() { base::Bind(&DoNothingReturnTrue), base::MessageLoopProxy::current())); #elif defined(ARCH_CPU_X86_FAMILY) + CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) + << "Hardware video decode does not work with OSMesa"; decoder_.reset(new VaapiVideoDecodeAccelerator( static_cast<Display*>(rendering_helper_->GetGLDisplay()), client, |