| 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 "media/base/test_data_util.h" | 5 #include "media/base/test_data_util.h" |
| 6 #include "media/media_features.h" | |
| 7 #include "media/test/pipeline_integration_test_base.h" | 6 #include "media/test/pipeline_integration_test_base.h" |
| 8 #include "testing/perf/perf_test.h" | 7 #include "testing/perf/perf_test.h" |
| 9 | 8 |
| 10 namespace media { | 9 namespace media { |
| 11 | 10 |
| 12 static const int kBenchmarkIterationsAudio = 200; | 11 static const int kBenchmarkIterationsAudio = 200; |
| 13 static const int kBenchmarkIterationsVideo = 20; | 12 static const int kBenchmarkIterationsVideo = 20; |
| 14 | 13 |
| 15 static void RunPlaybackBenchmark(const std::string& filename, | 14 static void RunPlaybackBenchmark(const std::string& filename, |
| 16 const std::string& name, | 15 const std::string& name, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 static void RunAudioPlaybackBenchmark(const std::string& filename, | 55 static void RunAudioPlaybackBenchmark(const std::string& filename, |
| 57 const std::string& name) { | 56 const std::string& name) { |
| 58 RunPlaybackBenchmark(filename, name, kBenchmarkIterationsAudio, true); | 57 RunPlaybackBenchmark(filename, name, kBenchmarkIterationsAudio, true); |
| 59 } | 58 } |
| 60 | 59 |
| 61 TEST(PipelineIntegrationPerfTest, AudioPlaybackBenchmark) { | 60 TEST(PipelineIntegrationPerfTest, AudioPlaybackBenchmark) { |
| 62 RunAudioPlaybackBenchmark("sfx_f32le.wav", "clockless_playback"); | 61 RunAudioPlaybackBenchmark("sfx_f32le.wav", "clockless_playback"); |
| 63 RunAudioPlaybackBenchmark("sfx_s24le.wav", "clockless_playback"); | 62 RunAudioPlaybackBenchmark("sfx_s24le.wav", "clockless_playback"); |
| 64 RunAudioPlaybackBenchmark("sfx_s16le.wav", "clockless_playback"); | 63 RunAudioPlaybackBenchmark("sfx_s16le.wav", "clockless_playback"); |
| 65 RunAudioPlaybackBenchmark("sfx_u8.wav", "clockless_playback"); | 64 RunAudioPlaybackBenchmark("sfx_u8.wav", "clockless_playback"); |
| 66 #if BUILDFLAG(USE_PROPRIETARY_CODECS) | 65 #if defined(USE_PROPRIETARY_CODECS) |
| 67 RunAudioPlaybackBenchmark("sfx.mp3", "clockless_playback"); | 66 RunAudioPlaybackBenchmark("sfx.mp3", "clockless_playback"); |
| 68 #endif | 67 #endif |
| 69 } | 68 } |
| 70 | 69 |
| 71 TEST(PipelineIntegrationPerfTest, VP8PlaybackBenchmark) { | 70 TEST(PipelineIntegrationPerfTest, VP8PlaybackBenchmark) { |
| 72 RunVideoPlaybackBenchmark("bear_silent.webm", "clockless_video_playback_vp8"); | 71 RunVideoPlaybackBenchmark("bear_silent.webm", "clockless_video_playback_vp8"); |
| 73 } | 72 } |
| 74 | 73 |
| 75 TEST(PipelineIntegrationPerfTest, VP9PlaybackBenchmark) { | 74 TEST(PipelineIntegrationPerfTest, VP9PlaybackBenchmark) { |
| 76 RunVideoPlaybackBenchmark("bear-vp9.webm", "clockless_video_playback_vp9"); | 75 RunVideoPlaybackBenchmark("bear-vp9.webm", "clockless_video_playback_vp9"); |
| 77 } | 76 } |
| 78 | 77 |
| 79 // Android doesn't build Theora support. | 78 // Android doesn't build Theora support. |
| 80 #if !defined(OS_ANDROID) | 79 #if !defined(OS_ANDROID) |
| 81 TEST(PipelineIntegrationPerfTest, TheoraPlaybackBenchmark) { | 80 TEST(PipelineIntegrationPerfTest, TheoraPlaybackBenchmark) { |
| 82 RunVideoPlaybackBenchmark("bear_silent.ogv", | 81 RunVideoPlaybackBenchmark("bear_silent.ogv", |
| 83 "clockless_video_playback_theora"); | 82 "clockless_video_playback_theora"); |
| 84 } | 83 } |
| 85 #endif | 84 #endif |
| 86 | 85 |
| 87 // PipelineIntegrationTests can't play h264 content. | 86 // PipelineIntegrationTests can't play h264 content. |
| 88 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) | 87 #if defined(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) |
| 89 TEST(PipelineIntegrationPerfTest, MP4PlaybackBenchmark) { | 88 TEST(PipelineIntegrationPerfTest, MP4PlaybackBenchmark) { |
| 90 RunVideoPlaybackBenchmark("bear_silent.mp4", "clockless_video_playback_mp4"); | 89 RunVideoPlaybackBenchmark("bear_silent.mp4", "clockless_video_playback_mp4"); |
| 91 } | 90 } |
| 92 #endif | 91 #endif |
| 93 | 92 |
| 94 } // namespace media | 93 } // namespace media |
| OLD | NEW |