OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
| 11 #include <memory> |
| 12 |
11 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
12 #include "webrtc/base/safe_conversions.h" | 14 #include "webrtc/base/safe_conversions.h" |
13 #include "webrtc/base/scoped_ptr.h" | |
14 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" | 15 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" |
15 #include "webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h" | 16 #include "webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h" |
16 #include "webrtc/test/testsupport/fileutils.h" | 17 #include "webrtc/test/testsupport/fileutils.h" |
17 | 18 |
18 using google::RegisterFlagValidator; | 19 using google::RegisterFlagValidator; |
19 using google::ParseCommandLineFlags; | 20 using google::ParseCommandLineFlags; |
20 using std::string; | 21 using std::string; |
21 using testing::InitGoogleTest; | 22 using testing::InitGoogleTest; |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 info = encoder_->Encode(dummy_timestamp, | 70 info = encoder_->Encode(dummy_timestamp, |
70 rtc::ArrayView<const int16_t>( | 71 rtc::ArrayView<const int16_t>( |
71 in_data + encoded_samples, kFrameSizeSamples), | 72 in_data + encoded_samples, kFrameSizeSamples), |
72 max_bytes, payload); | 73 max_bytes, payload); |
73 encoded_samples += kFrameSizeSamples; | 74 encoded_samples += kFrameSizeSamples; |
74 } while (info.encoded_bytes == 0); | 75 } while (info.encoded_bytes == 0); |
75 return rtc::checked_cast<int>(info.encoded_bytes); | 76 return rtc::checked_cast<int>(info.encoded_bytes); |
76 } | 77 } |
77 | 78 |
78 private: | 79 private: |
79 rtc::scoped_ptr<AudioEncoderPcmU> encoder_; | 80 std::unique_ptr<AudioEncoderPcmU> encoder_; |
80 }; | 81 }; |
81 | 82 |
82 TEST_F(NetEqPcmuQualityTest, Test) { | 83 TEST_F(NetEqPcmuQualityTest, Test) { |
83 Simulate(); | 84 Simulate(); |
84 } | 85 } |
85 | 86 |
86 } // namespace test | 87 } // namespace test |
87 } // namespace webrtc | 88 } // namespace webrtc |
OLD | NEW |