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 
14 #include <memory>
15 
16 #include "test/fuzzers/utils/rtp_replayer.h"
17 
18 namespace webrtc {
19 
FuzzOneInput(const uint8_t * data,size_t size)20 void FuzzOneInput(const uint8_t* data, size_t size) {
21   auto stream_state = std::make_unique<test::RtpReplayer::StreamState>();
22   VideoReceiveStream::Config vp9_config(&(stream_state->transport));
23 
24   VideoReceiveStream::Decoder vp9_decoder;
25   vp9_decoder.video_format = SdpVideoFormat("VP9");
26   vp9_decoder.payload_type = 124;
27   vp9_config.decoders.push_back(std::move(vp9_decoder));
28 
29   vp9_config.rtp.local_ssrc = 7731;
30   vp9_config.rtp.remote_ssrc = 1337;
31   vp9_config.rtp.rtx_ssrc = 100;
32   vp9_config.rtp.transport_cc = true;
33   vp9_config.rtp.nack.rtp_history_ms = 1000;
34 
35   std::vector<VideoReceiveStream::Config> replay_configs;
36   replay_configs.push_back(std::move(vp9_config));
37 
38   test::RtpReplayer::Replay(std::move(stream_state), std::move(replay_configs),
39                             data, size);
40 }
41 
42 }  // namespace webrtc
43