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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "content/common/gpu/media/rendering_helper.h" | 50 #include "content/common/gpu/media/rendering_helper.h" |
51 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 51 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
52 #include "content/public/common/content_switches.h" | 52 #include "content/public/common/content_switches.h" |
53 #include "media/filters/h264_parser.h" | 53 #include "media/filters/h264_parser.h" |
54 #include "ui/gfx/codec/png_codec.h" | 54 #include "ui/gfx/codec/png_codec.h" |
55 | 55 |
56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
57 #include "base/win/windows_version.h" | 57 #include "base/win/windows_version.h" |
58 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 58 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
59 #elif defined(OS_CHROMEOS) | 59 #elif defined(OS_CHROMEOS) |
60 #if defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) | 60 #if defined(USE_V4L2_CODEC) |
61 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" | 61 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" |
62 #endif // defined(ARCH_CPU_ARMEL) | |
63 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) | |
64 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 62 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
65 #include "content/common/gpu/media/v4l2_video_device.h" | 63 #include "content/common/gpu/media/v4l2_video_device.h" |
66 #endif | 64 #endif |
67 #if defined(ARCH_CPU_X86_FAMILY) | 65 #if defined(ARCH_CPU_X86_FAMILY) |
68 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 66 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
69 #include "content/common/gpu/media/vaapi_wrapper.h" | 67 #include "content/common/gpu/media/vaapi_wrapper.h" |
70 #endif // defined(ARCH_CPU_X86_FAMILY) | 68 #endif // defined(ARCH_CPU_X86_FAMILY) |
71 #else | 69 #else |
72 #error The VideoAccelerator tests are not supported on this platform. | 70 #error The VideoAccelerator tests are not supported on this platform. |
73 #endif // OS_WIN | 71 #endif // OS_WIN |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 435 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
438 decoder.reset( | 436 decoder.reset( |
439 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); | 437 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); |
440 #endif | 438 #endif |
441 return decoder.Pass(); | 439 return decoder.Pass(); |
442 } | 440 } |
443 | 441 |
444 scoped_ptr<media::VideoDecodeAccelerator> | 442 scoped_ptr<media::VideoDecodeAccelerator> |
445 GLRenderingVDAClient::CreateV4L2VDA() { | 443 GLRenderingVDAClient::CreateV4L2VDA() { |
446 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 444 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
447 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \ | 445 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
448 (defined(USE_OZONE) && defined(USE_V4L2_CODEC))) | |
449 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 446 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
450 if (device.get()) { | 447 if (device.get()) { |
451 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 448 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
452 decoder.reset(new V4L2VideoDecodeAccelerator( | 449 decoder.reset(new V4L2VideoDecodeAccelerator( |
453 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 450 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
454 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 451 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
455 weak_client, | 452 weak_client, |
456 base::Bind(&DoNothingReturnTrue), | 453 base::Bind(&DoNothingReturnTrue), |
457 device, | 454 device, |
458 base::MessageLoopProxy::current())); | 455 base::MessageLoopProxy::current())); |
459 } | 456 } |
460 #endif | 457 #endif |
461 return decoder.Pass(); | 458 return decoder.Pass(); |
462 } | 459 } |
463 | 460 |
464 scoped_ptr<media::VideoDecodeAccelerator> | 461 scoped_ptr<media::VideoDecodeAccelerator> |
465 GLRenderingVDAClient::CreateV4L2SliceVDA() { | 462 GLRenderingVDAClient::CreateV4L2SliceVDA() { |
466 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 463 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
467 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) | 464 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
468 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 465 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
469 if (device.get()) { | 466 if (device.get()) { |
470 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 467 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
471 decoder.reset(new V4L2SliceVideoDecodeAccelerator( | 468 decoder.reset(new V4L2SliceVideoDecodeAccelerator( |
472 device, | 469 device, |
473 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 470 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
474 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 471 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
475 weak_client, | 472 weak_client, |
476 base::Bind(&DoNothingReturnTrue), | 473 base::Bind(&DoNothingReturnTrue), |
477 base::MessageLoopProxy::current())); | 474 base::MessageLoopProxy::current())); |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 continue; | 1543 continue; |
1547 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1544 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1548 } | 1545 } |
1549 | 1546 |
1550 base::ShadowingAtExitManager at_exit_manager; | 1547 base::ShadowingAtExitManager at_exit_manager; |
1551 base::MessageLoop main_loop; | 1548 base::MessageLoop main_loop; |
1552 content::RenderingHelper::InitializeOneOff(); | 1549 content::RenderingHelper::InitializeOneOff(); |
1553 | 1550 |
1554 return RUN_ALL_TESTS(); | 1551 return RUN_ALL_TESTS(); |
1555 } | 1552 } |
OLD | NEW |