| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 EXPECT_CALL(*mock_delay_manager_, | 320 EXPECT_CALL(*mock_delay_manager_, |
| 321 LastDecoderType(NetEqDecoder::kDecoderPCMu)) | 321 LastDecoderType(NetEqDecoder::kDecoderPCMu)) |
| 322 .Times(1); | 322 .Times(1); |
| 323 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) | 323 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) |
| 324 .WillOnce(Return(0)); | 324 .WillOnce(Return(0)); |
| 325 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30)) | 325 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30)) |
| 326 .WillOnce(Return(0)); | 326 .WillOnce(Return(0)); |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Expectations for payload splitter. | 329 // Expectations for payload splitter. |
| 330 EXPECT_CALL(*mock_payload_splitter_, SplitFec(_, _)) |
| 331 .Times(2) |
| 332 .WillRepeatedly(Return(PayloadSplitter::kOK)); |
| 330 EXPECT_CALL(*mock_payload_splitter_, SplitAudio(_, _)) | 333 EXPECT_CALL(*mock_payload_splitter_, SplitAudio(_, _)) |
| 331 .Times(2) | 334 .Times(2) |
| 332 .WillRepeatedly(Return(PayloadSplitter::kOK)); | 335 .WillRepeatedly(Return(PayloadSplitter::kOK)); |
| 333 | 336 |
| 334 // Insert first packet. | 337 // Insert first packet. |
| 335 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime); | 338 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime); |
| 336 | 339 |
| 337 // Insert second packet. | 340 // Insert second packet. |
| 338 rtp_header.header.timestamp += 160; | 341 rtp_header.header.timestamp += 160; |
| 339 rtp_header.header.sequenceNumber += 1; | 342 rtp_header.header.sequenceNumber += 1; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 rtp_header.header.sequenceNumber = 0x1234; | 488 rtp_header.header.sequenceNumber = 0x1234; |
| 486 rtp_header.header.timestamp = 0x12345678; | 489 rtp_header.header.timestamp = 0x12345678; |
| 487 rtp_header.header.ssrc = 0x87654321; | 490 rtp_header.header.ssrc = 0x87654321; |
| 488 | 491 |
| 489 // Create a mock decoder object. | 492 // Create a mock decoder object. |
| 490 MockAudioDecoder mock_decoder; | 493 MockAudioDecoder mock_decoder; |
| 491 EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return()); | 494 EXPECT_CALL(mock_decoder, Reset()).WillRepeatedly(Return()); |
| 492 EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); | 495 EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); |
| 493 EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) | 496 EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) |
| 494 .WillRepeatedly(Return(0)); | 497 .WillRepeatedly(Return(0)); |
| 498 EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes)) |
| 499 .WillRepeatedly(Return(kPayloadLengthSamples)); |
| 495 int16_t dummy_output[kPayloadLengthSamples] = {0}; | 500 int16_t dummy_output[kPayloadLengthSamples] = {0}; |
| 496 // The below expectation will make the mock decoder write | 501 // The below expectation will make the mock decoder write |
| 497 // |kPayloadLengthSamples| zeros to the output array, and mark it as speech. | 502 // |kPayloadLengthSamples| zeros to the output array, and mark it as speech. |
| 498 EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(0), kPayloadLengthBytes, | 503 EXPECT_CALL(mock_decoder, DecodeInternal(Pointee(0), kPayloadLengthBytes, |
| 499 kSampleRateHz, _, _)) | 504 kSampleRateHz, _, _)) |
| 500 .WillOnce(DoAll(SetArrayArgument<3>(dummy_output, | 505 .WillOnce(DoAll(SetArrayArgument<3>(dummy_output, |
| 501 dummy_output + kPayloadLengthSamples), | 506 dummy_output + kPayloadLengthSamples), |
| 502 SetArgPointee<4>(AudioDecoder::kSpeech), | 507 SetArgPointee<4>(AudioDecoder::kSpeech), |
| 503 Return(kPayloadLengthSamples))); | 508 Return(kPayloadLengthSamples))); |
| 504 EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder( | 509 EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder( |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 UseNoMocks(); | 1178 UseNoMocks(); |
| 1174 CreateInstance(); | 1179 CreateInstance(); |
| 1175 ASSERT_TRUE(tick_timer_); | 1180 ASSERT_TRUE(tick_timer_); |
| 1176 EXPECT_EQ(0u, tick_timer_->ticks()); | 1181 EXPECT_EQ(0u, tick_timer_->ticks()); |
| 1177 AudioFrame output; | 1182 AudioFrame output; |
| 1178 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output)); | 1183 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output)); |
| 1179 EXPECT_EQ(1u, tick_timer_->ticks()); | 1184 EXPECT_EQ(1u, tick_timer_->ticks()); |
| 1180 } | 1185 } |
| 1181 | 1186 |
| 1182 }// namespace webrtc | 1187 }// namespace webrtc |
| OLD | NEW |