Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
| 6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
| 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
| 8 // Win/EGL. | 8 // Win/EGL. |
| 9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
| 10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 50 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
| 51 #include "content/public/common/content_switches.h" | 51 #include "content/public/common/content_switches.h" |
| 52 #include "media/filters/h264_parser.h" | 52 #include "media/filters/h264_parser.h" |
| 53 #include "ui/gfx/codec/png_codec.h" | 53 #include "ui/gfx/codec/png_codec.h" |
| 54 | 54 |
| 55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 56 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 56 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 57 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 57 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 58 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 58 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
| 59 #include "content/common/gpu/media/v4l2_video_device.h" | 59 #include "content/common/gpu/media/v4l2_video_device.h" |
| 60 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 60 #elif defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) |
| 61 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 61 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 62 #include "content/common/gpu/media/vaapi_wrapper.h" | 62 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 63 #if defined(USE_X11) | 63 #if defined(USE_X11) |
| 64 #include "ui/gl/gl_implementation.h" | 64 #include "ui/gl/gl_implementation.h" |
| 65 #endif // USE_X11 | 65 #endif // USE_X11 |
| 66 #else | 66 #else |
| 67 #error The VideoAccelerator tests are not supported on this platform. | 67 #error The VideoAccelerator tests are not supported on this platform. |
| 68 #endif // OS_WIN | 68 #endif // OS_WIN |
| 69 | 69 |
| 70 using media::VideoDecodeAccelerator; | 70 using media::VideoDecodeAccelerator; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 399 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 400 return; | 400 return; |
| 401 } | 401 } |
| 402 decoder_.reset(new V4L2VideoDecodeAccelerator( | 402 decoder_.reset(new V4L2VideoDecodeAccelerator( |
| 403 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 403 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 404 static_cast<EGLContext>(rendering_helper_->GetGLContext()), | 404 static_cast<EGLContext>(rendering_helper_->GetGLContext()), |
| 405 weak_client, | 405 weak_client, |
| 406 base::Bind(&DoNothingReturnTrue), | 406 base::Bind(&DoNothingReturnTrue), |
| 407 device.Pass(), | 407 device.Pass(), |
| 408 base::MessageLoopProxy::current())); | 408 base::MessageLoopProxy::current())); |
| 409 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 409 #elif defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) |
|
danakj
2014/06/19 15:56:26
and here?
dshwang
2014/06/23 18:33:20
ditto. it's not related change.
| |
| 410 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) | 410 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) |
| 411 << "Hardware video decode does not work with OSMesa"; | 411 << "Hardware video decode does not work with OSMesa"; |
| 412 decoder_.reset(new VaapiVideoDecodeAccelerator( | 412 decoder_.reset(new VaapiVideoDecodeAccelerator( |
| 413 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 413 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
| 414 base::Bind(&DoNothingReturnTrue))); | 414 base::Bind(&DoNothingReturnTrue))); |
| 415 #endif // OS_WIN | 415 #endif // OS_WIN |
| 416 CHECK(decoder_.get()); | 416 CHECK(decoder_.get()); |
| 417 weak_decoder_factory_.reset( | 417 weak_decoder_factory_.reset( |
| 418 new base::WeakPtrFactory<VideoDecodeAccelerator>(decoder_.get())); | 418 new base::WeakPtrFactory<VideoDecodeAccelerator>(decoder_.get())); |
| 419 SetState(CS_DECODER_SET); | 419 SetState(CS_DECODER_SET); |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1456 } | 1456 } |
| 1457 if (it->first == "v" || it->first == "vmodule") | 1457 if (it->first == "v" || it->first == "vmodule") |
| 1458 continue; | 1458 continue; |
| 1459 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1459 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 base::ShadowingAtExitManager at_exit_manager; | 1462 base::ShadowingAtExitManager at_exit_manager; |
| 1463 | 1463 |
| 1464 return RUN_ALL_TESTS(); | 1464 return RUN_ALL_TESTS(); |
| 1465 } | 1465 } |
| OLD | NEW |