| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 // Encode to file | 137 // Encode to file |
| 138 rtpFile.Open(fileName.c_str(), "wb+"); | 138 rtpFile.Open(fileName.c_str(), "wb+"); |
| 139 rtpFile.WriteHeader(); | 139 rtpFile.WriteHeader(); |
| 140 | 140 |
| 141 sender_->testMode = 0; | 141 sender_->testMode = 0; |
| 142 sender_->codeId = codec_id; | 142 sender_->codeId = codec_id; |
| 143 | 143 |
| 144 sender_->Setup(acm.get(), &rtpFile, in_file_name_, sample_rate_hz_, channels_, | 144 sender_->Setup(acm.get(), &rtpFile, in_file_name_, sample_rate_hz_, channels_, |
| 145 expected_loss_rate_); | 145 expected_loss_rate_); |
| 146 struct CodecInst sendCodecInst; | 146 if (acm->SendCodec()) { |
| 147 if (acm->SendCodec(&sendCodecInst) >= 0) { | |
| 148 sender_->Run(); | 147 sender_->Run(); |
| 149 } | 148 } |
| 150 sender_->Teardown(); | 149 sender_->Teardown(); |
| 151 rtpFile.Close(); | 150 rtpFile.Close(); |
| 152 | 151 |
| 153 // Decode to file | 152 // Decode to file |
| 154 rtpFile.Open(fileName.c_str(), "rb"); | 153 rtpFile.Open(fileName.c_str(), "rb"); |
| 155 rtpFile.ReadHeader(); | 154 rtpFile.ReadHeader(); |
| 156 | 155 |
| 157 receiver_->testMode = 0; | 156 receiver_->testMode = 0; |
| 158 receiver_->codeId = codec_id; | 157 receiver_->codeId = codec_id; |
| 159 | 158 |
| 160 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, | 159 receiver_->Setup(acm.get(), &rtpFile, "packetLoss_out", channels_, |
| 161 actual_loss_rate_, burst_length_); | 160 actual_loss_rate_, burst_length_); |
| 162 receiver_->Run(); | 161 receiver_->Run(); |
| 163 receiver_->Teardown(); | 162 receiver_->Teardown(); |
| 164 rtpFile.Close(); | 163 rtpFile.Close(); |
| 165 #endif | 164 #endif |
| 166 } | 165 } |
| 167 | 166 |
| 168 } // namespace webrtc | 167 } // namespace webrtc |
| OLD | NEW |