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

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

Issue 11198060: VDA implementation for Exynos, using V4L2 (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Flush() path rework. Created 7 years, 11 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 22 matching lines...) Expand all
33 #include "base/stl_util.h" 33 #include "base/stl_util.h"
34 #include "base/string_number_conversions.h" 34 #include "base/string_number_conversions.h"
35 #include "base/string_split.h" 35 #include "base/string_split.h"
36 #include "base/stringize_macros.h" 36 #include "base/stringize_macros.h"
37 #include "base/synchronization/condition_variable.h" 37 #include "base/synchronization/condition_variable.h"
38 #include "base/synchronization/lock.h" 38 #include "base/synchronization/lock.h"
39 #include "base/synchronization/waitable_event.h" 39 #include "base/synchronization/waitable_event.h"
40 #include "base/threading/thread.h" 40 #include "base/threading/thread.h"
41 #include "base/utf_string_conversions.h" 41 #include "base/utf_string_conversions.h"
42 #include "content/common/gpu/media/rendering_helper.h" 42 #include "content/common/gpu/media/rendering_helper.h"
43 #include "content/public/common/content_switches.h"
43 44
44 #if defined(OS_WIN) 45 #if defined(OS_WIN)
45 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 46 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
46 #elif defined(OS_MACOSX) 47 #elif defined(OS_MACOSX)
47 #include "content/common/gpu/media/mac_video_decode_accelerator.h" 48 #include "content/common/gpu/media/mac_video_decode_accelerator.h"
48 #elif defined(ARCH_CPU_X86_FAMILY) 49 #elif defined(ARCH_CPU_X86_FAMILY)
49 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 50 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
50 #elif defined(ARCH_CPU_ARMEL) 51 #elif defined(ARCH_CPU_ARMEL)
52 #include "content/common/gpu/media/exynos_video_decode_accelerator.h"
51 #include "content/common/gpu/media/omx_video_decode_accelerator.h" 53 #include "content/common/gpu/media/omx_video_decode_accelerator.h"
52 #else 54 #else
53 #error The VideoAccelerator tests are not supported on this platform. 55 #error The VideoAccelerator tests are not supported on this platform.
54 #endif // defined(OS_WIN) 56 #endif // defined(OS_WIN)
55 57
56 using media::VideoDecodeAccelerator; 58 using media::VideoDecodeAccelerator;
57 59
58 namespace content { 60 namespace content {
59 namespace { 61 namespace {
60 62
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 void GLRenderingVDAClient::CreateDecoder() { 328 void GLRenderingVDAClient::CreateDecoder() {
327 CHECK(decoder_deleted()); 329 CHECK(decoder_deleted());
328 CHECK(!decoder_.get()); 330 CHECK(!decoder_.get());
329 #if defined(OS_WIN) 331 #if defined(OS_WIN)
330 decoder_.reset(new DXVAVideoDecodeAccelerator( 332 decoder_.reset(new DXVAVideoDecodeAccelerator(
331 this, base::Bind(&DoNothingReturnTrue))); 333 this, base::Bind(&DoNothingReturnTrue)));
332 #elif defined(OS_MACOSX) 334 #elif defined(OS_MACOSX)
333 decoder_.reset(new MacVideoDecodeAccelerator( 335 decoder_.reset(new MacVideoDecodeAccelerator(
334 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); 336 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this));
335 #elif defined(ARCH_CPU_ARMEL) 337 #elif defined(ARCH_CPU_ARMEL)
336 decoder_.reset( 338 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) {
337 new OmxVideoDecodeAccelerator( 339 decoder_.reset(
338 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 340 new ExynosVideoDecodeAccelerator(
339 static_cast<EGLContext>(rendering_helper_->GetGLContext()), 341 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
340 this, 342 static_cast<EGLContext>(rendering_helper_->GetGLContext()),
341 base::Bind(&DoNothingReturnTrue))); 343 this, base::Bind(&DoNothingReturnTrue)));
344 } else {
345 decoder_.reset(
346 new OmxVideoDecodeAccelerator(
347 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
348 static_cast<EGLContext>(rendering_helper_->GetGLContext()),
349 this, base::Bind(&DoNothingReturnTrue)));
350 }
342 #elif defined(ARCH_CPU_X86_FAMILY) 351 #elif defined(ARCH_CPU_X86_FAMILY)
343 decoder_.reset(new VaapiVideoDecodeAccelerator( 352 decoder_.reset(new VaapiVideoDecodeAccelerator(
344 static_cast<Display*>(rendering_helper_->GetGLDisplay()), 353 static_cast<Display*>(rendering_helper_->GetGLDisplay()),
345 static_cast<GLXContext>(rendering_helper_->GetGLContext()), 354 static_cast<GLXContext>(rendering_helper_->GetGLContext()),
346 this, base::Bind(&DoNothingReturnTrue))); 355 this, base::Bind(&DoNothingReturnTrue)));
347 #endif // OS_WIN 356 #endif // OS_WIN
348 CHECK(decoder_.get()); 357 CHECK(decoder_.get());
349 SetState(CS_DECODER_SET); 358 SetState(CS_DECODER_SET);
350 if (decoder_deleted()) 359 if (decoder_deleted())
351 return; 360 return;
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 924
916 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); 925 CommandLine::SwitchMap switches = cmd_line->GetSwitches();
917 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); 926 for (CommandLine::SwitchMap::const_iterator it = switches.begin();
918 it != switches.end(); ++it) { 927 it != switches.end(); ++it) {
919 if (it->first == "test_video_data") { 928 if (it->first == "test_video_data") {
920 content::test_video_data = it->second.c_str(); 929 content::test_video_data = it->second.c_str();
921 continue; 930 continue;
922 } 931 }
923 if (it->first == "v" || it->first == "vmodule") 932 if (it->first == "v" || it->first == "vmodule")
924 continue; 933 continue;
934 if (it->first == switches::kUseExynosVda)
935 continue;
925 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 936 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
926 } 937 }
927 938
928 base::ShadowingAtExitManager at_exit_manager; 939 base::ShadowingAtExitManager at_exit_manager;
929 content::RenderingHelper::InitializePlatform(); 940 content::RenderingHelper::InitializePlatform();
930 941
931 #if defined(OS_WIN) 942 #if defined(OS_WIN)
932 base::WaitableEvent event(true, false); 943 base::WaitableEvent event(true, false);
933 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization( 944 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(
934 base::Bind(&base::WaitableEvent::Signal, 945 base::Bind(&base::WaitableEvent::Signal,
935 base::Unretained(&event))); 946 base::Unretained(&event)));
936 event.Wait(); 947 event.Wait();
937 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) 948 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
938 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); 949 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda))
950 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization();
951 else
952 content::OmxVideoDecodeAccelerator::PreSandboxInitialization();
939 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 953 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
940 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); 954 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization();
941 #endif 955 #endif
942 956
943 return RUN_ALL_TESTS(); 957 return RUN_ALL_TESTS();
944 } 958 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698