| 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/media.h" | 10 #include "media/base/media.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 perf_test::PrintResult("demuxer_bench", | 202 perf_test::PrintResult("demuxer_bench", |
| 203 "", | 203 "", |
| 204 filename, | 204 filename, |
| 205 kBenchmarkIterations / total_time, | 205 kBenchmarkIterations / total_time, |
| 206 "runs/s", | 206 "runs/s", |
| 207 true); | 207 true); |
| 208 } | 208 } |
| 209 | 209 |
| 210 class DemuxerPerfTest : public testing::TestWithParam<const char*> { | 210 #if defined(OS_WIN) |
| 211 }; | 211 // http://crbug.com/399002 |
| 212 | 212 #define MAYBE_Demuxer DISABLED_Demuxer |
| 213 const char* kDemuxerBenchmarks[] = { | 213 #else |
| 214 "bear.ogv", | 214 #define MAYBE_Demuxer Demuxer |
| 215 "bear-640x360.webm", | 215 #endif |
| 216 "sfx_s16le.wav", | 216 TEST(DemuxerPerfTest, MAYBE_Demuxer) { |
| 217 RunDemuxerBenchmark("bear.ogv"); |
| 218 RunDemuxerBenchmark("bear-640x360.webm"); |
| 219 RunDemuxerBenchmark("sfx_s16le.wav"); |
| 217 #if defined(USE_PROPRIETARY_CODECS) | 220 #if defined(USE_PROPRIETARY_CODECS) |
| 218 "bear-1280x720.mp4", | 221 RunDemuxerBenchmark("bear-1280x720.mp4"); |
| 219 "sfx.mp3", | 222 RunDemuxerBenchmark("sfx.mp3"); |
| 220 #endif | 223 #endif |
| 221 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
| 222 "bear.flac", | 225 RunDemuxerBenchmark("bear.flac"); |
| 223 #endif | 226 #endif |
| 224 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) | 227 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) |
| 225 "bear.avi", | 228 RunDemuxerBenchmark("bear.avi"); |
| 226 #endif | 229 #endif |
| 227 }; | |
| 228 | |
| 229 TEST_P(DemuxerPerfTest, Demuxer) { | |
| 230 RunDemuxerBenchmark(GetParam()); | |
| 231 } | 230 } |
| 232 | 231 |
| 233 #if !defined(OS_WIN) | |
| 234 // http://crbug.com/399002 | |
| 235 INSTANTIATE_TEST_CASE_P(, DemuxerPerfTest, | |
| 236 testing::ValuesIn(kDemuxerBenchmarks)); | |
| 237 #endif // !defined(OS_WIN) | |
| 238 | |
| 239 } // namespace media | 232 } // namespace media |
| OLD | NEW |