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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "base/synchronization/condition_variable.h" | 48 #include "base/synchronization/condition_variable.h" |
49 #include "base/synchronization/lock.h" | 49 #include "base/synchronization/lock.h" |
50 #include "base/synchronization/waitable_event.h" | 50 #include "base/synchronization/waitable_event.h" |
51 #include "base/threading/thread.h" | 51 #include "base/threading/thread.h" |
52 #include "base/threading/thread_task_runner_handle.h" | 52 #include "base/threading/thread_task_runner_handle.h" |
53 #include "build/build_config.h" | 53 #include "build/build_config.h" |
54 #include "gpu/command_buffer/service/gpu_preferences.h" | 54 #include "gpu/command_buffer/service/gpu_preferences.h" |
55 #include "gpu/config/gpu_driver_bug_workarounds.h" | 55 #include "gpu/config/gpu_driver_bug_workarounds.h" |
56 #include "media/filters/h264_parser.h" | 56 #include "media/filters/h264_parser.h" |
57 #include "media/gpu/fake_video_decode_accelerator.h" | 57 #include "media/gpu/fake_video_decode_accelerator.h" |
58 #include "media/gpu/gpu_video_decode_accelerator_factory_impl.h" | 58 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
59 #include "media/gpu/rendering_helper.h" | 59 #include "media/gpu/rendering_helper.h" |
60 #include "media/gpu/video_accelerator_unittest_helpers.h" | 60 #include "media/gpu/video_accelerator_unittest_helpers.h" |
61 #include "testing/gtest/include/gtest/gtest.h" | 61 #include "testing/gtest/include/gtest/gtest.h" |
62 #include "ui/gfx/codec/png_codec.h" | 62 #include "ui/gfx/codec/png_codec.h" |
63 #include "ui/gl/gl_image.h" | 63 #include "ui/gl/gl_image.h" |
64 | 64 |
65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
66 #include "base/win/windows_version.h" | 66 #include "base/win/windows_version.h" |
67 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 67 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
68 #elif defined(OS_CHROMEOS) | 68 #elif defined(OS_CHROMEOS) |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 std::string encoded_data_; | 479 std::string encoded_data_; |
480 const int num_in_flight_decodes_; | 480 const int num_in_flight_decodes_; |
481 int outstanding_decodes_; | 481 int outstanding_decodes_; |
482 size_t encoded_data_next_pos_to_decode_; | 482 size_t encoded_data_next_pos_to_decode_; |
483 int next_bitstream_buffer_id_; | 483 int next_bitstream_buffer_id_; |
484 ClientStateNotification<ClientState>* note_; | 484 ClientStateNotification<ClientState>* note_; |
485 std::unique_ptr<VideoDecodeAccelerator> decoder_; | 485 std::unique_ptr<VideoDecodeAccelerator> decoder_; |
486 base::WeakPtr<VideoDecodeAccelerator> weak_vda_; | 486 base::WeakPtr<VideoDecodeAccelerator> weak_vda_; |
487 std::unique_ptr<base::WeakPtrFactory<VideoDecodeAccelerator>> | 487 std::unique_ptr<base::WeakPtrFactory<VideoDecodeAccelerator>> |
488 weak_vda_ptr_factory_; | 488 weak_vda_ptr_factory_; |
489 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> vda_factory_; | 489 std::unique_ptr<GpuVideoDecodeAcceleratorFactory> vda_factory_; |
490 int remaining_play_throughs_; | 490 int remaining_play_throughs_; |
491 int reset_after_frame_num_; | 491 int reset_after_frame_num_; |
492 int delete_decoder_state_; | 492 int delete_decoder_state_; |
493 ClientState state_; | 493 ClientState state_; |
494 int num_skipped_fragments_; | 494 int num_skipped_fragments_; |
495 int num_queued_fragments_; | 495 int num_queued_fragments_; |
496 int num_decoded_frames_; | 496 int num_decoded_frames_; |
497 int num_done_bitstream_buffers_; | 497 int num_done_bitstream_buffers_; |
498 base::TimeTicks initialize_done_ticks_; | 498 base::TimeTicks initialize_done_ticks_; |
499 VideoCodecProfile profile_; | 499 VideoCodecProfile profile_; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 void GLRenderingVDAClient::CreateAndStartDecoder() { | 607 void GLRenderingVDAClient::CreateAndStartDecoder() { |
608 LOG_ASSERT(decoder_deleted()); | 608 LOG_ASSERT(decoder_deleted()); |
609 LOG_ASSERT(!decoder_.get()); | 609 LOG_ASSERT(!decoder_.get()); |
610 | 610 |
611 if (fake_decoder_) { | 611 if (fake_decoder_) { |
612 decoder_.reset(new FakeVideoDecodeAccelerator( | 612 decoder_.reset(new FakeVideoDecodeAccelerator( |
613 frame_size_, base::Bind(&DoNothingReturnTrue))); | 613 frame_size_, base::Bind(&DoNothingReturnTrue))); |
614 LOG_ASSERT(decoder_->Initialize(profile_, this)); | 614 LOG_ASSERT(decoder_->Initialize(profile_, this)); |
615 } else { | 615 } else { |
616 if (!vda_factory_) { | 616 if (!vda_factory_) { |
617 vda_factory_ = GpuVideoDecodeAcceleratorFactoryImpl::Create( | 617 vda_factory_ = GpuVideoDecodeAcceleratorFactory::Create( |
618 base::Bind(&RenderingHelper::GetGLContext, | 618 base::Bind(&RenderingHelper::GetGLContext, |
619 base::Unretained(rendering_helper_)), | 619 base::Unretained(rendering_helper_)), |
620 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); | 620 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); |
621 LOG_ASSERT(vda_factory_); | 621 LOG_ASSERT(vda_factory_); |
622 } | 622 } |
623 | 623 |
624 VideoDecodeAccelerator::Config config(profile_); | 624 VideoDecodeAccelerator::Config config(profile_); |
625 if (g_test_import) { | 625 if (g_test_import) { |
626 config.output_mode = VideoDecodeAccelerator::Config::OutputMode::IMPORT; | 626 config.output_mode = VideoDecodeAccelerator::Config::OutputMode::IMPORT; |
627 } | 627 } |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 media::VaapiWrapper::PreSandboxInitialization(); | 1783 media::VaapiWrapper::PreSandboxInitialization(); |
1784 #endif | 1784 #endif |
1785 | 1785 |
1786 media::g_env = | 1786 media::g_env = |
1787 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1787 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
1788 testing::AddGlobalTestEnvironment( | 1788 testing::AddGlobalTestEnvironment( |
1789 new media::VideoDecodeAcceleratorTestEnvironment())); | 1789 new media::VideoDecodeAcceleratorTestEnvironment())); |
1790 | 1790 |
1791 return RUN_ALL_TESTS(); | 1791 return RUN_ALL_TESTS(); |
1792 } | 1792 } |
OLD | NEW |