| 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" |
| 11 #include "media/base/media_log.h" | 11 #include "media/base/media_log.h" |
| 12 #include "media/base/test_data_util.h" | 12 #include "media/base/test_data_util.h" |
| 13 #include "media/filters/ffmpeg_demuxer.h" | 13 #include "media/filters/ffmpeg_demuxer.h" |
| 14 #include "media/filters/file_data_source.h" | 14 #include "media/filters/file_data_source.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "testing/perf/perf_test.h" | 16 #include "testing/perf/perf_test.h" |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 | 19 |
| 20 static const int kBenchmarkIterations = 100; | 20 static const int kBenchmarkIterations = 100; |
| 21 | 21 |
| 22 class DemuxerHostImpl : public media::DemuxerHost { | 22 class DemuxerHostImpl : public media::DemuxerHost { |
| 23 public: | 23 public: |
| 24 DemuxerHostImpl() {} | 24 DemuxerHostImpl() {} |
| 25 virtual ~DemuxerHostImpl() {} | 25 virtual ~DemuxerHostImpl() {} |
| 26 | 26 |
| 27 // DemuxerHost implementation. | 27 // DemuxerHost implementation. |
| 28 virtual void AddBufferedTimeRange(base::TimeDelta start, | 28 virtual void AddBufferedTimeRange(base::TimeDelta start, |
| 29 base::TimeDelta end) OVERRIDE {} | 29 base::TimeDelta end) override {} |
| 30 virtual void SetDuration(base::TimeDelta duration) OVERRIDE {} | 30 virtual void SetDuration(base::TimeDelta duration) override {} |
| 31 virtual void OnDemuxerError(media::PipelineStatus error) OVERRIDE {} | 31 virtual void OnDemuxerError(media::PipelineStatus error) override {} |
| 32 virtual void AddTextStream(media::DemuxerStream* text_stream, | 32 virtual void AddTextStream(media::DemuxerStream* text_stream, |
| 33 const media::TextTrackConfig& config) OVERRIDE {} | 33 const media::TextTrackConfig& config) override {} |
| 34 virtual void RemoveTextStream(media::DemuxerStream* text_stream) OVERRIDE {} | 34 virtual void RemoveTextStream(media::DemuxerStream* text_stream) override {} |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(DemuxerHostImpl); | 37 DISALLOW_COPY_AND_ASSIGN(DemuxerHostImpl); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 static void QuitLoopWithStatus(base::MessageLoop* message_loop, | 40 static void QuitLoopWithStatus(base::MessageLoop* message_loop, |
| 41 media::PipelineStatus status) { | 41 media::PipelineStatus status) { |
| 42 CHECK_EQ(status, media::PIPELINE_OK); | 42 CHECK_EQ(status, media::PIPELINE_OK); |
| 43 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 43 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 44 } | 44 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 #endif | 223 #endif |
| 224 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
| 225 RunDemuxerBenchmark("bear.flac"); | 225 RunDemuxerBenchmark("bear.flac"); |
| 226 #endif | 226 #endif |
| 227 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) | 227 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) |
| 228 RunDemuxerBenchmark("bear.avi"); | 228 RunDemuxerBenchmark("bear.avi"); |
| 229 #endif | 229 #endif |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace media | 232 } // namespace media |
| OLD | NEW |