| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 void FuzzOneInput(const uint8_t* data, size_t size) { | 31 void FuzzOneInput(const uint8_t* data, size_t size) { |
| 32 size_t i = 0; | 32 size_t i = 0; |
| 33 if (size < 5) { | 33 if (size < 5) { |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 | 36 |
| 37 SimulatedClock clock(1 + data[i++]); | 37 SimulatedClock clock(1 + data[i++]); |
| 38 FlexfecSender sender(kFlexfecPayloadType, kFlexfecSsrc, kMediaSsrc, | 38 FlexfecSender sender(kFlexfecPayloadType, kFlexfecSsrc, kMediaSsrc, |
| 39 kNoRtpHeaderExtensions, kNoRtpHeaderExtensionSizes, | 39 kNoRtpHeaderExtensions, kNoRtpHeaderExtensionSizes, |
| 40 &clock); | 40 nullptr /* rtp_state */, &clock); |
| 41 FecProtectionParams params = { | 41 FecProtectionParams params = { |
| 42 data[i++], static_cast<int>(data[i++] % 100), | 42 data[i++], static_cast<int>(data[i++] % 100), |
| 43 data[i++] <= 127 ? kFecMaskRandom : kFecMaskBursty}; | 43 data[i++] <= 127 ? kFecMaskRandom : kFecMaskBursty}; |
| 44 sender.SetFecParameters(params); | 44 sender.SetFecParameters(params); |
| 45 uint16_t seq_num = data[i++]; | 45 uint16_t seq_num = data[i++]; |
| 46 | 46 |
| 47 while (i + 1 < size) { | 47 while (i + 1 < size) { |
| 48 // Everything past the base RTP header (12 bytes) is payload, | 48 // Everything past the base RTP header (12 bytes) is payload, |
| 49 // from the perspective of FlexFEC. | 49 // from the perspective of FlexFEC. |
| 50 size_t payload_size = data[i++]; | 50 size_t payload_size = data[i++]; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 break; | 61 break; |
| 62 sender.AddRtpPacketAndGenerateFec(rtp_packet); | 62 sender.AddRtpPacketAndGenerateFec(rtp_packet); |
| 63 if (sender.FecAvailable()) { | 63 if (sender.FecAvailable()) { |
| 64 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets = | 64 std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets = |
| 65 sender.GetFecPackets(); | 65 sender.GetFecPackets(); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace webrtc | 70 } // namespace webrtc |
| OLD | NEW |