| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 return false; | 102 return false; |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool SenderWithFEC::SetPacketLossRate(int expected_loss_rate) { | 105 bool SenderWithFEC::SetPacketLossRate(int expected_loss_rate) { |
| 106 bool success = false; | 106 bool success = false; |
| 107 _acm->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { | 107 _acm->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { |
| 108 if (!*encoder) { | 108 if (!*encoder) { |
| 109 // There is no existing encoder. | 109 // There is no existing encoder. |
| 110 return; | 110 return; |
| 111 } | 111 } |
| 112 (*encoder)->SetProjectedPacketLossRate(expected_loss_rate / 100.0f); | 112 (*encoder)->OnReceivedUplinkPacketLossFraction(expected_loss_rate / 100.0f); |
| 113 success = true; | 113 success = true; |
| 114 }); | 114 }); |
| 115 return success; | 115 return success; |
| 116 } | 116 } |
| 117 | 117 |
| 118 PacketLossTest::PacketLossTest(int channels, int expected_loss_rate, | 118 PacketLossTest::PacketLossTest(int channels, int expected_loss_rate, |
| 119 int actual_loss_rate, int burst_length) | 119 int actual_loss_rate, int burst_length) |
| 120 : channels_(channels), | 120 : channels_(channels), |
| 121 in_file_name_(channels_ == 1 ? "audio_coding/testfile32kHz" : | 121 in_file_name_(channels_ == 1 ? "audio_coding/testfile32kHz" : |
| 122 "audio_coding/teststereo32kHz"), | 122 "audio_coding/teststereo32kHz"), |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, | 165 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, |
| 166 actual_loss_rate_, burst_length_); | 166 actual_loss_rate_, burst_length_); |
| 167 receiver_->Run(); | 167 receiver_->Run(); |
| 168 receiver_->Teardown(); | 168 receiver_->Teardown(); |
| 169 rtpFile.Close(); | 169 rtpFile.Close(); |
| 170 #endif | 170 #endif |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace webrtc | 173 } // namespace webrtc |
| OLD | NEW |