Chromium Code Reviews| 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 8b89d049b9339115a642f008e93f3796be83eb12..dc263f1918d881a282c00d1116a30768feba11f3 100644 |
| --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc |
| +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc |
| @@ -34,7 +34,10 @@ |
| #include "base/files/file_util.h" |
| #include "base/format_macros.h" |
| #include "base/md5.h" |
| +#include "base/message_loop/message_loop.h" |
|
Owen Lin
2014/11/03 06:59:06
Why these header files are included now ?
llandwerlin-old
2014/11/04 16:16:28
Removing.
|
| #include "base/message_loop/message_loop_proxy.h" |
| +#include "base/message_loop/message_pump_libevent.h" |
| +#include "base/process/process.h" |
| #include "base/process/process_handle.h" |
| #include "base/stl_util.h" |
| #include "base/strings/string_number_conversions.h" |
| @@ -60,9 +63,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 |
| @@ -101,8 +101,11 @@ const base::FilePath::CharType* g_output_log = NULL; |
| // The value is set by the switch "--rendering_fps". |
| double g_rendering_fps = 60; |
| -// The value is set by the switch "--rendering_warm_up". |
| -int g_rendering_warm_up = 0; |
| +// The value is set by the switch "--rendering_warm_up". We need at |
| +// least one frame for backends like Ozone, because as opposed to the |
|
Owen Lin
2014/11/03 06:59:06
I think we should move the code into rendering hel
llandwerlin-old
2014/11/03 09:30:11
Acknowledged.
|
| +// X11 backend, the compositor has been started yet and can't provide |
| +// any information about the vsync interval. |
| +int g_rendering_warm_up = 1; |
| // Magic constants for differentiating the reasons for NotifyResetDone being |
| // called. |
| @@ -405,17 +408,15 @@ 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))); |
| + decoder_.reset( |
| + new VaapiVideoDecodeAccelerator(rendering_helper_->GetGLContext().get(), |
| + base::Bind(&DoNothingReturnTrue))); |
| #endif // OS_WIN |
| CHECK(decoder_.get()); |
| weak_decoder_factory_.reset( |
| @@ -873,11 +874,13 @@ 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. |
| + // On Ozone, the backend initializes the event system using a UI |
| + // thread. |
| options.message_loop_type = base::MessageLoop::TYPE_UI; |
| -#endif // OS_WIN |
| +#endif // OS_WIN || USE_OZONE |
| rendering_thread_.StartWithOptions(options); |
| rendering_loop_proxy_ = rendering_thread_.message_loop_proxy(); |
| @@ -1081,6 +1084,7 @@ TEST_P(VideoDecodeAcceleratorParamTest, TestSimpleDecode) { |
| helper_params.thumbnails_page_size = kThumbnailsPageSize; |
| helper_params.thumbnail_size = kThumbnailSize; |
| } |
| + helper_params.suppress_rendering = suppress_rendering; |
| // First kick off all the decoders. |
| for (size_t index = 0; index < num_concurrent_decoders; ++index) { |
| @@ -1347,6 +1351,7 @@ TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) { |
| helper_params.rendering_fps = 0; |
| helper_params.warm_up_iterations = 0; |
| helper_params.render_as_thumbnails = false; |
| + helper_params.suppress_rendering = true; |
|
Owen Lin
2014/11/03 06:59:06
rendering_fps == 0 indicates supporess_rendering.
llandwerlin-old
2014/11/03 09:30:11
Acknowledged.
|
| ClientStateNotification<ClientState>* note = |
| new ClientStateNotification<ClientState>(); |
| @@ -1438,6 +1443,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; |
| } |