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