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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 receiver_(new ReceiverWithPacketLoss), | 120 receiver_(new ReceiverWithPacketLoss), |
121 expected_loss_rate_(expected_loss_rate), | 121 expected_loss_rate_(expected_loss_rate), |
122 actual_loss_rate_(actual_loss_rate), | 122 actual_loss_rate_(actual_loss_rate), |
123 burst_length_(burst_length) { | 123 burst_length_(burst_length) { |
124 } | 124 } |
125 | 125 |
126 void PacketLossTest::Perform() { | 126 void PacketLossTest::Perform() { |
127 #ifndef WEBRTC_CODEC_OPUS | 127 #ifndef WEBRTC_CODEC_OPUS |
128 return; | 128 return; |
129 #else | 129 #else |
130 std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0)); | 130 std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create()); |
131 | 131 |
132 int codec_id = acm->Codec("opus", 48000, channels_); | 132 int codec_id = acm->Codec("opus", 48000, channels_); |
133 | 133 |
134 RTPFile rtpFile; | 134 RTPFile rtpFile; |
135 std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(), | 135 std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(), |
136 "packet_loss_test"); | 136 "packet_loss_test"); |
137 | 137 |
138 // Encode to file | 138 // Encode to file |
139 rtpFile.Open(fileName.c_str(), "wb+"); | 139 rtpFile.Open(fileName.c_str(), "wb+"); |
140 rtpFile.WriteHeader(); | 140 rtpFile.WriteHeader(); |
(...skipping 18 matching lines...) Expand all Loading... |
159 | 159 |
160 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, | 160 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, |
161 actual_loss_rate_, burst_length_); | 161 actual_loss_rate_, burst_length_); |
162 receiver_->Run(); | 162 receiver_->Run(); |
163 receiver_->Teardown(); | 163 receiver_->Teardown(); |
164 rtpFile.Close(); | 164 rtpFile.Close(); |
165 #endif | 165 #endif |
166 } | 166 } |
167 | 167 |
168 } // namespace webrtc | 168 } // namespace webrtc |
OLD | NEW |