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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "ui/gfx/codec/png_codec.h" | 52 #include "ui/gfx/codec/png_codec.h" |
53 | 53 |
54 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
55 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 55 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
56 #elif defined(OS_CHROMEOS) | 56 #elif defined(OS_CHROMEOS) |
57 #if defined(ARCH_CPU_ARMEL) | 57 #if defined(ARCH_CPU_ARMEL) |
58 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" | 58 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
59 #elif defined(ARCH_CPU_X86_FAMILY) | 59 #elif defined(ARCH_CPU_X86_FAMILY) |
60 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 60 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
61 #include "content/common/gpu/media/vaapi_wrapper.h" | 61 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 62 #if defined(USE_X11) |
| 63 #include "ui/gl/gl_implementation.h" |
| 64 #endif // USE_X11 |
62 #endif // ARCH_CPU_ARMEL | 65 #endif // ARCH_CPU_ARMEL |
63 #else | 66 #else |
64 #error The VideoAccelerator tests are not supported on this platform. | 67 #error The VideoAccelerator tests are not supported on this platform. |
65 #endif // OS_WIN | 68 #endif // OS_WIN |
66 | 69 |
67 using media::VideoDecodeAccelerator; | 70 using media::VideoDecodeAccelerator; |
68 | 71 |
69 namespace content { | 72 namespace content { |
70 namespace { | 73 namespace { |
71 | 74 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); | 549 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); |
547 #elif defined(OS_CHROMEOS) | 550 #elif defined(OS_CHROMEOS) |
548 #if defined(ARCH_CPU_ARMEL) | 551 #if defined(ARCH_CPU_ARMEL) |
549 decoder_.reset(new ExynosVideoDecodeAccelerator( | 552 decoder_.reset(new ExynosVideoDecodeAccelerator( |
550 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 553 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
551 client, | 554 client, |
552 weak_client, | 555 weak_client, |
553 base::Bind(&DoNothingReturnTrue), | 556 base::Bind(&DoNothingReturnTrue), |
554 base::MessageLoopProxy::current())); | 557 base::MessageLoopProxy::current())); |
555 #elif defined(ARCH_CPU_X86_FAMILY) | 558 #elif defined(ARCH_CPU_X86_FAMILY) |
| 559 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) |
| 560 << "Hardware video decode does not work with OSMesa"; |
556 decoder_.reset(new VaapiVideoDecodeAccelerator( | 561 decoder_.reset(new VaapiVideoDecodeAccelerator( |
557 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 562 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
558 client, | 563 client, |
559 base::Bind(&DoNothingReturnTrue))); | 564 base::Bind(&DoNothingReturnTrue))); |
560 #endif // ARCH_CPU_ARMEL | 565 #endif // ARCH_CPU_ARMEL |
561 #endif // OS_WIN | 566 #endif // OS_WIN |
562 CHECK(decoder_.get()); | 567 CHECK(decoder_.get()); |
563 SetState(CS_DECODER_SET); | 568 SetState(CS_DECODER_SET); |
564 if (decoder_deleted()) | 569 if (decoder_deleted()) |
565 return; | 570 return; |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 } | 1519 } |
1515 if (it->first == "v" || it->first == "vmodule") | 1520 if (it->first == "v" || it->first == "vmodule") |
1516 continue; | 1521 continue; |
1517 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1522 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1518 } | 1523 } |
1519 | 1524 |
1520 base::ShadowingAtExitManager at_exit_manager; | 1525 base::ShadowingAtExitManager at_exit_manager; |
1521 | 1526 |
1522 return RUN_ALL_TESTS(); | 1527 return RUN_ALL_TESTS(); |
1523 } | 1528 } |
OLD | NEW |