| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <inttypes.h> | 5 #include <inttypes.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/files/memory_mapped_file.h" | 15 #include "base/files/memory_mapped_file.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/numerics/safe_conversions.h" | 18 #include "base/numerics/safe_conversions.h" |
| 19 #include "base/process/process_handle.h" | 19 #include "base/process/process_handle.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 23 #include "base/threading/thread.h" | 23 #include "base/threading/thread.h" |
| 24 #include "base/threading/thread_checker.h" | 24 #include "base/threading/thread_checker.h" |
| 25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
| 26 #include "base/timer/timer.h" | 26 #include "base/timer/timer.h" |
| 27 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 27 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
| 28 #include "media/base/bind_to_current_loop.h" | 28 #include "media/base/bind_to_current_loop.h" |
| 29 #include "media/base/bitstream_buffer.h" | 29 #include "media/base/bitstream_buffer.h" |
| 30 #include "media/base/cdm_context.h" |
| 30 #include "media/base/decoder_buffer.h" | 31 #include "media/base/decoder_buffer.h" |
| 31 #include "media/base/media_util.h" | 32 #include "media/base/media_util.h" |
| 32 #include "media/base/test_data_util.h" | 33 #include "media/base/test_data_util.h" |
| 33 #include "media/base/video_decoder.h" | 34 #include "media/base/video_decoder.h" |
| 34 #include "media/base/video_frame.h" | 35 #include "media/base/video_frame.h" |
| 35 #include "media/filters/ffmpeg_glue.h" | 36 #include "media/filters/ffmpeg_glue.h" |
| 36 #include "media/filters/ffmpeg_video_decoder.h" | 37 #include "media/filters/ffmpeg_video_decoder.h" |
| 37 #include "media/filters/h264_parser.h" | 38 #include "media/filters/h264_parser.h" |
| 38 #include "media/filters/ivf_parser.h" | 39 #include "media/filters/ivf_parser.h" |
| 39 #include "media/video/fake_video_encode_accelerator.h" | 40 #include "media/video/fake_video_encode_accelerator.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 media::COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, | 664 media::COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, |
| 664 natural_size, media::EmptyExtraData(), false); | 665 natural_size, media::EmptyExtraData(), false); |
| 665 else if (IsH264(profile_)) | 666 else if (IsH264(profile_)) |
| 666 config.Initialize(media::kCodecH264, media::H264PROFILE_MAIN, kInputFormat, | 667 config.Initialize(media::kCodecH264, media::H264PROFILE_MAIN, kInputFormat, |
| 667 media::COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, | 668 media::COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, |
| 668 natural_size, media::EmptyExtraData(), false); | 669 natural_size, media::EmptyExtraData(), false); |
| 669 else | 670 else |
| 670 LOG_ASSERT(0) << "Invalid profile " << profile_; | 671 LOG_ASSERT(0) << "Invalid profile " << profile_; |
| 671 | 672 |
| 672 decoder_->Initialize( | 673 decoder_->Initialize( |
| 673 config, false, base::Bind(&VideoFrameQualityValidator::InitializeCB, | 674 config, false, media::SetCdmReadyCB(), |
| 674 base::Unretained(this)), | 675 base::Bind(&VideoFrameQualityValidator::InitializeCB, |
| 676 base::Unretained(this)), |
| 675 base::Bind(&VideoFrameQualityValidator::VerifyOutputFrame, | 677 base::Bind(&VideoFrameQualityValidator::VerifyOutputFrame, |
| 676 base::Unretained(this))); | 678 base::Unretained(this))); |
| 677 } | 679 } |
| 678 | 680 |
| 679 void VideoFrameQualityValidator::InitializeCB(bool success) { | 681 void VideoFrameQualityValidator::InitializeCB(bool success) { |
| 680 if (success) { | 682 if (success) { |
| 681 decoder_state_ = INITIALIZED; | 683 decoder_state_ = INITIALIZED; |
| 682 Decode(); | 684 Decode(); |
| 683 } else { | 685 } else { |
| 684 decoder_state_ = ERROR; | 686 decoder_state_ = ERROR; |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 | 1769 |
| 1768 content::g_env = | 1770 content::g_env = |
| 1769 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( | 1771 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( |
| 1770 testing::AddGlobalTestEnvironment( | 1772 testing::AddGlobalTestEnvironment( |
| 1771 new content::VideoEncodeAcceleratorTestEnvironment( | 1773 new content::VideoEncodeAcceleratorTestEnvironment( |
| 1772 test_stream_data.Pass(), log_path, run_at_fps, | 1774 test_stream_data.Pass(), log_path, run_at_fps, |
| 1773 needs_encode_latency, verify_all_output))); | 1775 needs_encode_latency, verify_all_output))); |
| 1774 | 1776 |
| 1775 return RUN_ALL_TESTS(); | 1777 return RUN_ALL_TESTS(); |
| 1776 } | 1778 } |
| OLD | NEW |