OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 } | 54 } |
55 // Expose methods for tests. | 55 // Expose methods for tests. |
56 using FlexfecReceiver::AddReceivedPacket; | 56 using FlexfecReceiver::AddReceivedPacket; |
57 using FlexfecReceiver::ProcessReceivedPackets; | 57 using FlexfecReceiver::ProcessReceivedPackets; |
58 }; | 58 }; |
59 | 59 |
60 class FlexfecReceiverTest : public ::testing::Test { | 60 class FlexfecReceiverTest : public ::testing::Test { |
61 protected: | 61 protected: |
62 FlexfecReceiverTest() | 62 FlexfecReceiverTest() |
63 : receiver_(kFlexfecSsrc, kMediaSsrc, &recovered_packet_receiver_), | 63 : receiver_(kFlexfecSsrc, kMediaSsrc, &recovered_packet_receiver_), |
64 erasure_code_(ForwardErrorCorrection::CreateFlexfec()), | 64 erasure_code_( |
| 65 ForwardErrorCorrection::CreateFlexfec(kFlexfecSsrc, kMediaSsrc)), |
65 packet_generator_(kMediaSsrc, kFlexfecSsrc) {} | 66 packet_generator_(kMediaSsrc, kFlexfecSsrc) {} |
66 | 67 |
67 // Generates |num_media_packets| corresponding to a single frame. | 68 // Generates |num_media_packets| corresponding to a single frame. |
68 void PacketizeFrame(size_t num_media_packets, | 69 void PacketizeFrame(size_t num_media_packets, |
69 size_t frame_offset, | 70 size_t frame_offset, |
70 PacketList* media_packets); | 71 PacketList* media_packets); |
71 | 72 |
72 // Generates |num_fec_packets| FEC packets, given |media_packets|. | 73 // Generates |num_fec_packets| FEC packets, given |media_packets|. |
73 std::list<Packet*> EncodeFec(const PacketList& media_packets, | 74 std::list<Packet*> EncodeFec(const PacketList& media_packets, |
74 size_t num_fec_packets); | 75 size_t num_fec_packets); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 receiver_.OnRtpPacket(ParsePacket(*packet_with_rtp_header)); | 562 receiver_.OnRtpPacket(ParsePacket(*packet_with_rtp_header)); |
562 | 563 |
563 // Check stats calculations. | 564 // Check stats calculations. |
564 FecPacketCounter packet_counter = receiver_.GetPacketCounter(); | 565 FecPacketCounter packet_counter = receiver_.GetPacketCounter(); |
565 EXPECT_EQ(2U, packet_counter.num_packets); | 566 EXPECT_EQ(2U, packet_counter.num_packets); |
566 EXPECT_EQ(1U, packet_counter.num_fec_packets); | 567 EXPECT_EQ(1U, packet_counter.num_fec_packets); |
567 EXPECT_EQ(1U, packet_counter.num_recovered_packets); | 568 EXPECT_EQ(1U, packet_counter.num_recovered_packets); |
568 } | 569 } |
569 | 570 |
570 } // namespace webrtc | 571 } // namespace webrtc |
OLD | NEW |