blob: a02bee38ad4397fee3f9787b7daa3f7880ee7fb7 [file] [log] [blame]
solenberg13725082015-11-25 16:16:521/*
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 10:18:3111#ifndef AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
12#define AUDIO_MOCK_VOE_CHANNEL_PROXY_H_
solenberg13725082015-11-25 16:16:5213
Fredrik Solenberga8b7c7f2018-01-17 10:18:3114#include <map>
15#include <memory>
solenberg13725082015-11-25 16:16:5216#include <string>
Fredrik Solenbergf693bfa2018-12-11 11:22:1017#include <utility>
Fredrik Solenberga8b7c7f2018-01-17 10:18:3118#include <vector>
kwibergac9f8762016-10-01 05:29:4319
Tommie0972822021-06-14 06:11:1020#include "api/crypto/frame_decryptor_interface.h"
Benjamin Wright78410ad2018-10-25 16:52:5721#include "api/test/mock_frame_encryptor.h"
Niels Möller349ade32018-11-16 08:50:4222#include "audio/channel_receive.h"
Niels Möllerdced9f62018-11-19 09:27:0723#include "audio/channel_send.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3124#include "modules/rtp_rtcp/source/rtp_packet_received.h"
25#include "test/gmock.h"
solenberg13725082015-11-25 16:16:5226
27namespace webrtc {
28namespace test {
29
Niels Möller349ade32018-11-16 08:50:4230class MockChannelReceive : public voe::ChannelReceiveInterface {
Niels Möllerb222f492018-10-03 14:50:0831 public:
Danil Chapovalovf9c6b682020-05-15 09:40:4432 MOCK_METHOD(void, SetNACKStatus, (bool enable, int max_packets), (override));
Ivo Creusen2562cf02021-09-03 14:51:2233 MOCK_METHOD(void, SetNonSenderRttMeasurement, (bool enabled), (override));
Danil Chapovalovf9c6b682020-05-15 09:40:4434 MOCK_METHOD(void,
35 RegisterReceiverCongestionControlObjects,
36 (PacketRouter*),
37 (override));
38 MOCK_METHOD(void, ResetReceiverCongestionControlObjects, (), (override));
39 MOCK_METHOD(CallReceiveStatistics, GetRTCPStatistics, (), (const, override));
Niels Möller6b4d9622020-09-14 08:47:5040 MOCK_METHOD(NetworkStatistics,
41 GetNetworkStatistics,
42 (bool),
43 (const, override));
Danil Chapovalovf9c6b682020-05-15 09:40:4444 MOCK_METHOD(AudioDecodingCallStats,
45 GetDecodingCallStatistics,
46 (),
47 (const, override));
48 MOCK_METHOD(int, GetSpeechOutputLevelFullRange, (), (const, override));
49 MOCK_METHOD(double, GetTotalOutputEnergy, (), (const, override));
50 MOCK_METHOD(double, GetTotalOutputDuration, (), (const, override));
51 MOCK_METHOD(uint32_t, GetDelayEstimate, (), (const, override));
52 MOCK_METHOD(void, SetSink, (AudioSinkInterface*), (override));
53 MOCK_METHOD(void, OnRtpPacket, (const RtpPacketReceived& packet), (override));
54 MOCK_METHOD(void,
55 ReceivedRTCPPacket,
56 (const uint8_t*, size_t length),
57 (override));
58 MOCK_METHOD(void, SetChannelOutputVolumeScaling, (float scaling), (override));
59 MOCK_METHOD(AudioMixer::Source::AudioFrameInfo,
60 GetAudioFrameWithInfo,
61 (int sample_rate_hz, AudioFrame*),
62 (override));
63 MOCK_METHOD(int, PreferredSampleRate, (), (const, override));
Ranveer Aggarwaldea374a2021-01-23 06:57:1964 MOCK_METHOD(void, SetSourceTracker, (SourceTracker*), (override));
Danil Chapovalovf9c6b682020-05-15 09:40:4465 MOCK_METHOD(void,
66 SetAssociatedSendChannel,
67 (const voe::ChannelSendInterface*),
68 (override));
69 MOCK_METHOD(bool,
70 GetPlayoutRtpTimestamp,
71 (uint32_t*, int64_t*),
72 (const, override));
73 MOCK_METHOD(void,
74 SetEstimatedPlayoutNtpTimestampMs,
75 (int64_t ntp_timestamp_ms, int64_t time_ms),
76 (override));
77 MOCK_METHOD(absl::optional<int64_t>,
78 GetCurrentEstimatedPlayoutNtpTimestampMs,
79 (int64_t now_ms),
80 (const, override));
81 MOCK_METHOD(absl::optional<Syncable::Info>,
82 GetSyncInfo,
83 (),
84 (const, override));
Ivo Creusenbef7b052020-09-08 14:30:2585 MOCK_METHOD(bool, SetMinimumPlayoutDelay, (int delay_ms), (override));
Danil Chapovalovf9c6b682020-05-15 09:40:4486 MOCK_METHOD(bool, SetBaseMinimumPlayoutDelayMs, (int delay_ms), (override));
87 MOCK_METHOD(int, GetBaseMinimumPlayoutDelayMs, (), (const, override));
88 MOCK_METHOD((absl::optional<std::pair<int, SdpAudioFormat>>),
89 GetReceiveCodec,
90 (),
91 (const, override));
92 MOCK_METHOD(void,
93 SetReceiveCodecs,
94 ((const std::map<int, SdpAudioFormat>& codecs)),
95 (override));
96 MOCK_METHOD(void, StartPlayout, (), (override));
97 MOCK_METHOD(void, StopPlayout, (), (override));
98 MOCK_METHOD(
99 void,
100 SetDepacketizerToDecoderFrameTransformer,
101 (rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer),
102 (override));
Tommie0972822021-06-14 06:11:10103 MOCK_METHOD(
104 void,
105 SetFrameDecryptor,
106 (rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor),
107 (override));
Tommi08be9ba2021-06-15 21:01:57108 MOCK_METHOD(void, OnLocalSsrcChange, (uint32_t local_ssrc), (override));
109 MOCK_METHOD(uint32_t, GetLocalSsrc, (), (const, override));
Niels Möllerb222f492018-10-03 14:50:08110};
111
Niels Möllerdced9f62018-11-19 09:27:07112class MockChannelSend : public voe::ChannelSendInterface {
solenberg13725082015-11-25 16:16:52113 public:
Danil Chapovalovf9c6b682020-05-15 09:40:44114 MOCK_METHOD(void,
115 SetEncoder,
116 (int payload_type, std::unique_ptr<AudioEncoder> encoder),
117 (override));
118 MOCK_METHOD(
119 void,
ossu20a4b3f2017-04-27 09:08:52120 ModifyEncoder,
Danil Chapovalovf9c6b682020-05-15 09:40:44121 (rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier),
122 (override));
123 MOCK_METHOD(void,
124 CallEncoder,
125 (rtc::FunctionView<void(AudioEncoder*)> modifier),
126 (override));
127 MOCK_METHOD(void, SetRTCP_CNAME, (absl::string_view c_name), (override));
128 MOCK_METHOD(void,
129 SetSendAudioLevelIndicationStatus,
130 (bool enable, int id),
131 (override));
132 MOCK_METHOD(void,
133 RegisterSenderCongestionControlObjects,
134 (RtpTransportControllerSendInterface*, RtcpBandwidthObserver*),
135 (override));
136 MOCK_METHOD(void, ResetSenderCongestionControlObjects, (), (override));
137 MOCK_METHOD(CallSendStatistics, GetRTCPStatistics, (), (const, override));
138 MOCK_METHOD(std::vector<ReportBlock>,
139 GetRemoteRTCPReportBlocks,
140 (),
141 (const, override));
142 MOCK_METHOD(ANAStats, GetANAStatistics, (), (const, override));
143 MOCK_METHOD(void,
144 RegisterCngPayloadType,
145 (int payload_type, int payload_frequency),
146 (override));
147 MOCK_METHOD(void,
148 SetSendTelephoneEventPayloadType,
149 (int payload_type, int payload_frequency),
150 (override));
151 MOCK_METHOD(bool,
152 SendTelephoneEventOutband,
153 (int event, int duration_ms),
154 (override));
155 MOCK_METHOD(void,
156 OnBitrateAllocation,
157 (BitrateAllocationUpdate update),
158 (override));
159 MOCK_METHOD(void, SetInputMute, (bool muted), (override));
160 MOCK_METHOD(void,
161 ReceivedRTCPPacket,
162 (const uint8_t*, size_t length),
163 (override));
164 MOCK_METHOD(void,
165 ProcessAndEncodeAudio,
166 (std::unique_ptr<AudioFrame>),
167 (override));
Tomas Gunnarssonf25761d2020-06-03 20:55:33168 MOCK_METHOD(RtpRtcpInterface*, GetRtpRtcp, (), (const, override));
Jakob Ivarssonbf087452021-11-11 12:43:49169 MOCK_METHOD(int, GetTargetBitrate, (), (const, override));
Danil Chapovalovf9c6b682020-05-15 09:40:44170 MOCK_METHOD(int64_t, GetRTT, (), (const, override));
171 MOCK_METHOD(void, StartSend, (), (override));
172 MOCK_METHOD(void, StopSend, (), (override));
173 MOCK_METHOD(void,
174 SetFrameEncryptor,
175 (rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor),
176 (override));
177 MOCK_METHOD(
178 void,
179 SetEncoderToPacketizerFrameTransformer,
180 (rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer),
181 (override));
solenberg13725082015-11-25 16:16:52182};
183} // namespace test
184} // namespace webrtc
185
Fredrik Solenberga8b7c7f2018-01-17 10:18:31186#endif // AUDIO_MOCK_VOE_CHANNEL_PROXY_H_