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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 52 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
53 #include "content/public/common/content_switches.h" | 53 #include "content/public/common/content_switches.h" |
54 #include "media/filters/h264_parser.h" | 54 #include "media/filters/h264_parser.h" |
55 #include "ui/gfx/codec/png_codec.h" | 55 #include "ui/gfx/codec/png_codec.h" |
56 #include "ui/gl/gl_image.h" | 56 #include "ui/gl/gl_image.h" |
57 | 57 |
58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
59 #include "base/win/windows_version.h" | 59 #include "base/win/windows_version.h" |
60 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 60 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
61 #elif defined(OS_CHROMEOS) | 61 #elif defined(OS_CHROMEOS) |
62 #if defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) | 62 #if defined(USE_V4L2_CODEC) |
63 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" | 63 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" |
64 #endif // defined(ARCH_CPU_ARMEL) | |
65 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) | |
66 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 64 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
67 #include "content/common/gpu/media/v4l2_video_device.h" | 65 #include "content/common/gpu/media/v4l2_video_device.h" |
68 #endif | 66 #endif |
69 #if defined(ARCH_CPU_X86_FAMILY) | 67 #if defined(ARCH_CPU_X86_FAMILY) |
70 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 68 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
71 #include "content/common/gpu/media/vaapi_wrapper.h" | 69 #include "content/common/gpu/media/vaapi_wrapper.h" |
72 #endif // defined(ARCH_CPU_X86_FAMILY) | 70 #endif // defined(ARCH_CPU_X86_FAMILY) |
73 #else | 71 #else |
74 #error The VideoAccelerator tests are not supported on this platform. | 72 #error The VideoAccelerator tests are not supported on this platform. |
75 #endif // OS_WIN | 73 #endif // OS_WIN |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 496 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
499 decoder.reset( | 497 decoder.reset( |
500 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); | 498 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); |
501 #endif | 499 #endif |
502 return decoder.Pass(); | 500 return decoder.Pass(); |
503 } | 501 } |
504 | 502 |
505 scoped_ptr<media::VideoDecodeAccelerator> | 503 scoped_ptr<media::VideoDecodeAccelerator> |
506 GLRenderingVDAClient::CreateV4L2VDA() { | 504 GLRenderingVDAClient::CreateV4L2VDA() { |
507 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 505 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
508 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \ | 506 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
509 (defined(USE_OZONE) && defined(USE_V4L2_CODEC))) | |
510 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 507 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
511 if (device.get()) { | 508 if (device.get()) { |
512 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 509 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
513 decoder.reset(new V4L2VideoDecodeAccelerator( | 510 decoder.reset(new V4L2VideoDecodeAccelerator( |
514 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 511 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
515 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 512 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
516 weak_client, | 513 weak_client, |
517 base::Bind(&DoNothingReturnTrue), | 514 base::Bind(&DoNothingReturnTrue), |
518 device, | 515 device, |
519 base::MessageLoopProxy::current())); | 516 base::MessageLoopProxy::current())); |
520 } | 517 } |
521 #endif | 518 #endif |
522 return decoder.Pass(); | 519 return decoder.Pass(); |
523 } | 520 } |
524 | 521 |
525 scoped_ptr<media::VideoDecodeAccelerator> | 522 scoped_ptr<media::VideoDecodeAccelerator> |
526 GLRenderingVDAClient::CreateV4L2SliceVDA() { | 523 GLRenderingVDAClient::CreateV4L2SliceVDA() { |
527 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 524 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
528 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) | 525 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
529 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 526 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
530 if (device.get()) { | 527 if (device.get()) { |
531 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); | 528 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); |
532 decoder.reset(new V4L2SliceVideoDecodeAccelerator( | 529 decoder.reset(new V4L2SliceVideoDecodeAccelerator( |
533 device, | 530 device, |
534 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 531 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
535 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), | 532 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), |
536 weak_client, | 533 weak_client, |
537 base::Bind(&DoNothingReturnTrue), | 534 base::Bind(&DoNothingReturnTrue), |
538 base::MessageLoopProxy::current())); | 535 base::MessageLoopProxy::current())); |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 ui::OzonePlatform::InitializeForUI(); | 1612 ui::OzonePlatform::InitializeForUI(); |
1616 #endif | 1613 #endif |
1617 | 1614 |
1618 content::g_env = | 1615 content::g_env = |
1619 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1616 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
1620 testing::AddGlobalTestEnvironment( | 1617 testing::AddGlobalTestEnvironment( |
1621 new content::VideoDecodeAcceleratorTestEnvironment())); | 1618 new content::VideoDecodeAcceleratorTestEnvironment())); |
1622 | 1619 |
1623 return RUN_ALL_TESTS(); | 1620 return RUN_ALL_TESTS(); |
1624 } | 1621 } |
OLD | NEW |