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 07cbcefca143e51afa263ebb1ec41e2c932bf992..d21c89b5df0abdda147e72faf2df6369c1713366 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_util.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) |
Pawel Osciak
2014/09/24 11:27:13
Why were we ok without this before?
Pawel Osciak
2014/10/08 08:17:21
Question still stands please.
llandwerlin-old
2014/10/13 16:53:00
Removed.
|
+static bool MakeDecoderCurrent(scoped_refptr<gfx::GLContext> context) { |
Pawel Osciak
2014/09/24 11:27:13
s/MakeDecoderCurrent/MakeContextCurrent/
Pawel Osciak
2014/10/08 08:17:21
I think MakeContextCurrent is still a better name?
llandwerlin-old
2014/10/08 09:31:17
Acknowledged.
|
+ 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; |
} |