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_CHROMEOS) || 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 if (!device.get()) { | 558 if (!device.get()) { |
559 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 559 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
560 return; | 560 return; |
561 } | 561 } |
562 decoder_.reset(new V4L2VideoDecodeAccelerator( | 562 decoder_.reset(new V4L2VideoDecodeAccelerator( |
563 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 563 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
564 weak_client, | 564 weak_client, |
565 base::Bind(&DoNothingReturnTrue), | 565 base::Bind(&DoNothingReturnTrue), |
566 device.Pass(), | 566 device.Pass(), |
567 base::MessageLoopProxy::current())); | 567 base::MessageLoopProxy::current())); |
568 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 568 #elif (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY
) |
569 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) | 569 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) |
570 << "Hardware video decode does not work with OSMesa"; | 570 << "Hardware video decode does not work with OSMesa"; |
571 decoder_.reset(new VaapiVideoDecodeAccelerator( | 571 decoder_.reset(new VaapiVideoDecodeAccelerator( |
572 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 572 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
573 base::Bind(&DoNothingReturnTrue))); | 573 base::Bind(&DoNothingReturnTrue))); |
574 #endif // OS_WIN | 574 #endif // OS_WIN |
575 CHECK(decoder_.get()); | 575 CHECK(decoder_.get()); |
576 weak_decoder_factory_.reset( | 576 weak_decoder_factory_.reset( |
577 new base::WeakPtrFactory<VideoDecodeAccelerator>(decoder_.get())); | 577 new base::WeakPtrFactory<VideoDecodeAccelerator>(decoder_.get())); |
578 SetState(CS_DECODER_SET); | 578 SetState(CS_DECODER_SET); |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 } | 1569 } |
1570 if (it->first == "v" || it->first == "vmodule") | 1570 if (it->first == "v" || it->first == "vmodule") |
1571 continue; | 1571 continue; |
1572 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1572 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1573 } | 1573 } |
1574 | 1574 |
1575 base::ShadowingAtExitManager at_exit_manager; | 1575 base::ShadowingAtExitManager at_exit_manager; |
1576 | 1576 |
1577 return RUN_ALL_TESTS(); | 1577 return RUN_ALL_TESTS(); |
1578 } | 1578 } |
OLD | NEW |