| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (ssrc == audio_ssrc_) { | 120 if (ssrc == audio_ssrc_) { |
| 121 *encoded_audio_bytes_ += frame.data.size(); | 121 *encoded_audio_bytes_ += frame.data.size(); |
| 122 } else if (ssrc == video_ssrc_) { | 122 } else if (ssrc == video_ssrc_) { |
| 123 *encoded_video_bytes_ += frame.data.size(); | 123 *encoded_video_bytes_ += frame.data.size(); |
| 124 } | 124 } |
| 125 transport_->InsertFrame(ssrc, frame); | 125 transport_->InsertFrame(ssrc, frame); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void SendSenderReport(uint32 ssrc, | 128 void SendSenderReport(uint32 ssrc, |
| 129 base::TimeTicks current_time, | 129 base::TimeTicks current_time, |
| 130 uint32 current_time_as_rtp_timestamp) final { | 130 RtpTimeTicks current_time_as_rtp_timestamp) final { |
| 131 transport_->SendSenderReport(ssrc, | 131 transport_->SendSenderReport(ssrc, |
| 132 current_time, | 132 current_time, |
| 133 current_time_as_rtp_timestamp); | 133 current_time_as_rtp_timestamp); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void CancelSendingFrames(uint32 ssrc, | 136 void CancelSendingFrames(uint32 ssrc, |
| 137 const std::vector<uint32>& frame_ids) final { | 137 const std::vector<uint32>& frame_ids) final { |
| 138 transport_->CancelSendingFrames(ssrc, frame_ids); | 138 transport_->CancelSendingFrames(ssrc, frame_ids); |
| 139 } | 139 } |
| 140 | 140 |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 media::cast::CastBenchmark benchmark; | 719 media::cast::CastBenchmark benchmark; |
| 720 if (getenv("PROFILE_FILE")) { | 720 if (getenv("PROFILE_FILE")) { |
| 721 std::string profile_file(getenv("PROFILE_FILE")); | 721 std::string profile_file(getenv("PROFILE_FILE")); |
| 722 base::debug::StartProfiling(profile_file); | 722 base::debug::StartProfiling(profile_file); |
| 723 benchmark.Run(); | 723 benchmark.Run(); |
| 724 base::debug::StopProfiling(); | 724 base::debug::StopProfiling(); |
| 725 } else { | 725 } else { |
| 726 benchmark.Run(); | 726 benchmark.Run(); |
| 727 } | 727 } |
| 728 } | 728 } |
| OLD | NEW |