Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 1134113002: content/common: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS build. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
39 #include "base/process/process_handle.h" 38 #include "base/process/process_handle.h"
40 #include "base/stl_util.h" 39 #include "base/stl_util.h"
41 #include "base/strings/string_number_conversions.h" 40 #include "base/strings/string_number_conversions.h"
42 #include "base/strings/string_split.h" 41 #include "base/strings/string_split.h"
43 #include "base/strings/stringize_macros.h" 42 #include "base/strings/stringize_macros.h"
44 #include "base/strings/stringprintf.h" 43 #include "base/strings/stringprintf.h"
45 #include "base/strings/utf_string_conversions.h" 44 #include "base/strings/utf_string_conversions.h"
46 #include "base/synchronization/condition_variable.h" 45 #include "base/synchronization/condition_variable.h"
47 #include "base/synchronization/lock.h" 46 #include "base/synchronization/lock.h"
48 #include "base/synchronization/waitable_event.h" 47 #include "base/synchronization/waitable_event.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 scoped_ptr<media::VideoDecodeAccelerator> 527 scoped_ptr<media::VideoDecodeAccelerator>
529 GLRenderingVDAClient::CreateV4L2VDA() { 528 GLRenderingVDAClient::CreateV4L2VDA() {
530 scoped_ptr<media::VideoDecodeAccelerator> decoder; 529 scoped_ptr<media::VideoDecodeAccelerator> decoder;
531 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 530 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
532 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 531 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
533 if (device.get()) { 532 if (device.get()) {
534 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); 533 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
535 decoder.reset(new V4L2VideoDecodeAccelerator( 534 decoder.reset(new V4L2VideoDecodeAccelerator(
536 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 535 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
537 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), 536 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
538 weak_client, 537 weak_client, base::Bind(&DoNothingReturnTrue), device,
539 base::Bind(&DoNothingReturnTrue), 538 base::ThreadTaskRunnerHandle::Get()));
540 device,
541 base::MessageLoopProxy::current()));
542 } 539 }
543 #endif 540 #endif
544 return decoder.Pass(); 541 return decoder.Pass();
545 } 542 }
546 543
547 scoped_ptr<media::VideoDecodeAccelerator> 544 scoped_ptr<media::VideoDecodeAccelerator>
548 GLRenderingVDAClient::CreateV4L2SliceVDA() { 545 GLRenderingVDAClient::CreateV4L2SliceVDA() {
549 scoped_ptr<media::VideoDecodeAccelerator> decoder; 546 scoped_ptr<media::VideoDecodeAccelerator> decoder;
550 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 547 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
551 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 548 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
552 if (device.get()) { 549 if (device.get()) {
553 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); 550 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
554 decoder.reset(new V4L2SliceVideoDecodeAccelerator( 551 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
555 device, 552 device, static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
556 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
557 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), 553 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
558 weak_client, 554 weak_client, base::Bind(&DoNothingReturnTrue),
559 base::Bind(&DoNothingReturnTrue), 555 base::ThreadTaskRunnerHandle::Get()));
560 base::MessageLoopProxy::current()));
561 } 556 }
562 #endif 557 #endif
563 return decoder.Pass(); 558 return decoder.Pass();
564 } 559 }
565 560
566 scoped_ptr<media::VideoDecodeAccelerator> 561 scoped_ptr<media::VideoDecodeAccelerator>
567 GLRenderingVDAClient::CreateVaapiVDA() { 562 GLRenderingVDAClient::CreateVaapiVDA() {
568 scoped_ptr<media::VideoDecodeAccelerator> decoder; 563 scoped_ptr<media::VideoDecodeAccelerator> decoder;
569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 564 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
570 decoder.reset(new VaapiVideoDecodeAccelerator( 565 decoder.reset(new VaapiVideoDecodeAccelerator(
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 content::VaapiWrapper::PreSandboxInitialization(); 1637 content::VaapiWrapper::PreSandboxInitialization();
1643 #endif 1638 #endif
1644 1639
1645 content::g_env = 1640 content::g_env =
1646 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( 1641 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>(
1647 testing::AddGlobalTestEnvironment( 1642 testing::AddGlobalTestEnvironment(
1648 new content::VideoDecodeAcceleratorTestEnvironment())); 1643 new content::VideoDecodeAcceleratorTestEnvironment()));
1649 1644
1650 return RUN_ALL_TESTS(); 1645 return RUN_ALL_TESTS();
1651 } 1646 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698