| 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 17 matching lines...) Expand all Loading... |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 #include "base/at_exit.h" | 30 #include "base/at_exit.h" |
| 31 #include "base/bind.h" | 31 #include "base/bind.h" |
| 32 #include "base/callback_helpers.h" | 32 #include "base/callback_helpers.h" |
| 33 #include "base/command_line.h" | 33 #include "base/command_line.h" |
| 34 #include "base/files/file.h" | 34 #include "base/files/file.h" |
| 35 #include "base/files/file_util.h" | 35 #include "base/files/file_util.h" |
| 36 #include "base/format_macros.h" | 36 #include "base/format_macros.h" |
| 37 #include "base/md5.h" | 37 #include "base/md5.h" |
| 38 #include "base/message_loop/message_loop_proxy.h" |
| 38 #include "base/process/process_handle.h" | 39 #include "base/process/process_handle.h" |
| 39 #include "base/stl_util.h" | 40 #include "base/stl_util.h" |
| 40 #include "base/strings/string_number_conversions.h" | 41 #include "base/strings/string_number_conversions.h" |
| 41 #include "base/strings/string_split.h" | 42 #include "base/strings/string_split.h" |
| 42 #include "base/strings/stringize_macros.h" | 43 #include "base/strings/stringize_macros.h" |
| 43 #include "base/strings/stringprintf.h" | 44 #include "base/strings/stringprintf.h" |
| 44 #include "base/strings/utf_string_conversions.h" | 45 #include "base/strings/utf_string_conversions.h" |
| 45 #include "base/synchronization/condition_variable.h" | 46 #include "base/synchronization/condition_variable.h" |
| 46 #include "base/synchronization/lock.h" | 47 #include "base/synchronization/lock.h" |
| 47 #include "base/synchronization/waitable_event.h" | 48 #include "base/synchronization/waitable_event.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 scoped_ptr<media::VideoDecodeAccelerator> | 528 scoped_ptr<media::VideoDecodeAccelerator> |
| 528 GLRenderingVDAClient::CreateV4L2VDA() { | 529 GLRenderingVDAClient::CreateV4L2VDA() { |
| 529 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 530 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 530 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) | 531 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
| 531 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 532 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
| 532 if (device.get()) { | 533 if (device.get()) { |
| 533 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 534 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
| 534 decoder.reset(new V4L2VideoDecodeAccelerator( | 535 decoder.reset(new V4L2VideoDecodeAccelerator( |
| 535 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 536 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 536 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 537 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
| 537 weak_client, base::Bind(&DoNothingReturnTrue), device, | 538 weak_client, |
| 538 base::ThreadTaskRunnerHandle::Get())); | 539 base::Bind(&DoNothingReturnTrue), |
| 540 device, |
| 541 base::MessageLoopProxy::current())); |
| 539 } | 542 } |
| 540 #endif | 543 #endif |
| 541 return decoder.Pass(); | 544 return decoder.Pass(); |
| 542 } | 545 } |
| 543 | 546 |
| 544 scoped_ptr<media::VideoDecodeAccelerator> | 547 scoped_ptr<media::VideoDecodeAccelerator> |
| 545 GLRenderingVDAClient::CreateV4L2SliceVDA() { | 548 GLRenderingVDAClient::CreateV4L2SliceVDA() { |
| 546 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 549 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 547 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) | 550 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
| 548 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 551 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
| 549 if (device.get()) { | 552 if (device.get()) { |
| 550 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 553 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
| 551 decoder.reset(new V4L2SliceVideoDecodeAccelerator( | 554 decoder.reset(new V4L2SliceVideoDecodeAccelerator( |
| 552 device, static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 555 device, |
| 556 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 553 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 557 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
| 554 weak_client, base::Bind(&DoNothingReturnTrue), | 558 weak_client, |
| 555 base::ThreadTaskRunnerHandle::Get())); | 559 base::Bind(&DoNothingReturnTrue), |
| 560 base::MessageLoopProxy::current())); |
| 556 } | 561 } |
| 557 #endif | 562 #endif |
| 558 return decoder.Pass(); | 563 return decoder.Pass(); |
| 559 } | 564 } |
| 560 | 565 |
| 561 scoped_ptr<media::VideoDecodeAccelerator> | 566 scoped_ptr<media::VideoDecodeAccelerator> |
| 562 GLRenderingVDAClient::CreateVaapiVDA() { | 567 GLRenderingVDAClient::CreateVaapiVDA() { |
| 563 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 568 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 564 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 565 decoder.reset(new VaapiVideoDecodeAccelerator( | 570 decoder.reset(new VaapiVideoDecodeAccelerator( |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 content::VaapiWrapper::PreSandboxInitialization(); | 1642 content::VaapiWrapper::PreSandboxInitialization(); |
| 1638 #endif | 1643 #endif |
| 1639 | 1644 |
| 1640 content::g_env = | 1645 content::g_env = |
| 1641 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1646 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
| 1642 testing::AddGlobalTestEnvironment( | 1647 testing::AddGlobalTestEnvironment( |
| 1643 new content::VideoDecodeAcceleratorTestEnvironment())); | 1648 new content::VideoDecodeAcceleratorTestEnvironment())); |
| 1644 | 1649 |
| 1645 return RUN_ALL_TESTS(); | 1650 return RUN_ALL_TESTS(); |
| 1646 } | 1651 } |
| OLD | NEW |