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

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

Issue 902773003: Revert of Clean up V4L2 codec-related flags and defines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(USE_V4L2_CODEC) 60 #if defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2)
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))
62 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 64 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
63 #include "content/common/gpu/media/v4l2_video_device.h" 65 #include "content/common/gpu/media/v4l2_video_device.h"
64 #endif 66 #endif
65 #if defined(ARCH_CPU_X86_FAMILY) 67 #if defined(ARCH_CPU_X86_FAMILY)
66 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 68 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
67 #include "content/common/gpu/media/vaapi_wrapper.h" 69 #include "content/common/gpu/media/vaapi_wrapper.h"
68 #endif // defined(ARCH_CPU_X86_FAMILY) 70 #endif // defined(ARCH_CPU_X86_FAMILY)
69 #else 71 #else
70 #error The VideoAccelerator tests are not supported on this platform. 72 #error The VideoAccelerator tests are not supported on this platform.
71 #endif // OS_WIN 73 #endif // OS_WIN
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (base::win::GetVersion() >= base::win::VERSION_WIN7) 437 if (base::win::GetVersion() >= base::win::VERSION_WIN7)
436 decoder.reset( 438 decoder.reset(
437 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue))); 439 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue)));
438 #endif 440 #endif
439 return decoder.Pass(); 441 return decoder.Pass();
440 } 442 }
441 443
442 scoped_ptr<media::VideoDecodeAccelerator> 444 scoped_ptr<media::VideoDecodeAccelerator>
443 GLRenderingVDAClient::CreateV4L2VDA() { 445 GLRenderingVDAClient::CreateV4L2VDA() {
444 scoped_ptr<media::VideoDecodeAccelerator> decoder; 446 scoped_ptr<media::VideoDecodeAccelerator> decoder;
445 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 447 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \
448 (defined(USE_OZONE) && defined(USE_V4L2_CODEC)))
446 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 449 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
447 if (device.get()) { 450 if (device.get()) {
448 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); 451 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
449 decoder.reset(new V4L2VideoDecodeAccelerator( 452 decoder.reset(new V4L2VideoDecodeAccelerator(
450 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 453 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
451 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), 454 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
452 weak_client, 455 weak_client,
453 base::Bind(&DoNothingReturnTrue), 456 base::Bind(&DoNothingReturnTrue),
454 device, 457 device,
455 base::MessageLoopProxy::current())); 458 base::MessageLoopProxy::current()));
456 } 459 }
457 #endif 460 #endif
458 return decoder.Pass(); 461 return decoder.Pass();
459 } 462 }
460 463
461 scoped_ptr<media::VideoDecodeAccelerator> 464 scoped_ptr<media::VideoDecodeAccelerator>
462 GLRenderingVDAClient::CreateV4L2SliceVDA() { 465 GLRenderingVDAClient::CreateV4L2SliceVDA() {
463 scoped_ptr<media::VideoDecodeAccelerator> decoder; 466 scoped_ptr<media::VideoDecodeAccelerator> decoder;
464 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 467 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2)
465 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 468 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
466 if (device.get()) { 469 if (device.get()) {
467 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); 470 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
468 decoder.reset(new V4L2SliceVideoDecodeAccelerator( 471 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
469 device, 472 device,
470 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 473 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
471 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()), 474 static_cast<EGLContext>(rendering_helper_->GetGLContextHandle()),
472 weak_client, 475 weak_client,
473 base::Bind(&DoNothingReturnTrue), 476 base::Bind(&DoNothingReturnTrue),
474 base::MessageLoopProxy::current())); 477 base::MessageLoopProxy::current()));
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 continue; 1546 continue;
1544 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1547 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1545 } 1548 }
1546 1549
1547 base::ShadowingAtExitManager at_exit_manager; 1550 base::ShadowingAtExitManager at_exit_manager;
1548 base::MessageLoop main_loop; 1551 base::MessageLoop main_loop;
1549 content::RenderingHelper::InitializeOneOff(); 1552 content::RenderingHelper::InitializeOneOff();
1550 1553
1551 return RUN_ALL_TESTS(); 1554 return RUN_ALL_TESTS();
1552 } 1555 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_encode_accelerator.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698