Format almost everything.
This CL was generated by running git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \ grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \ grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \ grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \ grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \ | xargs clang-format -i ; git cl format Most of these changes are clang-format grouping and reordering includes differently. Bug: webrtc:9340 Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051 Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28505}
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/audio_coding/neteq/neteq_impl.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -26,7 +28,6 @@
|
||||
#include "modules/audio_coding/neteq/mock/mock_dtmf_tone_generator.h"
|
||||
#include "modules/audio_coding/neteq/mock/mock_packet_buffer.h"
|
||||
#include "modules/audio_coding/neteq/mock/mock_red_payload_splitter.h"
|
||||
#include "modules/audio_coding/neteq/neteq_impl.h"
|
||||
#include "modules/audio_coding/neteq/preemptive_expand.h"
|
||||
#include "modules/audio_coding/neteq/statistics_calculator.h"
|
||||
#include "modules/audio_coding/neteq/sync_buffer.h"
|
||||
@ -198,7 +199,7 @@ class NetEqImplTest : public ::testing::Test {
|
||||
UseNoMocks();
|
||||
CreateInstance();
|
||||
// Event: 2, E bit, Volume: 17, Length: 4336.
|
||||
uint8_t payload[kPayloadLength] = { 0x02, 0x80 + 0x11, 0x10, 0xF0 };
|
||||
uint8_t payload[kPayloadLength] = {0x02, 0x80 + 0x11, 0x10, 0xF0};
|
||||
RTPHeader rtp_header;
|
||||
rtp_header.payloadType = kPayloadType;
|
||||
rtp_header.sequenceNumber = 0x1234;
|
||||
@ -228,13 +229,14 @@ class NetEqImplTest : public ::testing::Test {
|
||||
EXPECT_THAT(output.packet_infos_, IsEmpty());
|
||||
|
||||
// Verify first 64 samples of actual output.
|
||||
const std::vector<int16_t> kOutput({
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1578, -2816, -3460, -3403, -2709, -1594,
|
||||
-363, 671, 1269, 1328, 908, 202, -513, -964, -955, -431, 504, 1617,
|
||||
2602, 3164, 3101, 2364, 1073, -511, -2047, -3198, -3721, -3525, -2688,
|
||||
-1440, -99, 1015, 1663, 1744, 1319, 588, -171, -680, -747, -315, 515,
|
||||
1512, 2378, 2828, 2674, 1877, 568, -986, -2446, -3482, -3864, -3516,
|
||||
-2534, -1163 });
|
||||
const std::vector<int16_t> kOutput(
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
-1578, -2816, -3460, -3403, -2709, -1594, -363, 671, 1269, 1328,
|
||||
908, 202, -513, -964, -955, -431, 504, 1617, 2602, 3164,
|
||||
3101, 2364, 1073, -511, -2047, -3198, -3721, -3525, -2688, -1440,
|
||||
-99, 1015, 1663, 1744, 1319, 588, -171, -680, -747, -315,
|
||||
515, 1512, 2378, 2828, 2674, 1877, 568, -986, -2446, -3482,
|
||||
-3864, -3516, -2534, -1163});
|
||||
ASSERT_GE(kMaxOutputSize, kOutput.size());
|
||||
EXPECT_TRUE(std::equal(kOutput.begin(), kOutput.end(), output.data()));
|
||||
}
|
||||
@ -269,7 +271,6 @@ class NetEqImplTest : public ::testing::Test {
|
||||
bool use_mock_payload_splitter_ = true;
|
||||
};
|
||||
|
||||
|
||||
// This tests the interface class NetEq.
|
||||
// TODO(hlundin): Move to separate file?
|
||||
TEST(NetEq, CreateAndDestroy) {
|
||||
@ -358,8 +359,7 @@ TEST_F(NetEqImplTest, InsertPacket) {
|
||||
// Expectations for packet buffer.
|
||||
EXPECT_CALL(*mock_packet_buffer_, Empty())
|
||||
.WillOnce(Return(false)); // Called once after first packet is inserted.
|
||||
EXPECT_CALL(*mock_packet_buffer_, Flush())
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_packet_buffer_, Flush()).Times(1);
|
||||
EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _, _))
|
||||
.Times(2)
|
||||
.WillRepeatedly(DoAll(SetArgPointee<2>(kPayloadType),
|
||||
@ -373,8 +373,7 @@ TEST_F(NetEqImplTest, InsertPacket) {
|
||||
.WillOnce(Return(&fake_packet));
|
||||
|
||||
// Expectations for DTMF buffer.
|
||||
EXPECT_CALL(*mock_dtmf_buffer_, Flush())
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_dtmf_buffer_, Flush()).Times(1);
|
||||
|
||||
// Expectations for delay manager.
|
||||
{
|
||||
@ -384,8 +383,7 @@ TEST_F(NetEqImplTest, InsertPacket) {
|
||||
EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
|
||||
.Times(2)
|
||||
.WillRepeatedly(Return(-1));
|
||||
EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0))
|
||||
.Times(1);
|
||||
EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0)).Times(1);
|
||||
EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1);
|
||||
// Expectations when the second packet is inserted. Slightly different.
|
||||
EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
|
||||
@ -409,7 +407,7 @@ TEST_F(NetEqImplTest, InsertPacketsUntilBufferIsFull) {
|
||||
|
||||
const int kPayloadLengthSamples = 80;
|
||||
const size_t kPayloadLengthBytes = 2 * kPayloadLengthSamples; // PCM 16-bit.
|
||||
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
||||
const uint8_t kPayloadType = 17; // Just an arbitrary number.
|
||||
const uint32_t kReceiveTime = 17; // Value doesn't matter for this test.
|
||||
uint8_t payload[kPayloadLengthBytes] = {0};
|
||||
RTPHeader rtp_header;
|
||||
@ -896,18 +894,18 @@ TEST_F(NetEqImplTest, CodecInternalCng) {
|
||||
const size_t kMaxOutputSize = static_cast<size_t>(10 * kSampleRateKhz);
|
||||
AudioFrame output;
|
||||
AudioFrame::SpeechType expected_type[8] = {
|
||||
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech,
|
||||
AudioFrame::kCNG, AudioFrame::kCNG,
|
||||
AudioFrame::kCNG, AudioFrame::kCNG,
|
||||
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech
|
||||
};
|
||||
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech, AudioFrame::kCNG,
|
||||
AudioFrame::kCNG, AudioFrame::kCNG, AudioFrame::kCNG,
|
||||
AudioFrame::kNormalSpeech, AudioFrame::kNormalSpeech};
|
||||
int expected_timestamp_increment[8] = {
|
||||
-1, // will not be used.
|
||||
10 * kSampleRateKhz,
|
||||
-1, -1, // timestamp will be empty during CNG mode; indicated by -1 here.
|
||||
-1, -1,
|
||||
50 * kSampleRateKhz, 10 * kSampleRateKhz
|
||||
};
|
||||
-1,
|
||||
-1, // timestamp will be empty during CNG mode; indicated by -1 here.
|
||||
-1,
|
||||
-1,
|
||||
50 * kSampleRateKhz,
|
||||
10 * kSampleRateKhz};
|
||||
|
||||
bool muted;
|
||||
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
|
||||
@ -1008,11 +1006,9 @@ TEST_F(NetEqImplTest, UnsupportedDecoder) {
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(rtc::checked_cast<int>(kNetEqMaxFrameSize)));
|
||||
|
||||
EXPECT_CALL(decoder, SampleRateHz())
|
||||
.WillRepeatedly(Return(kSampleRateHz));
|
||||
EXPECT_CALL(decoder, SampleRateHz()).WillRepeatedly(Return(kSampleRateHz));
|
||||
|
||||
EXPECT_CALL(decoder, Channels())
|
||||
.WillRepeatedly(Return(kChannels));
|
||||
EXPECT_CALL(decoder, Channels()).WillRepeatedly(Return(kChannels));
|
||||
|
||||
EXPECT_TRUE(neteq_->RegisterPayloadType(kPayloadType,
|
||||
SdpAudioFormat("L16", 8000, 1)));
|
||||
@ -1190,10 +1186,8 @@ TEST_F(NetEqImplTest, DecodingError) {
|
||||
.WillRepeatedly(Return(0));
|
||||
EXPECT_CALL(mock_decoder, PacketDuration(_, _))
|
||||
.WillRepeatedly(Return(rtc::checked_cast<int>(kFrameLengthSamples)));
|
||||
EXPECT_CALL(mock_decoder, ErrorCode())
|
||||
.WillOnce(Return(kDecoderErrorCode));
|
||||
EXPECT_CALL(mock_decoder, HasDecodePlc())
|
||||
.WillOnce(Return(false));
|
||||
EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode));
|
||||
EXPECT_CALL(mock_decoder, HasDecodePlc()).WillOnce(Return(false));
|
||||
int16_t dummy_output[kFrameLengthSamples] = {0};
|
||||
|
||||
{
|
||||
@ -1308,8 +1302,7 @@ TEST_F(NetEqImplTest, DecodingErrorDuringInternalCng) {
|
||||
.WillRepeatedly(Return(0));
|
||||
EXPECT_CALL(mock_decoder, PacketDuration(_, _))
|
||||
.WillRepeatedly(Return(rtc::checked_cast<int>(kFrameLengthSamples)));
|
||||
EXPECT_CALL(mock_decoder, ErrorCode())
|
||||
.WillOnce(Return(kDecoderErrorCode));
|
||||
EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode));
|
||||
int16_t dummy_output[kFrameLengthSamples] = {0};
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user