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 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <queue> | 11 #include <queue> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/bits.h" | 17 #include "base/bits.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/files/file_util.h" | 19 #include "base/files/file_util.h" |
20 #include "base/macros.h" | 20 #include "base/macros.h" |
21 #include "base/memory/aligned_memory.h" | 21 #include "base/memory/aligned_memory.h" |
| 22 #include "base/memory/ref_counted.h" |
22 #include "base/memory/scoped_vector.h" | 23 #include "base/memory/scoped_vector.h" |
23 #include "base/memory/weak_ptr.h" | 24 #include "base/memory/weak_ptr.h" |
24 #include "base/message_loop/message_loop.h" | 25 #include "base/message_loop/message_loop.h" |
25 #include "base/numerics/safe_conversions.h" | 26 #include "base/numerics/safe_conversions.h" |
26 #include "base/process/process_handle.h" | 27 #include "base/process/process_handle.h" |
27 #include "base/single_thread_task_runner.h" | 28 #include "base/single_thread_task_runner.h" |
28 #include "base/strings/string_number_conversions.h" | 29 #include "base/strings/string_number_conversions.h" |
29 #include "base/strings/string_split.h" | 30 #include "base/strings/string_split.h" |
30 #include "base/strings/stringprintf.h" | 31 #include "base/strings/stringprintf.h" |
31 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
32 #include "base/threading/thread.h" | 33 #include "base/threading/thread.h" |
33 #include "base/threading/thread_checker.h" | 34 #include "base/threading/thread_checker.h" |
34 #include "base/time/time.h" | 35 #include "base/time/time.h" |
35 #include "base/timer/timer.h" | 36 #include "base/timer/timer.h" |
36 #include "build/build_config.h" | 37 #include "build/build_config.h" |
37 #include "media/base/bind_to_current_loop.h" | 38 #include "media/base/bind_to_current_loop.h" |
38 #include "media/base/bitstream_buffer.h" | 39 #include "media/base/bitstream_buffer.h" |
39 #include "media/base/cdm_context.h" | 40 #include "media/base/cdm_context.h" |
40 #include "media/base/decoder_buffer.h" | 41 #include "media/base/decoder_buffer.h" |
| 42 #include "media/base/media_log.h" |
41 #include "media/base/media_util.h" | 43 #include "media/base/media_util.h" |
42 #include "media/base/test_data_util.h" | 44 #include "media/base/test_data_util.h" |
43 #include "media/base/video_decoder.h" | 45 #include "media/base/video_decoder.h" |
44 #include "media/base/video_frame.h" | 46 #include "media/base/video_frame.h" |
45 #include "media/filters/ffmpeg_glue.h" | 47 #include "media/filters/ffmpeg_glue.h" |
46 #include "media/filters/ffmpeg_video_decoder.h" | 48 #include "media/filters/ffmpeg_video_decoder.h" |
47 #include "media/filters/h264_parser.h" | 49 #include "media/filters/h264_parser.h" |
48 #include "media/filters/ivf_parser.h" | 50 #include "media/filters/ivf_parser.h" |
49 #include "media/gpu/video_accelerator_unittest_helpers.h" | 51 #include "media/gpu/video_accelerator_unittest_helpers.h" |
50 #include "media/video/fake_video_encode_accelerator.h" | 52 #include "media/video/fake_video_encode_accelerator.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 std::queue<scoped_refptr<VideoFrame>> original_frames_; | 742 std::queue<scoped_refptr<VideoFrame>> original_frames_; |
741 std::queue<scoped_refptr<DecoderBuffer>> decode_buffers_; | 743 std::queue<scoped_refptr<DecoderBuffer>> decode_buffers_; |
742 base::ThreadChecker thread_checker_; | 744 base::ThreadChecker thread_checker_; |
743 }; | 745 }; |
744 | 746 |
745 VideoFrameQualityValidator::VideoFrameQualityValidator( | 747 VideoFrameQualityValidator::VideoFrameQualityValidator( |
746 const VideoCodecProfile profile, | 748 const VideoCodecProfile profile, |
747 const base::Closure& flush_complete_cb, | 749 const base::Closure& flush_complete_cb, |
748 const base::Closure& decode_error_cb) | 750 const base::Closure& decode_error_cb) |
749 : profile_(profile), | 751 : profile_(profile), |
750 decoder_(new FFmpegVideoDecoder()), | 752 decoder_(new FFmpegVideoDecoder(make_scoped_refptr(new MediaLog()))), |
751 decode_cb_( | 753 decode_cb_( |
752 base::Bind(&VideoFrameQualityValidator::DecodeDone, AsWeakPtr())), | 754 base::Bind(&VideoFrameQualityValidator::DecodeDone, AsWeakPtr())), |
753 eos_decode_cb_( | 755 eos_decode_cb_( |
754 base::Bind(&VideoFrameQualityValidator::FlushDone, AsWeakPtr())), | 756 base::Bind(&VideoFrameQualityValidator::FlushDone, AsWeakPtr())), |
755 flush_complete_cb_(flush_complete_cb), | 757 flush_complete_cb_(flush_complete_cb), |
756 decode_error_cb_(decode_error_cb), | 758 decode_error_cb_(decode_error_cb), |
757 decoder_state_(UNINITIALIZED) { | 759 decoder_state_(UNINITIALIZED) { |
758 // Allow decoding of individual NALU. Entire frames are required by default. | 760 // Allow decoding of individual NALU. Entire frames are required by default. |
759 decoder_->set_decode_nalus(true); | 761 decoder_->set_decode_nalus(true); |
760 } | 762 } |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 | 2377 |
2376 media::g_env = | 2378 media::g_env = |
2377 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( | 2379 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( |
2378 testing::AddGlobalTestEnvironment( | 2380 testing::AddGlobalTestEnvironment( |
2379 new media::VideoEncodeAcceleratorTestEnvironment( | 2381 new media::VideoEncodeAcceleratorTestEnvironment( |
2380 std::move(test_stream_data), log_path, run_at_fps, | 2382 std::move(test_stream_data), log_path, run_at_fps, |
2381 needs_encode_latency, verify_all_output))); | 2383 needs_encode_latency, verify_all_output))); |
2382 | 2384 |
2383 return RUN_ALL_TESTS(); | 2385 return RUN_ALL_TESTS(); |
2384 } | 2386 } |
OLD | NEW |