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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 private: | 47 private: |
48 ISACFIX_MainStruct* isac_encoder_; | 48 ISACFIX_MainStruct* isac_encoder_; |
49 int bit_rate_kbps_; | 49 int bit_rate_kbps_; |
50 }; | 50 }; |
51 | 51 |
52 NetEqIsacQualityTest::NetEqIsacQualityTest() | 52 NetEqIsacQualityTest::NetEqIsacQualityTest() |
53 : NetEqQualityTest(kIsacBlockDurationMs, | 53 : NetEqQualityTest(kIsacBlockDurationMs, |
54 kIsacInputSamplingKhz, | 54 kIsacInputSamplingKhz, |
55 kIsacOutputSamplingKhz, | 55 kIsacOutputSamplingKhz, |
56 NetEqDecoder::kDecoderISAC), | 56 NetEqDecoder::kDecoderISAC), |
57 isac_encoder_(NULL), | 57 isac_encoder_(nullptr), |
58 bit_rate_kbps_(FLAGS_bit_rate_kbps) {} | 58 bit_rate_kbps_(FLAGS_bit_rate_kbps) {} |
59 | 59 |
60 void NetEqIsacQualityTest::SetUp() { | 60 void NetEqIsacQualityTest::SetUp() { |
61 ASSERT_EQ(1u, channels_) << "iSAC supports only mono audio."; | 61 ASSERT_EQ(1u, channels_) << "iSAC supports only mono audio."; |
62 // Create encoder memory. | 62 // Create encoder memory. |
63 WebRtcIsacfix_Create(&isac_encoder_); | 63 WebRtcIsacfix_Create(&isac_encoder_); |
64 ASSERT_TRUE(isac_encoder_ != NULL); | 64 ASSERT_TRUE(isac_encoder_ != nullptr); |
65 EXPECT_EQ(0, WebRtcIsacfix_EncoderInit(isac_encoder_, 1)); | 65 EXPECT_EQ(0, WebRtcIsacfix_EncoderInit(isac_encoder_, 1)); |
66 // Set bitrate and block length. | 66 // Set bitrate and block length. |
67 EXPECT_EQ(0, WebRtcIsacfix_Control(isac_encoder_, bit_rate_kbps_ * 1000, | 67 EXPECT_EQ(0, WebRtcIsacfix_Control(isac_encoder_, bit_rate_kbps_ * 1000, |
68 kIsacBlockDurationMs)); | 68 kIsacBlockDurationMs)); |
69 NetEqQualityTest::SetUp(); | 69 NetEqQualityTest::SetUp(); |
70 } | 70 } |
71 | 71 |
72 void NetEqIsacQualityTest::TearDown() { | 72 void NetEqIsacQualityTest::TearDown() { |
73 // Free memory. | 73 // Free memory. |
74 EXPECT_EQ(0, WebRtcIsacfix_Free(isac_encoder_)); | 74 EXPECT_EQ(0, WebRtcIsacfix_Free(isac_encoder_)); |
(...skipping 22 matching lines...) Expand all Loading... |
97 EXPECT_GT(value, 0); | 97 EXPECT_GT(value, 0); |
98 return value; | 98 return value; |
99 } | 99 } |
100 | 100 |
101 TEST_F(NetEqIsacQualityTest, Test) { | 101 TEST_F(NetEqIsacQualityTest, Test) { |
102 Simulate(); | 102 Simulate(); |
103 } | 103 } |
104 | 104 |
105 } // namespace test | 105 } // namespace test |
106 } // namespace webrtc | 106 } // namespace webrtc |
OLD | NEW |