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