blob: e12b0349c93930b2fe087b765514dff162377696 [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
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010011#ifndef AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
12#define AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
solenberg13725082015-11-25 08:16:52 -080013
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010014#include <map>
15#include <memory>
solenberg13725082015-11-25 08:16:52 -080016#include <string>
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010017#include <vector>
kwibergac9f8762016-09-30 22:29:43 -070018
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010019#include "audio/channel_proxy.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "modules/rtp_rtcp/source/rtp_packet_received.h"
21#include "test/gmock.h"
solenberg13725082015-11-25 08:16:52 -080022
23namespace webrtc {
24namespace test {
25
26class MockVoEChannelProxy : public voe::ChannelProxy {
27 public:
Fredrik Solenberg2a877972017-12-15 16:42:15 +010028 // GMock doesn't like move-only types, like std::unique_ptr.
29 virtual bool SetEncoder(int payload_type,
30 std::unique_ptr<AudioEncoder> encoder) {
ossu1ffbd6c2017-04-06 12:05:04 -070031 return SetEncoderForMock(payload_type, &encoder);
32 }
33 MOCK_METHOD2(SetEncoderForMock,
34 bool(int payload_type,
35 std::unique_ptr<AudioEncoder>* encoder));
ossu20a4b3f2017-04-27 02:08:52 -070036 MOCK_METHOD1(
37 ModifyEncoder,
38 void(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier));
solenberg13725082015-11-25 08:16:52 -080039 MOCK_METHOD1(SetRTCPStatus, void(bool enable));
40 MOCK_METHOD1(SetLocalSSRC, void(uint32_t ssrc));
41 MOCK_METHOD1(SetRTCP_CNAME, void(const std::string& c_name));
solenberg971cab02016-06-14 10:02:41 -070042 MOCK_METHOD2(SetNACKStatus, void(bool enable, int max_packets));
solenberg358057b2015-11-27 10:46:42 -080043 MOCK_METHOD2(SetSendAudioLevelIndicationStatus, void(bool enable, int id));
stefan3313ec92016-01-21 06:32:43 -080044 MOCK_METHOD1(EnableSendTransportSequenceNumber, void(int id));
nisseb8f9a322017-03-27 05:36:15 -070045 MOCK_METHOD2(RegisterSenderCongestionControlObjects,
46 void(RtpTransportControllerSendInterface* transport,
stefan7de8d642017-02-07 07:14:08 -080047 RtcpBandwidthObserver* bandwidth_observer));
stefanbba9dec2016-02-01 04:39:55 -080048 MOCK_METHOD1(RegisterReceiverCongestionControlObjects,
49 void(PacketRouter* packet_router));
nissefdbfdc92017-03-31 05:44:52 -070050 MOCK_METHOD0(ResetSenderCongestionControlObjects, void());
51 MOCK_METHOD0(ResetReceiverCongestionControlObjects, void());
solenberg358057b2015-11-27 10:46:42 -080052 MOCK_CONST_METHOD0(GetRTCPStatistics, CallStatistics());
53 MOCK_CONST_METHOD0(GetRemoteRTCPReportBlocks, std::vector<ReportBlock>());
54 MOCK_CONST_METHOD0(GetNetworkStatistics, NetworkStatistics());
55 MOCK_CONST_METHOD0(GetDecodingCallStatistics, AudioDecodingCallStats());
ivoce1198e02017-09-08 08:13:19 -070056 MOCK_CONST_METHOD0(GetANAStatistics, ANAStats());
solenberg8d73f8c2017-03-08 01:52:20 -080057 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));
Fredrik Solenberg8f5787a2018-01-11 13:52:30 +010065 MOCK_METHOD1(SetSink, void(AudioSinkInterface* sink));
solenberg7602aab2016-11-14 11:30:07 -080066 MOCK_METHOD1(SetInputMute, void(bool muted));
solenberg1c239d42017-09-29 06:00:28 -070067 MOCK_METHOD1(RegisterTransport, void(Transport* transport));
nisse657bab22017-02-21 06:28:10 -080068 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived& packet));
mflodman3d7db262016-04-29 00:57:13 -070069 MOCK_METHOD2(ReceivedRTCPPacket, bool(const uint8_t* packet, size_t length));
solenberg217fb662016-06-17 08:30:54 -070070 MOCK_METHOD1(SetChannelOutputVolumeScaling, void(float scaling));
ivoc14d5dbe2016-07-04 07:06:55 -070071 MOCK_METHOD1(SetRtcEventLog, void(RtcEventLog* event_log));
solenberg7602aab2016-11-14 11:30:07 -080072 MOCK_METHOD2(GetAudioFrameWithInfo,
73 AudioMixer::Source::AudioFrameInfo(int sample_rate_hz,
74 AudioFrame* audio_frame));
solenberg2397b9a2017-09-22 06:48:10 -070075 MOCK_CONST_METHOD0(PreferredSampleRate, int());
Fredrik Solenberg2a877972017-12-15 16:42:15 +010076 // GMock doesn't like move-only types, like std::unique_ptr.
77 virtual void ProcessAndEncodeAudio(std::unique_ptr<AudioFrame> audio_frame) {
78 ProcessAndEncodeAudioForMock(&audio_frame);
79 }
80 MOCK_METHOD1(ProcessAndEncodeAudioForMock,
81 void(std::unique_ptr<AudioFrame>* audio_frame));
solenberg7602aab2016-11-14 11:30:07 -080082 MOCK_METHOD1(SetTransportOverhead, void(int transport_overhead_per_packet));
83 MOCK_METHOD1(AssociateSendChannel,
84 void(const ChannelProxy& send_channel_proxy));
85 MOCK_METHOD0(DisassociateSendChannel, void());
solenberg3ebbcb52017-01-31 03:58:40 -080086 MOCK_CONST_METHOD2(GetRtpRtcp, void(RtpRtcp** rtp_rtcp,
87 RtpReceiver** rtp_receiver));
solenberg3ebbcb52017-01-31 03:58:40 -080088 MOCK_CONST_METHOD0(GetPlayoutTimestamp, uint32_t());
89 MOCK_METHOD1(SetMinimumPlayoutDelay, void(int delay_ms));
solenbergbd9a77f2017-02-06 12:53:57 -080090 MOCK_CONST_METHOD1(GetRecCodec, bool(CodecInst* codec_inst));
kwiberg1c07c702017-03-27 07:15:49 -070091 MOCK_METHOD1(SetReceiveCodecs,
92 void(const std::map<int, SdpAudioFormat>& codecs));
elad.alond12a8e12017-03-23 11:04:48 -070093 MOCK_METHOD1(OnTwccBasedUplinkPacketLossRate, void(float packet_loss_rate));
elad.alondadb4dc2017-03-23 15:29:50 -070094 MOCK_METHOD1(OnRecoverableUplinkPacketLossRate,
95 void(float recoverable_packet_loss_rate));
hbos8d609f62017-04-10 07:39:05 -070096 MOCK_CONST_METHOD0(GetSources, std::vector<RtpSource>());
Fredrik Solenbergaaedf752017-12-18 13:09:12 +010097 MOCK_METHOD0(StartSend, void());
98 MOCK_METHOD0(StopSend, void());
Fredrik Solenbergd5247512017-12-18 22:41:03 +010099 MOCK_METHOD0(StartPlayout, void());
100 MOCK_METHOD0(StopPlayout, void());
solenberg13725082015-11-25 08:16:52 -0800101};
102} // namespace test
103} // namespace webrtc
104
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100105#endif // AUDIO_MOCK_VOE_CHANNEL_PROXY_H_