| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 packet->header.header.timestamp, | 178 packet->header.header.timestamp, |
| 179 kRedPayloadType, | 179 kRedPayloadType, |
| 180 packet->header.header.payloadType, | 180 packet->header.header.payloadType, |
| 181 red_packet.get(), | 181 red_packet.get(), |
| 182 true); // Marker bit set. | 182 true); // Marker bit set. |
| 183 for (int i = 0; i < 10; ++i) | 183 for (int i = 0; i < 10; ++i) |
| 184 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); | 184 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); |
| 185 delete packet; | 185 delete packet; |
| 186 } | 186 } |
| 187 | 187 |
| 188 TEST_F(ProducerFecTest, BuildRedPacketWithEmptyPayload) { |
| 189 constexpr size_t kNumFrames = 1; |
| 190 constexpr size_t kPayloadLength = 0; |
| 191 constexpr size_t kRedForFecHeaderLength = 1; |
| 192 |
| 193 generator_.NewFrame(kNumFrames); |
| 194 std::unique_ptr<test::RawRtpPacket> packet( |
| 195 generator_.NextPacket(0, kPayloadLength)); |
| 196 std::unique_ptr<RedPacket> red_packet = |
| 197 ProducerFec::BuildRedPacket(packet->data, packet->length - kRtpHeaderSize, |
| 198 kRtpHeaderSize, kRedPayloadType); |
| 199 EXPECT_EQ(packet->length + kRedForFecHeaderLength, red_packet->length()); |
| 200 VerifyHeader(packet->header.header.sequenceNumber, |
| 201 packet->header.header.timestamp, kRedPayloadType, |
| 202 packet->header.header.payloadType, red_packet.get(), |
| 203 true); // Marker bit set. |
| 204 } |
| 205 |
| 188 } // namespace webrtc | 206 } // namespace webrtc |
| OLD | NEW |