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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 packet_list.push_back(packet); | 310 packet_list.push_back(packet); |
311 } | 311 } |
312 | 312 |
313 // Use a real DecoderDatabase object here instead of a mock, since it is | 313 // Use a real DecoderDatabase object here instead of a mock, since it is |
314 // easier to just register the payload types and let the actual implementation | 314 // easier to just register the payload types and let the actual implementation |
315 // do its job. | 315 // do its job. |
316 DecoderDatabase decoder_database( | 316 DecoderDatabase decoder_database( |
317 new rtc::RefCountedObject<MockAudioDecoderFactory>); | 317 new rtc::RefCountedObject<MockAudioDecoderFactory>); |
318 decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderCNGnb, "cng-nb"); | 318 decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderCNGnb, "cng-nb"); |
319 decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu, "pcmu"); | 319 decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu, "pcmu"); |
320 decoder_database.RegisterPayload(2, NetEqDecoder::kDecoderAVT, "avt"); | 320 decoder_database.RegisterPayload(2, NetEqDecoder::kDecoderAVT8kHz, "avt"); |
321 decoder_database.RegisterPayload(3, NetEqDecoder::kDecoderILBC, "ilbc"); | 321 decoder_database.RegisterPayload(3, NetEqDecoder::kDecoderILBC, "ilbc"); |
322 | 322 |
323 RedPayloadSplitter splitter; | 323 RedPayloadSplitter splitter; |
324 splitter.CheckRedPayloads(&packet_list, decoder_database); | 324 splitter.CheckRedPayloads(&packet_list, decoder_database); |
325 | 325 |
326 ASSERT_EQ(3u, packet_list.size()); // Should have dropped the last packet. | 326 ASSERT_EQ(3u, packet_list.size()); // Should have dropped the last packet. |
327 // Verify packets. The loop verifies that payload types 0, 1, and 2 are in the | 327 // Verify packets. The loop verifies that payload types 0, 1, and 2 are in the |
328 // list. | 328 // list. |
329 for (int i = 0; i <= 2; ++i) { | 329 for (int i = 0; i <= 2; ++i) { |
330 Packet* packet = packet_list.front(); | 330 Packet* packet = packet_list.front(); |
(...skipping 21 matching lines...) Expand all Loading... |
352 ASSERT_EQ(1u, packet_list.size()); | 352 ASSERT_EQ(1u, packet_list.size()); |
353 // Check first packet. | 353 // Check first packet. |
354 packet = packet_list.front(); | 354 packet = packet_list.front(); |
355 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, | 355 VerifyPacket(packet, kPayloadLength, payload_types[0], kSequenceNumber, |
356 kBaseTimestamp - 2 * kTimestampOffset, 0, {0, 2}); | 356 kBaseTimestamp - 2 * kTimestampOffset, 0, {0, 2}); |
357 delete packet; | 357 delete packet; |
358 packet_list.pop_front(); | 358 packet_list.pop_front(); |
359 } | 359 } |
360 | 360 |
361 } // namespace webrtc | 361 } // namespace webrtc |
OLD | NEW |