Benjamin Wright | 47dbcab | 2019-03-14 15:01:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <stddef.h> |
| 12 | #include <stdint.h> |
| 13 | |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
Benjamin Wright | 47dbcab | 2019-03-14 15:01:30 -0700 | [diff] [blame] | 16 | #include "test/fuzzers/utils/rtp_replayer.h" |
| 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | void FuzzOneInput(const uint8_t* data, size_t size) { |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 21 | auto stream_state = std::make_unique<test::RtpReplayer::StreamState>(); |
Benjamin Wright | 47dbcab | 2019-03-14 15:01:30 -0700 | [diff] [blame] | 22 | VideoReceiveStream::Config vp8_config(&(stream_state->transport)); |
| 23 | |
| 24 | VideoReceiveStream::Decoder vp8_decoder; |
| 25 | vp8_decoder.video_format = SdpVideoFormat("VP8"); |
| 26 | vp8_decoder.payload_type = 125; |
| 27 | vp8_config.decoders.push_back(std::move(vp8_decoder)); |
| 28 | |
| 29 | vp8_config.rtp.local_ssrc = 7731; |
| 30 | vp8_config.rtp.remote_ssrc = 1337; |
| 31 | vp8_config.rtp.rtx_ssrc = 100; |
| 32 | vp8_config.rtp.transport_cc = true; |
Benjamin Wright | 47dbcab | 2019-03-14 15:01:30 -0700 | [diff] [blame] | 33 | vp8_config.rtp.nack.rtp_history_ms = 1000; |
Elad Alon | fadb181 | 2019-05-24 13:40:02 +0200 | [diff] [blame] | 34 | vp8_config.rtp.lntf.enabled = true; |
Benjamin Wright | 47dbcab | 2019-03-14 15:01:30 -0700 | [diff] [blame] | 35 | |
| 36 | std::vector<VideoReceiveStream::Config> replay_configs; |
| 37 | replay_configs.push_back(std::move(vp8_config)); |
| 38 | |
| 39 | test::RtpReplayer::Replay(std::move(stream_state), std::move(replay_configs), |
| 40 | data, size); |
| 41 | } |
| 42 | |
| 43 | } // namespace webrtc |