| Index: content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| index 127378ab0856d78ca2f6438f75b4c8f099fb4fbc..a9a166f48cbdcbbad698de597aa87e13b8bc66da 100644
|
| --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
|
| @@ -34,7 +34,9 @@
|
| #include "base/files/file.h"
|
| #include "base/format_macros.h"
|
| #include "base/md5.h"
|
| +#include "base/message_loop/message_loop.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| +#include "base/message_loop/message_pump_libevent.h"
|
| #include "base/process/process.h"
|
| #include "base/stl_util.h"
|
| #include "base/strings/string_number_conversions.h"
|
| @@ -60,9 +62,6 @@
|
| #elif defined(OS_CHROMEOS) && 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
|
| #else
|
| #error The VideoAccelerator tests are not supported on this platform.
|
| #endif // OS_WIN
|
| @@ -382,7 +381,14 @@ GLRenderingVDAClient::~GLRenderingVDAClient() {
|
| SetState(CS_DESTROYED);
|
| }
|
|
|
| +#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
|
| +static bool MakeDecoderCurrent(scoped_refptr<gfx::GLContext> context) {
|
| + context->MakeCurrent(NULL);
|
| + return true;
|
| +}
|
| +#else
|
| static bool DoNothingReturnTrue() { return true; }
|
| +#endif
|
|
|
| void GLRenderingVDAClient::CreateAndStartDecoder() {
|
| CHECK(decoder_deleted());
|
| @@ -402,17 +408,16 @@ void GLRenderingVDAClient::CreateAndStartDecoder() {
|
| }
|
| decoder_.reset(new V4L2VideoDecodeAccelerator(
|
| static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
|
| - static_cast<EGLContext>(rendering_helper_->GetGLContext()),
|
| + static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
|
| weak_client,
|
| base::Bind(&DoNothingReturnTrue),
|
| device.Pass(),
|
| base::MessageLoopProxy::current()));
|
| #elif defined(OS_CHROMEOS) && 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()),
|
| - base::Bind(&DoNothingReturnTrue)));
|
| + rendering_helper_->GetGLContext(),
|
| + base::Bind(&MakeDecoderCurrent,
|
| + rendering_helper_->GetGLContext())));
|
| #endif // OS_WIN
|
| CHECK(decoder_.get());
|
| weak_decoder_factory_.reset(
|
| @@ -870,7 +875,7 @@ void VideoDecodeAcceleratorTest::SetUp() {
|
| // Initialize the rendering thread.
|
| base::Thread::Options options;
|
| options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
|
| -#if defined(OS_WIN)
|
| +#if defined(OS_WIN) || defined (USE_OZONE)
|
| // For windows the decoding thread initializes the media foundation decoder
|
| // which uses COM. We need the thread to be a UI thread.
|
| options.message_loop_type = base::MessageLoop::TYPE_UI;
|
| @@ -1428,6 +1433,8 @@ int main(int argc, char **argv) {
|
| }
|
| if (it->first == "v" || it->first == "vmodule")
|
| continue;
|
| + if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless")
|
| + continue;
|
| LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
|
| }
|
|
|
|
|