| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This program benchmarks the theoretical throughput of the cast library. | 5 // This program benchmarks the theoretical throughput of the cast library. |
| 6 // It runs using a fake clock, simulated network and fake codecs. This allows | 6 // It runs using a fake clock, simulated network and fake codecs. This allows |
| 7 // tests to run much faster than real time. | 7 // tests to run much faster than real time. |
| 8 // To run the program, run: | 8 // To run the program, run: |
| 9 // $ ./out/Release/cast_benchmarks | tee benchmarkoutput.asc | 9 // $ ./out/Release/cast_benchmarks | tee benchmarkoutput.asc |
| 10 // This may take a while, when it is done, you can view the data with | 10 // This may take a while, when it is done, you can view the data with |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 virtual void InitializeAudio( | 110 virtual void InitializeAudio( |
| 111 const CastTransportRtpConfig& config) OVERRIDE { | 111 const CastTransportRtpConfig& config) OVERRIDE { |
| 112 transport_->InitializeAudio(config); | 112 transport_->InitializeAudio(config); |
| 113 } | 113 } |
| 114 | 114 |
| 115 virtual void InitializeVideo( | 115 virtual void InitializeVideo( |
| 116 const CastTransportRtpConfig& config) OVERRIDE { | 116 const CastTransportRtpConfig& config) OVERRIDE { |
| 117 transport_->InitializeVideo(config); | 117 transport_->InitializeVideo(config); |
| 118 } | 118 } |
| 119 | 119 |
| 120 virtual void SetPacketReceiver( | |
| 121 const PacketReceiverCallback& packet_receiver) OVERRIDE { | |
| 122 transport_->SetPacketReceiver(packet_receiver); | |
| 123 } | |
| 124 | |
| 125 virtual void InsertCodedAudioFrame( | 120 virtual void InsertCodedAudioFrame( |
| 126 const EncodedFrame& audio_frame) OVERRIDE { | 121 const EncodedFrame& audio_frame) OVERRIDE { |
| 127 *encoded_audio_bytes_ += audio_frame.data.size(); | 122 *encoded_audio_bytes_ += audio_frame.data.size(); |
| 128 transport_->InsertCodedAudioFrame(audio_frame); | 123 transport_->InsertCodedAudioFrame(audio_frame); |
| 129 } | 124 } |
| 130 | 125 |
| 131 virtual void InsertCodedVideoFrame( | 126 virtual void InsertCodedVideoFrame( |
| 132 const EncodedFrame& video_frame) OVERRIDE { | 127 const EncodedFrame& video_frame) OVERRIDE { |
| 133 *encoded_video_bytes_ += video_frame.data.size(); | 128 *encoded_video_bytes_ += video_frame.data.size(); |
| 134 transport_->InsertCodedVideoFrame(video_frame); | 129 transport_->InsertCodedVideoFrame(video_frame); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 media::cast::CastBenchmark benchmark; | 702 media::cast::CastBenchmark benchmark; |
| 708 if (getenv("PROFILE_FILE")) { | 703 if (getenv("PROFILE_FILE")) { |
| 709 std::string profile_file(getenv("PROFILE_FILE")); | 704 std::string profile_file(getenv("PROFILE_FILE")); |
| 710 base::debug::StartProfiling(profile_file); | 705 base::debug::StartProfiling(profile_file); |
| 711 benchmark.Run(); | 706 benchmark.Run(); |
| 712 base::debug::StopProfiling(); | 707 base::debug::StopProfiling(); |
| 713 } else { | 708 } else { |
| 714 benchmark.Run(); | 709 benchmark.Run(); |
| 715 } | 710 } |
| 716 } | 711 } |
| OLD | NEW |