solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef TEST_MOCK_VOE_CHANNEL_PROXY_H_ |
| 12 | #define TEST_MOCK_VOE_CHANNEL_PROXY_H_ |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 13 | |
| 14 | #include <string> |
kwiberg | ac9f876 | 2016-09-30 22:29:43 -0700 | [diff] [blame] | 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/rtp_rtcp/source/rtp_packet_received.h" |
| 17 | #include "test/gmock.h" |
| 18 | #include "voice_engine/channel_proxy.h" |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
| 23 | class MockVoEChannelProxy : public voe::ChannelProxy { |
| 24 | public: |
ossu | 1ffbd6c | 2017-04-06 12:05:04 -0700 | [diff] [blame] | 25 | // 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)); |
ossu | 20a4b3f | 2017-04-27 02:08:52 -0700 | [diff] [blame] | 33 | MOCK_METHOD1( |
| 34 | ModifyEncoder, |
| 35 | void(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier)); |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 36 | 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)); |
solenberg | 971cab0 | 2016-06-14 10:02:41 -0700 | [diff] [blame] | 39 | MOCK_METHOD2(SetNACKStatus, void(bool enable, int max_packets)); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 40 | MOCK_METHOD2(SetSendAudioLevelIndicationStatus, void(bool enable, int id)); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 41 | MOCK_METHOD2(SetReceiveAudioLevelIndicationStatus, void(bool enable, int id)); |
stefan | 3313ec9 | 2016-01-21 06:32:43 -0800 | [diff] [blame] | 42 | MOCK_METHOD1(EnableSendTransportSequenceNumber, void(int id)); |
| 43 | MOCK_METHOD1(EnableReceiveTransportSequenceNumber, void(int id)); |
nisse | b8f9a32 | 2017-03-27 05:36:15 -0700 | [diff] [blame] | 44 | MOCK_METHOD2(RegisterSenderCongestionControlObjects, |
| 45 | void(RtpTransportControllerSendInterface* transport, |
stefan | 7de8d64 | 2017-02-07 07:14:08 -0800 | [diff] [blame] | 46 | RtcpBandwidthObserver* bandwidth_observer)); |
stefan | bba9dec | 2016-02-01 04:39:55 -0800 | [diff] [blame] | 47 | MOCK_METHOD1(RegisterReceiverCongestionControlObjects, |
| 48 | void(PacketRouter* packet_router)); |
nisse | fdbfdc9 | 2017-03-31 05:44:52 -0700 | [diff] [blame] | 49 | MOCK_METHOD0(ResetSenderCongestionControlObjects, void()); |
| 50 | MOCK_METHOD0(ResetReceiverCongestionControlObjects, void()); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 51 | 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()); |
ivoc | e1198e0 | 2017-09-08 08:13:19 -0700 | [diff] [blame] | 55 | MOCK_CONST_METHOD0(GetANAStatistics, ANAStats()); |
solenberg | 8d73f8c | 2017-03-08 01:52:20 -0800 | [diff] [blame] | 56 | MOCK_CONST_METHOD0(GetSpeechOutputLevel, int()); |
| 57 | MOCK_CONST_METHOD0(GetSpeechOutputLevelFullRange, int()); |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 58 | MOCK_CONST_METHOD0(GetTotalOutputEnergy, double()); |
| 59 | MOCK_CONST_METHOD0(GetTotalOutputDuration, double()); |
solenberg | 358057b | 2015-11-27 10:46:42 -0800 | [diff] [blame] | 60 | MOCK_CONST_METHOD0(GetDelayEstimate, uint32_t()); |
solenberg | ffbbcac | 2016-11-17 05:25:37 -0800 | [diff] [blame] | 61 | MOCK_METHOD2(SetSendTelephoneEventPayloadType, bool(int payload_type, |
| 62 | int payload_frequency)); |
solenberg | 8842c3e | 2016-03-11 03:06:41 -0800 | [diff] [blame] | 63 | MOCK_METHOD2(SendTelephoneEventOutband, bool(int event, int duration_ms)); |
minyue | 78b4d56 | 2016-11-30 04:47:39 -0800 | [diff] [blame] | 64 | MOCK_METHOD2(SetBitrate, void(int bitrate_bps, int64_t probing_interval_ms)); |
solenberg | 217fb66 | 2016-06-17 08:30:54 -0700 | [diff] [blame] | 65 | // TODO(solenberg): Talk the compiler into accepting this mock method: |
| 66 | // MOCK_METHOD1(SetSink, void(std::unique_ptr<AudioSinkInterface> sink)); |
solenberg | 7602aab | 2016-11-14 11:30:07 -0800 | [diff] [blame] | 67 | MOCK_METHOD1(SetInputMute, void(bool muted)); |
solenberg | 1c239d4 | 2017-09-29 06:00:28 -0700 | [diff] [blame] | 68 | MOCK_METHOD1(RegisterTransport, void(Transport* transport)); |
nisse | 657bab2 | 2017-02-21 06:28:10 -0800 | [diff] [blame] | 69 | MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived& packet)); |
mflodman | 3d7db26 | 2016-04-29 00:57:13 -0700 | [diff] [blame] | 70 | MOCK_METHOD2(ReceivedRTCPPacket, bool(const uint8_t* packet, size_t length)); |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 71 | MOCK_CONST_METHOD0(GetAudioDecoderFactory, |
| 72 | const rtc::scoped_refptr<AudioDecoderFactory>&()); |
solenberg | 217fb66 | 2016-06-17 08:30:54 -0700 | [diff] [blame] | 73 | MOCK_METHOD1(SetChannelOutputVolumeScaling, void(float scaling)); |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 74 | MOCK_METHOD1(SetRtcEventLog, void(RtcEventLog* event_log)); |
michaelt | 9332b7d | 2016-11-30 07:51:13 -0800 | [diff] [blame] | 75 | MOCK_METHOD1(SetRtcpRttStats, void(RtcpRttStats* rtcp_rtt_stats)); |
solenberg | 7602aab | 2016-11-14 11:30:07 -0800 | [diff] [blame] | 76 | MOCK_METHOD2(GetAudioFrameWithInfo, |
| 77 | AudioMixer::Source::AudioFrameInfo(int sample_rate_hz, |
| 78 | AudioFrame* audio_frame)); |
solenberg | 2397b9a | 2017-09-22 06:48:10 -0700 | [diff] [blame] | 79 | MOCK_CONST_METHOD0(PreferredSampleRate, int()); |
solenberg | 7602aab | 2016-11-14 11:30:07 -0800 | [diff] [blame] | 80 | 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()); |
solenberg | 3ebbcb5 | 2017-01-31 03:58:40 -0800 | [diff] [blame] | 84 | MOCK_CONST_METHOD2(GetRtpRtcp, void(RtpRtcp** rtp_rtcp, |
| 85 | RtpReceiver** rtp_receiver)); |
solenberg | 3ebbcb5 | 2017-01-31 03:58:40 -0800 | [diff] [blame] | 86 | MOCK_CONST_METHOD0(GetPlayoutTimestamp, uint32_t()); |
| 87 | MOCK_METHOD1(SetMinimumPlayoutDelay, void(int delay_ms)); |
solenberg | bd9a77f | 2017-02-06 12:53:57 -0800 | [diff] [blame] | 88 | MOCK_CONST_METHOD1(GetRecCodec, bool(CodecInst* codec_inst)); |
kwiberg | 1c07c70 | 2017-03-27 07:15:49 -0700 | [diff] [blame] | 89 | MOCK_METHOD1(SetReceiveCodecs, |
| 90 | void(const std::map<int, SdpAudioFormat>& codecs)); |
elad.alon | d12a8e1 | 2017-03-23 11:04:48 -0700 | [diff] [blame] | 91 | MOCK_METHOD1(OnTwccBasedUplinkPacketLossRate, void(float packet_loss_rate)); |
elad.alon | dadb4dc | 2017-03-23 15:29:50 -0700 | [diff] [blame] | 92 | MOCK_METHOD1(OnRecoverableUplinkPacketLossRate, |
| 93 | void(float recoverable_packet_loss_rate)); |
hbos | 8d609f6 | 2017-04-10 07:39:05 -0700 | [diff] [blame] | 94 | MOCK_CONST_METHOD0(GetSources, std::vector<RtpSource>()); |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 95 | }; |
| 96 | } // namespace test |
| 97 | } // namespace webrtc |
| 98 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 99 | #endif // TEST_MOCK_VOE_CHANNEL_PROXY_H_ |