| 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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 EXPECT_EQ(out_frame_.samples_per_channel_, new_frame.samples_per_channel_); | 1601 EXPECT_EQ(out_frame_.samples_per_channel_, new_frame.samples_per_channel_); |
| 1602 EXPECT_EQ(out_frame_.sample_rate_hz_, new_frame.sample_rate_hz_); | 1602 EXPECT_EQ(out_frame_.sample_rate_hz_, new_frame.sample_rate_hz_); |
| 1603 EXPECT_EQ(out_frame_.num_channels_, new_frame.num_channels_); | 1603 EXPECT_EQ(out_frame_.num_channels_, new_frame.num_channels_); |
| 1604 EXPECT_EQ(out_frame_.speech_type_, new_frame.speech_type_); | 1604 EXPECT_EQ(out_frame_.speech_type_, new_frame.speech_type_); |
| 1605 EXPECT_EQ(out_frame_.vad_activity_, new_frame.vad_activity_); | 1605 EXPECT_EQ(out_frame_.vad_activity_, new_frame.vad_activity_); |
| 1606 | 1606 |
| 1607 // Insert new data. Timestamp is corrected for the time elapsed since the last | 1607 // Insert new data. Timestamp is corrected for the time elapsed since the last |
| 1608 // packet. Verify that normal operation resumes. | 1608 // packet. Verify that normal operation resumes. |
| 1609 InsertPacket(kSamples * counter_); | 1609 InsertPacket(kSamples * counter_); |
| 1610 GetAudioUntilNormal(); | 1610 GetAudioUntilNormal(); |
| 1611 |
| 1612 NetEqNetworkStatistics stats; |
| 1613 EXPECT_EQ(0, neteq_->NetworkStatistics(&stats)); |
| 1614 // NetEqNetworkStatistics::expand_rate tells the fraction of samples that were |
| 1615 // concealment samples, in Q14 (16384 = 100%) .The vast majority should be |
| 1616 // concealment samples in this test. |
| 1617 EXPECT_GT(stats.expand_rate, 14000); |
| 1618 // And, it should be greater than the speech_expand_rate. |
| 1619 EXPECT_GT(stats.expand_rate, stats.speech_expand_rate); |
| 1611 } | 1620 } |
| 1612 | 1621 |
| 1613 // Verifies that NetEq goes out of muted state when given a delayed packet. | 1622 // Verifies that NetEq goes out of muted state when given a delayed packet. |
| 1614 TEST_F(NetEqDecodingTestWithMutedState, MutedStateDelayedPacket) { | 1623 TEST_F(NetEqDecodingTestWithMutedState, MutedStateDelayedPacket) { |
| 1615 // Insert one speech packet. | 1624 // Insert one speech packet. |
| 1616 InsertPacket(0); | 1625 InsertPacket(0); |
| 1617 // Pull out audio once and expect it not to be muted. | 1626 // Pull out audio once and expect it not to be muted. |
| 1618 EXPECT_FALSE(GetAudioReturnMuted()); | 1627 EXPECT_FALSE(GetAudioReturnMuted()); |
| 1619 // Pull data until faded out. | 1628 // Pull data until faded out. |
| 1620 GetAudioUntilMuted(); | 1629 GetAudioUntilMuted(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 if (muted) { | 1778 if (muted) { |
| 1770 EXPECT_TRUE(AudioFramesEqualExceptData(out_frame1, out_frame2)); | 1779 EXPECT_TRUE(AudioFramesEqualExceptData(out_frame1, out_frame2)); |
| 1771 } else { | 1780 } else { |
| 1772 EXPECT_TRUE(AudioFramesEqual(out_frame1, out_frame2)); | 1781 EXPECT_TRUE(AudioFramesEqual(out_frame1, out_frame2)); |
| 1773 } | 1782 } |
| 1774 } | 1783 } |
| 1775 EXPECT_FALSE(muted); | 1784 EXPECT_FALSE(muted); |
| 1776 } | 1785 } |
| 1777 | 1786 |
| 1778 } // namespace webrtc | 1787 } // namespace webrtc |
| OLD | NEW |