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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 kFirstTimestamp, kFirstReceiveTime)); | 262 kFirstTimestamp, kFirstReceiveTime)); |
263 // BWE update function called with second packet. | 263 // BWE update function called with second packet. |
264 EXPECT_CALL( | 264 EXPECT_CALL( |
265 *mock_decoder, | 265 *mock_decoder, |
266 IncomingPacket(_, kPayloadLength, kFirstSequenceNumber + 1, | 266 IncomingPacket(_, kPayloadLength, kFirstSequenceNumber + 1, |
267 kFirstTimestamp + 160, kFirstReceiveTime + 155)); | 267 kFirstTimestamp + 160, kFirstReceiveTime + 155)); |
268 EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted. | 268 EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted. |
269 | 269 |
270 *dec = std::move(mock_decoder); | 270 *dec = std::move(mock_decoder); |
271 })); | 271 })); |
272 DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "", | 272 DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, |
273 mock_decoder_factory); | 273 mock_decoder_factory); |
274 | 274 |
275 // Expectations for decoder database. | 275 // Expectations for decoder database. |
276 EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType)) | 276 EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType)) |
277 .WillRepeatedly(Return(&info)); | 277 .WillRepeatedly(Return(&info)); |
278 | 278 |
279 // Expectations for packet buffer. | 279 // Expectations for packet buffer. |
280 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer()) | 280 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer()) |
281 .WillOnce(Return(0)) // First packet. | 281 .WillOnce(Return(0)) // First packet. |
282 .WillOnce(Return(1)) // Second packet. | 282 .WillOnce(Return(1)) // Second packet. |
(...skipping 17 matching lines...) Expand all Loading... |
300 | 300 |
301 // Expectations for DTMF buffer. | 301 // Expectations for DTMF buffer. |
302 EXPECT_CALL(*mock_dtmf_buffer_, Flush()) | 302 EXPECT_CALL(*mock_dtmf_buffer_, Flush()) |
303 .Times(1); | 303 .Times(1); |
304 | 304 |
305 // Expectations for delay manager. | 305 // Expectations for delay manager. |
306 { | 306 { |
307 // All expectations within this block must be called in this specific order. | 307 // All expectations within this block must be called in this specific order. |
308 InSequence sequence; // Dummy variable. | 308 InSequence sequence; // Dummy variable. |
309 // Expectations when the first packet is inserted. | 309 // Expectations when the first packet is inserted. |
310 EXPECT_CALL(*mock_delay_manager_, | |
311 LastDecoderType(NetEqDecoder::kDecoderPCMu)) | |
312 .Times(1); | |
313 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) | 310 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) |
314 .Times(2) | 311 .Times(2) |
315 .WillRepeatedly(Return(-1)); | 312 .WillRepeatedly(Return(-1)); |
316 EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0)) | 313 EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0)) |
317 .Times(1); | 314 .Times(1); |
318 EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1); | 315 EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1); |
319 // Expectations when the second packet is inserted. Slightly different. | 316 // Expectations when the second packet is inserted. Slightly different. |
320 EXPECT_CALL(*mock_delay_manager_, | |
321 LastDecoderType(NetEqDecoder::kDecoderPCMu)) | |
322 .Times(1); | |
323 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) | 317 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) |
324 .WillOnce(Return(0)); | 318 .WillOnce(Return(0)); |
325 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30)) | 319 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30)) |
326 .WillOnce(Return(0)); | 320 .WillOnce(Return(0)); |
327 } | 321 } |
328 | 322 |
329 // Insert first packet. | 323 // Insert first packet. |
330 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime); | 324 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime); |
331 | 325 |
332 // Insert second packet. | 326 // Insert second packet. |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) | 1410 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) |
1417 .Times(1) | 1411 .Times(1) |
1418 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); | 1412 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); |
1419 | 1413 |
1420 bool muted; | 1414 bool muted; |
1421 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); | 1415 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); |
1422 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); | 1416 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); |
1423 } | 1417 } |
1424 | 1418 |
1425 }// namespace webrtc | 1419 }// namespace webrtc |
OLD | NEW |