| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 private: | 165 private: |
| 166 FILE* output_fp_; | 166 FILE* output_fp_; |
| 167 std::unique_ptr<rtc::MessageDigest> digest_; | 167 std::unique_ptr<rtc::MessageDigest> digest_; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 ResultSink::ResultSink(const std::string &output_file) | 170 ResultSink::ResultSink(const std::string &output_file) |
| 171 : output_fp_(nullptr), | 171 : output_fp_(nullptr), |
| 172 digest_(new rtc::Sha1Digest()) { | 172 digest_(new rtc::Sha1Digest()) { |
| 173 if (!output_file.empty()) { | 173 if (!output_file.empty()) { |
| 174 output_fp_ = fopen(output_file.c_str(), "wb"); | 174 output_fp_ = fopen(output_file.c_str(), "wb"); |
| 175 EXPECT_TRUE(output_fp_ != NULL); | 175 EXPECT_TRUE(output_fp_ != nullptr); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 ResultSink::~ResultSink() { | 179 ResultSink::~ResultSink() { |
| 180 if (output_fp_) | 180 if (output_fp_) |
| 181 fclose(output_fp_); | 181 fclose(output_fp_); |
| 182 } | 182 } |
| 183 | 183 |
| 184 template<typename T, size_t n> | 184 template<typename T, size_t n> |
| 185 void ResultSink::AddResult(const T (&test_results)[n], size_t length) { | 185 void ResultSink::AddResult(const T (&test_results)[n], size_t length) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 }; | 281 }; |
| 282 | 282 |
| 283 // Allocating the static const so that it can be passed by reference. | 283 // Allocating the static const so that it can be passed by reference. |
| 284 const int NetEqDecodingTest::kTimeStepMs; | 284 const int NetEqDecodingTest::kTimeStepMs; |
| 285 const size_t NetEqDecodingTest::kBlockSize8kHz; | 285 const size_t NetEqDecodingTest::kBlockSize8kHz; |
| 286 const size_t NetEqDecodingTest::kBlockSize16kHz; | 286 const size_t NetEqDecodingTest::kBlockSize16kHz; |
| 287 const size_t NetEqDecodingTest::kBlockSize32kHz; | 287 const size_t NetEqDecodingTest::kBlockSize32kHz; |
| 288 const int NetEqDecodingTest::kInitSampleRateHz; | 288 const int NetEqDecodingTest::kInitSampleRateHz; |
| 289 | 289 |
| 290 NetEqDecodingTest::NetEqDecodingTest() | 290 NetEqDecodingTest::NetEqDecodingTest() |
| 291 : neteq_(NULL), | 291 : neteq_(nullptr), |
| 292 config_(), | 292 config_(), |
| 293 sim_clock_(0), | 293 sim_clock_(0), |
| 294 output_sample_rate_(kInitSampleRateHz), | 294 output_sample_rate_(kInitSampleRateHz), |
| 295 algorithmic_delay_ms_(0) { | 295 algorithmic_delay_ms_(0) { |
| 296 config_.sample_rate_hz = kInitSampleRateHz; | 296 config_.sample_rate_hz = kInitSampleRateHz; |
| 297 } | 297 } |
| 298 | 298 |
| 299 void NetEqDecodingTest::SetUp() { | 299 void NetEqDecodingTest::SetUp() { |
| 300 neteq_ = NetEq::Create(config_, CreateBuiltinAudioDecoderFactory()); | 300 neteq_ = NetEq::Create(config_, CreateBuiltinAudioDecoderFactory()); |
| 301 NetEqNetworkStatistics stat; | 301 NetEqNetworkStatistics stat; |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 if (muted) { | 1581 if (muted) { |
| 1582 EXPECT_TRUE(AudioFramesEqualExceptData(out_frame1, out_frame2)); | 1582 EXPECT_TRUE(AudioFramesEqualExceptData(out_frame1, out_frame2)); |
| 1583 } else { | 1583 } else { |
| 1584 EXPECT_TRUE(AudioFramesEqual(out_frame1, out_frame2)); | 1584 EXPECT_TRUE(AudioFramesEqual(out_frame1, out_frame2)); |
| 1585 } | 1585 } |
| 1586 } | 1586 } |
| 1587 EXPECT_FALSE(muted); | 1587 EXPECT_FALSE(muted); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 } // namespace webrtc | 1590 } // namespace webrtc |
| OLD | NEW |