| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "base/synchronization/waitable_event.h" | 47 #include "base/synchronization/waitable_event.h" |
| 48 #include "base/threading/thread.h" | 48 #include "base/threading/thread.h" |
| 49 #include "content/common/gpu/media/rendering_helper.h" | 49 #include "content/common/gpu/media/rendering_helper.h" |
| 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) | 57 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 58 #if defined(ARCH_CPU_ARMEL) | |
| 59 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 58 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
| 60 #include "content/common/gpu/media/v4l2_video_device.h" | 59 #include "content/common/gpu/media/v4l2_video_device.h" |
| 61 #elif defined(ARCH_CPU_X86_FAMILY) | 60 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 62 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 61 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 63 #include "content/common/gpu/media/vaapi_wrapper.h" | 62 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 64 #if defined(USE_X11) | 63 #if defined(USE_X11) |
| 65 #include "ui/gl/gl_implementation.h" | 64 #include "ui/gl/gl_implementation.h" |
| 66 #endif // USE_X11 | 65 #endif // USE_X11 |
| 67 #endif // ARCH_CPU_ARMEL | |
| 68 #else | 66 #else |
| 69 #error The VideoAccelerator tests are not supported on this platform. | 67 #error The VideoAccelerator tests are not supported on this platform. |
| 70 #endif // OS_WIN | 68 #endif // OS_WIN |
| 71 | 69 |
| 72 using media::VideoDecodeAccelerator; | 70 using media::VideoDecodeAccelerator; |
| 73 | 71 |
| 74 namespace content { | 72 namespace content { |
| 75 namespace { | 73 namespace { |
| 76 | 74 |
| 77 // Values optionally filled in from flags; see main() below. | 75 // Values optionally filled in from flags; see main() below. |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 547 |
| 550 VideoDecodeAccelerator::Client* client = this; | 548 VideoDecodeAccelerator::Client* client = this; |
| 551 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 549 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
| 552 if (throttling_client_) { | 550 if (throttling_client_) { |
| 553 client = throttling_client_.get(); | 551 client = throttling_client_.get(); |
| 554 weak_client = throttling_client_->AsWeakPtr(); | 552 weak_client = throttling_client_->AsWeakPtr(); |
| 555 } | 553 } |
| 556 #if defined(OS_WIN) | 554 #if defined(OS_WIN) |
| 557 decoder_.reset( | 555 decoder_.reset( |
| 558 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); | 556 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); |
| 559 #elif defined(OS_CHROMEOS) | 557 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 560 #if defined(ARCH_CPU_ARMEL) | |
| 561 | 558 |
| 562 scoped_ptr<V4L2Device> device = V4L2Device::Create(); | 559 scoped_ptr<V4L2Device> device = V4L2Device::Create(); |
| 563 if (!device.get()) { | 560 if (!device.get()) { |
| 564 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 561 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 565 return; | 562 return; |
| 566 } | 563 } |
| 567 decoder_.reset(new V4L2VideoDecodeAccelerator( | 564 decoder_.reset(new V4L2VideoDecodeAccelerator( |
| 568 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 565 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 569 weak_client, | 566 weak_client, |
| 570 base::Bind(&DoNothingReturnTrue), | 567 base::Bind(&DoNothingReturnTrue), |
| 571 device.Pass(), | 568 device.Pass(), |
| 572 base::MessageLoopProxy::current())); | 569 base::MessageLoopProxy::current())); |
| 573 #elif defined(ARCH_CPU_X86_FAMILY) | 570 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 574 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) | 571 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) |
| 575 << "Hardware video decode does not work with OSMesa"; | 572 << "Hardware video decode does not work with OSMesa"; |
| 576 decoder_.reset(new VaapiVideoDecodeAccelerator( | 573 decoder_.reset(new VaapiVideoDecodeAccelerator( |
| 577 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 574 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
| 578 base::Bind(&DoNothingReturnTrue))); | 575 base::Bind(&DoNothingReturnTrue))); |
| 579 #endif // ARCH_CPU_ARMEL | |
| 580 #endif // OS_WIN | 576 #endif // OS_WIN |
| 581 CHECK(decoder_.get()); | 577 CHECK(decoder_.get()); |
| 582 SetState(CS_DECODER_SET); | 578 SetState(CS_DECODER_SET); |
| 583 if (decoder_deleted()) | 579 if (decoder_deleted()) |
| 584 return; | 580 return; |
| 585 | 581 |
| 586 CHECK(decoder_->Initialize(profile_, client)); | 582 CHECK(decoder_->Initialize(profile_, client)); |
| 587 } | 583 } |
| 588 | 584 |
| 589 void GLRenderingVDAClient::ProvidePictureBuffers( | 585 void GLRenderingVDAClient::ProvidePictureBuffers( |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 } | 1570 } |
| 1575 if (it->first == "v" || it->first == "vmodule") | 1571 if (it->first == "v" || it->first == "vmodule") |
| 1576 continue; | 1572 continue; |
| 1577 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1573 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
| 1578 } | 1574 } |
| 1579 | 1575 |
| 1580 base::ShadowingAtExitManager at_exit_manager; | 1576 base::ShadowingAtExitManager at_exit_manager; |
| 1581 | 1577 |
| 1582 return RUN_ALL_TESTS(); | 1578 return RUN_ALL_TESTS(); |
| 1583 } | 1579 } |
| OLD | NEW |