1 /* 2 * Copyright 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 #ifndef API_TRANSPORT_TEST_FEEDBACK_GENERATOR_INTERFACE_H_ 11 #define API_TRANSPORT_TEST_FEEDBACK_GENERATOR_INTERFACE_H_ 12 13 #include <vector> 14 15 #include "api/test/simulated_network.h" 16 #include "api/transport/network_types.h" 17 18 namespace webrtc { 19 class FeedbackGenerator { 20 public: 21 struct Config { 22 BuiltInNetworkBehaviorConfig send_link; 23 BuiltInNetworkBehaviorConfig return_link; 24 TimeDelta feedback_interval = TimeDelta::Millis(50); 25 DataSize feedback_packet_size = DataSize::Bytes(20); 26 }; 27 virtual ~FeedbackGenerator() = default; 28 virtual Timestamp Now() = 0; 29 virtual void Sleep(TimeDelta duration) = 0; 30 virtual void SendPacket(size_t size) = 0; 31 virtual std::vector<TransportPacketsFeedback> PopFeedback() = 0; 32 virtual void SetSendConfig(BuiltInNetworkBehaviorConfig config) = 0; 33 virtual void SetReturnConfig(BuiltInNetworkBehaviorConfig config) = 0; 34 virtual void SetSendLinkCapacity(DataRate capacity) = 0; 35 }; 36 } // namespace webrtc 37 #endif // API_TRANSPORT_TEST_FEEDBACK_GENERATOR_INTERFACE_H_ 38