Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc

Issue 2355503002: Stopped using the NetEqDecoder enum internally in NetEq. (Closed)
Patch Set: Clarified comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 kFirstTimestamp, kFirstReceiveTime)); 268 kFirstTimestamp, kFirstReceiveTime));
269 // BWE update function called with second packet. 269 // BWE update function called with second packet.
270 EXPECT_CALL( 270 EXPECT_CALL(
271 *mock_decoder, 271 *mock_decoder,
272 IncomingPacket(_, kPayloadLength, kFirstSequenceNumber + 1, 272 IncomingPacket(_, kPayloadLength, kFirstSequenceNumber + 1,
273 kFirstTimestamp + 160, kFirstReceiveTime + 155)); 273 kFirstTimestamp + 160, kFirstReceiveTime + 155));
274 EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted. 274 EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted.
275 275
276 *dec = std::move(mock_decoder); 276 *dec = std::move(mock_decoder);
277 })); 277 }));
278 DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "", 278 DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu,
279 mock_decoder_factory); 279 mock_decoder_factory);
280 280
281 // Expectations for decoder database. 281 // Expectations for decoder database.
282 EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType)) 282 EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType))
283 .WillRepeatedly(Return(&info)); 283 .WillRepeatedly(Return(&info));
284 284
285 // Expectations for packet buffer. 285 // Expectations for packet buffer.
286 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer()) 286 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer())
287 .WillOnce(Return(0)) // First packet. 287 .WillOnce(Return(0)) // First packet.
288 .WillOnce(Return(1)) // Second packet. 288 .WillOnce(Return(1)) // Second packet.
(...skipping 17 matching lines...) Expand all
306 306
307 // Expectations for DTMF buffer. 307 // Expectations for DTMF buffer.
308 EXPECT_CALL(*mock_dtmf_buffer_, Flush()) 308 EXPECT_CALL(*mock_dtmf_buffer_, Flush())
309 .Times(1); 309 .Times(1);
310 310
311 // Expectations for delay manager. 311 // Expectations for delay manager.
312 { 312 {
313 // All expectations within this block must be called in this specific order. 313 // All expectations within this block must be called in this specific order.
314 InSequence sequence; // Dummy variable. 314 InSequence sequence; // Dummy variable.
315 // Expectations when the first packet is inserted. 315 // Expectations when the first packet is inserted.
316 EXPECT_CALL(*mock_delay_manager_,
317 LastDecoderType(NetEqDecoder::kDecoderPCMu))
318 .Times(1);
319 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) 316 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
320 .Times(2) 317 .Times(2)
321 .WillRepeatedly(Return(-1)); 318 .WillRepeatedly(Return(-1));
322 EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0)) 319 EXPECT_CALL(*mock_delay_manager_, set_last_pack_cng_or_dtmf(0))
323 .Times(1); 320 .Times(1);
324 EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1); 321 EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1);
325 // Expectations when the second packet is inserted. Slightly different. 322 // Expectations when the second packet is inserted. Slightly different.
326 EXPECT_CALL(*mock_delay_manager_,
327 LastDecoderType(NetEqDecoder::kDecoderPCMu))
328 .Times(1);
329 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf()) 323 EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
330 .WillOnce(Return(0)); 324 .WillOnce(Return(0));
331 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30)) 325 EXPECT_CALL(*mock_delay_manager_, SetPacketAudioLength(30))
332 .WillOnce(Return(0)); 326 .WillOnce(Return(0));
333 } 327 }
334 328
335 // Insert first packet. 329 // Insert first packet.
336 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime); 330 neteq_->InsertPacket(rtp_header, payload, kFirstReceiveTime);
337 331
338 // Insert second packet. 332 // Insert second packet.
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) 1416 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _))
1423 .Times(1) 1417 .Times(1)
1424 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); 1418 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2)));
1425 1419
1426 bool muted; 1420 bool muted;
1427 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); 1421 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
1428 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); 1422 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test());
1429 } 1423 }
1430 1424
1431 }// namespace webrtc 1425 }// namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698