blob: 6630427b1a2b24b282c7ec49e438ba0a348d22e8 [file] [log] [blame]
Artem Titov46c4e602018-08-17 14:26:54 +02001/*
2 * Copyright (c) 2018 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#ifndef CALL_SIMULATED_PACKET_RECEIVER_H_
12#define CALL_SIMULATED_PACKET_RECEIVER_H_
13
14#include "api/test/simulated_network.h"
15#include "call/packet_receiver.h"
16#include "modules/include/module.h"
17
18namespace webrtc {
19
20// Private API that is fixing surface between DirectTransport and underlying
21// network conditions simulation implementation.
22class SimulatedPacketReceiverInterface : public PacketReceiver, public Module {
23 public:
24 // Must not be called in parallel with DeliverPacket or Process.
25 // Destination receiver will be injected with this method
26 virtual void SetReceiver(PacketReceiver* receiver) = 0;
27
28 // Reports average packet delay.
29 virtual int AverageDelay() = 0;
30
31 // Deprecated. DO NOT USE. Temporary added to be able to introduce
32 // SimulatedPacketReceiverInterface into DirectTransport instead of
33 // FakeNetworkPipe, will be removed soon.
34 virtual void SetClockOffset(int64_t offset_ms) = 0;
35
36 // Deprecated. DO NOT USE. Temporary added to be able to introduce
37 // SimulatedPacketReceiverInterface into DirectTransport instead of
38 // FakeNetworkPipe, will be removed soon.
39 virtual void SetConfig(const DefaultNetworkSimulationConfig& config) = 0;
40};
41
42} // namespace webrtc
43
44#endif // CALL_SIMULATED_PACKET_RECEIVER_H_