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 |
11 #include <list> | 11 #include <list> |
12 #include <memory> | |
13 #include <vector> | 12 #include <vector> |
14 | 13 |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 15 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
17 #include "webrtc/modules/rtp_rtcp/source/fec_test_helper.h" | 16 #include "webrtc/modules/rtp_rtcp/source/fec_test_helper.h" |
18 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | 17 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
19 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" | 18 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" |
20 | 19 |
21 namespace webrtc { | 20 namespace webrtc { |
22 | 21 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 while (!rtp_packets.empty()) { | 181 while (!rtp_packets.empty()) { |
183 delete rtp_packets.front(); | 182 delete rtp_packets.front(); |
184 rtp_packets.pop_front(); | 183 rtp_packets.pop_front(); |
185 } | 184 } |
186 delete packets.front(); | 185 delete packets.front(); |
187 } | 186 } |
188 | 187 |
189 TEST_F(ProducerFecTest, BuildRedPacket) { | 188 TEST_F(ProducerFecTest, BuildRedPacket) { |
190 generator_->NewFrame(1); | 189 generator_->NewFrame(1); |
191 test::RawRtpPacket* packet = generator_->NextPacket(0, 10); | 190 test::RawRtpPacket* packet = generator_->NextPacket(0, 10); |
192 std::unique_ptr<RedPacket> red_packet(producer_->BuildRedPacket( | 191 rtc::scoped_ptr<RedPacket> red_packet(producer_->BuildRedPacket( |
193 packet->data, packet->length - kRtpHeaderSize, kRtpHeaderSize, | 192 packet->data, packet->length - kRtpHeaderSize, kRtpHeaderSize, |
194 kRedPayloadType)); | 193 kRedPayloadType)); |
195 EXPECT_EQ(packet->length + 1, red_packet->length()); | 194 EXPECT_EQ(packet->length + 1, red_packet->length()); |
196 VerifyHeader(packet->header.header.sequenceNumber, | 195 VerifyHeader(packet->header.header.sequenceNumber, |
197 packet->header.header.timestamp, | 196 packet->header.header.timestamp, |
198 kRedPayloadType, | 197 kRedPayloadType, |
199 packet->header.header.payloadType, | 198 packet->header.header.payloadType, |
200 red_packet.get(), | 199 red_packet.get(), |
201 true); // Marker bit set. | 200 true); // Marker bit set. |
202 for (int i = 0; i < 10; ++i) | 201 for (int i = 0; i < 10; ++i) |
203 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); | 202 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); |
204 delete packet; | 203 delete packet; |
205 } | 204 } |
206 | 205 |
207 } // namespace webrtc | 206 } // namespace webrtc |
OLD | NEW |