blob: 9bc48b10a09bd84be63eed4e5e65713bdfc09d6e [file] [log] [blame]
solenberg13725082015-11-25 08:16:52 -08001/*
2 * Copyright (c) 2015 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef TEST_MOCK_VOE_CHANNEL_PROXY_H_
12#define TEST_MOCK_VOE_CHANNEL_PROXY_H_
solenberg13725082015-11-25 08:16:52 -080013
14#include <string>
kwibergac9f8762016-09-30 22:29:43 -070015
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/rtp_rtcp/source/rtp_packet_received.h"
17#include "test/gmock.h"
18#include "voice_engine/channel_proxy.h"
solenberg13725082015-11-25 08:16:52 -080019
20namespace webrtc {
21namespace test {
22
23class MockVoEChannelProxy : public voe::ChannelProxy {
24 public:
ossu1ffbd6c2017-04-06 12:05:04 -070025 // GTest doesn't like move-only types, like std::unique_ptr
26 bool SetEncoder(int payload_type,
27 std::unique_ptr<AudioEncoder> encoder) {
28 return SetEncoderForMock(payload_type, &encoder);
29 }
30 MOCK_METHOD2(SetEncoderForMock,
31 bool(int payload_type,
32 std::unique_ptr<AudioEncoder>* encoder));
ossu20a4b3f2017-04-27 02:08:52 -070033 MOCK_METHOD1(
34 ModifyEncoder,
35 void(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier));
solenberg13725082015-11-25 08:16:52 -080036 MOCK_METHOD1(SetRTCPStatus, void(bool enable));
37 MOCK_METHOD1(SetLocalSSRC, void(uint32_t ssrc));
38 MOCK_METHOD1(SetRTCP_CNAME, void(const std::string& c_name));
solenberg971cab02016-06-14 10:02:41 -070039 MOCK_METHOD2(SetNACKStatus, void(bool enable, int max_packets));
solenberg358057b2015-11-27 10:46:42 -080040 MOCK_METHOD2(SetSendAudioLevelIndicationStatus, void(bool enable, int id));
solenberg358057b2015-11-27 10:46:42 -080041 MOCK_METHOD2(SetReceiveAudioLevelIndicationStatus, void(bool enable, int id));
stefan3313ec92016-01-21 06:32:43 -080042 MOCK_METHOD1(EnableSendTransportSequenceNumber, void(int id));
43 MOCK_METHOD1(EnableReceiveTransportSequenceNumber, void(int id));
nisseb8f9a322017-03-27 05:36:15 -070044 MOCK_METHOD2(RegisterSenderCongestionControlObjects,
45 void(RtpTransportControllerSendInterface* transport,
stefan7de8d642017-02-07 07:14:08 -080046 RtcpBandwidthObserver* bandwidth_observer));
stefanbba9dec2016-02-01 04:39:55 -080047 MOCK_METHOD1(RegisterReceiverCongestionControlObjects,
48 void(PacketRouter* packet_router));
nissefdbfdc92017-03-31 05:44:52 -070049 MOCK_METHOD0(ResetSenderCongestionControlObjects, void());
50 MOCK_METHOD0(ResetReceiverCongestionControlObjects, void());
solenberg358057b2015-11-27 10:46:42 -080051 MOCK_CONST_METHOD0(GetRTCPStatistics, CallStatistics());
52 MOCK_CONST_METHOD0(GetRemoteRTCPReportBlocks, std::vector<ReportBlock>());
53 MOCK_CONST_METHOD0(GetNetworkStatistics, NetworkStatistics());
54 MOCK_CONST_METHOD0(GetDecodingCallStatistics, AudioDecodingCallStats());
ivoce1198e02017-09-08 08:13:19 -070055 MOCK_CONST_METHOD0(GetANAStatistics, ANAStats());
solenberg8d73f8c2017-03-08 01:52:20 -080056 MOCK_CONST_METHOD0(GetSpeechOutputLevel, int());
57 MOCK_CONST_METHOD0(GetSpeechOutputLevelFullRange, int());
zsteine76bd3a2017-07-14 12:17:49 -070058 MOCK_CONST_METHOD0(GetTotalOutputEnergy, double());
59 MOCK_CONST_METHOD0(GetTotalOutputDuration, double());
solenberg358057b2015-11-27 10:46:42 -080060 MOCK_CONST_METHOD0(GetDelayEstimate, uint32_t());
solenbergffbbcac2016-11-17 05:25:37 -080061 MOCK_METHOD2(SetSendTelephoneEventPayloadType, bool(int payload_type,
62 int payload_frequency));
solenberg8842c3e2016-03-11 03:06:41 -080063 MOCK_METHOD2(SendTelephoneEventOutband, bool(int event, int duration_ms));
minyue78b4d562016-11-30 04:47:39 -080064 MOCK_METHOD2(SetBitrate, void(int bitrate_bps, int64_t probing_interval_ms));
solenberg217fb662016-06-17 08:30:54 -070065 // TODO(solenberg): Talk the compiler into accepting this mock method:
66 // MOCK_METHOD1(SetSink, void(std::unique_ptr<AudioSinkInterface> sink));
solenberg7602aab2016-11-14 11:30:07 -080067 MOCK_METHOD1(SetInputMute, void(bool muted));
solenberg1c239d42017-09-29 06:00:28 -070068 MOCK_METHOD1(RegisterTransport, void(Transport* transport));
nisse657bab22017-02-21 06:28:10 -080069 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived& packet));
mflodman3d7db262016-04-29 00:57:13 -070070 MOCK_METHOD2(ReceivedRTCPPacket, bool(const uint8_t* packet, size_t length));
ossu29b1a8d2016-06-13 07:34:51 -070071 MOCK_CONST_METHOD0(GetAudioDecoderFactory,
72 const rtc::scoped_refptr<AudioDecoderFactory>&());
solenberg217fb662016-06-17 08:30:54 -070073 MOCK_METHOD1(SetChannelOutputVolumeScaling, void(float scaling));
ivoc14d5dbe2016-07-04 07:06:55 -070074 MOCK_METHOD1(SetRtcEventLog, void(RtcEventLog* event_log));
michaelt9332b7d2016-11-30 07:51:13 -080075 MOCK_METHOD1(SetRtcpRttStats, void(RtcpRttStats* rtcp_rtt_stats));
solenberg7602aab2016-11-14 11:30:07 -080076 MOCK_METHOD2(GetAudioFrameWithInfo,
77 AudioMixer::Source::AudioFrameInfo(int sample_rate_hz,
78 AudioFrame* audio_frame));
solenberg2397b9a2017-09-22 06:48:10 -070079 MOCK_CONST_METHOD0(PreferredSampleRate, int());
solenberg7602aab2016-11-14 11:30:07 -080080 MOCK_METHOD1(SetTransportOverhead, void(int transport_overhead_per_packet));
81 MOCK_METHOD1(AssociateSendChannel,
82 void(const ChannelProxy& send_channel_proxy));
83 MOCK_METHOD0(DisassociateSendChannel, void());
solenberg3ebbcb52017-01-31 03:58:40 -080084 MOCK_CONST_METHOD2(GetRtpRtcp, void(RtpRtcp** rtp_rtcp,
85 RtpReceiver** rtp_receiver));
solenberg3ebbcb52017-01-31 03:58:40 -080086 MOCK_CONST_METHOD0(GetPlayoutTimestamp, uint32_t());
87 MOCK_METHOD1(SetMinimumPlayoutDelay, void(int delay_ms));
solenbergbd9a77f2017-02-06 12:53:57 -080088 MOCK_CONST_METHOD1(GetRecCodec, bool(CodecInst* codec_inst));
kwiberg1c07c702017-03-27 07:15:49 -070089 MOCK_METHOD1(SetReceiveCodecs,
90 void(const std::map<int, SdpAudioFormat>& codecs));
elad.alond12a8e12017-03-23 11:04:48 -070091 MOCK_METHOD1(OnTwccBasedUplinkPacketLossRate, void(float packet_loss_rate));
elad.alondadb4dc2017-03-23 15:29:50 -070092 MOCK_METHOD1(OnRecoverableUplinkPacketLossRate,
93 void(float recoverable_packet_loss_rate));
hbos8d609f62017-04-10 07:39:05 -070094 MOCK_CONST_METHOD0(GetSources, std::vector<RtpSource>());
solenberg13725082015-11-25 08:16:52 -080095};
96} // namespace test
97} // namespace webrtc
98
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020099#endif // TEST_MOCK_VOE_CHANNEL_PROXY_H_