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