| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // demuxer_bench is a standalone benchmarking tool for FFmpegDemuxer. It | 5 // demuxer_bench is a standalone benchmarking tool for FFmpegDemuxer. It | 
| 6 // simulates the reading requirements for playback by reading from the stream | 6 // simulates the reading requirements for playback by reading from the stream | 
| 7 // that has the earliest timestamp. | 7 // that has the earliest timestamp. | 
| 8 | 8 | 
| 9 #include <iostream> | 9 #include <iostream> | 
| 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/logging.h" | 14 #include "base/logging.h" | 
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" | 
| 16 #include "base/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" | 
| 17 #include "media/base/media.h" | 17 #include "media/base/media.h" | 
| 18 #include "media/filters/ffmpeg_demuxer.h" | 18 #include "media/filters/ffmpeg_demuxer.h" | 
| 19 #include "media/filters/file_data_source.h" | 19 #include "media/filters/file_data_source.h" | 
| 20 | 20 | 
| 21 namespace switches { | 21 namespace switches { | 
| 22 const char kEnableBitstreamConverter[] = "enable-bitstream-converter"; | 22 const char kEnableBitstreamConverter[] = "enable-bitstream-converter"; | 
| 23 }  // namespace switches | 23 }  // namespace switches | 
| 24 | 24 | 
| 25 class DemuxerHostImpl : public media::DemuxerHost { | 25 class DemuxerHostImpl : public media::DemuxerHost { | 
| 26  public: | 26  public: | 
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 228     std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl; | 228     std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl; | 
| 229   } | 229   } | 
| 230 | 230 | 
| 231   // Teardown. | 231   // Teardown. | 
| 232   demuxer.Stop(base::Bind( | 232   demuxer.Stop(base::Bind( | 
| 233       &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK)); | 233       &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK)); | 
| 234   message_loop.Run(); | 234   message_loop.Run(); | 
| 235 | 235 | 
| 236   return 0; | 236   return 0; | 
| 237 } | 237 } | 
| OLD | NEW | 
|---|