Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: webrtc/test/mock_voice_engine.h

Issue 2721003002: Remove usage of VoEVolumeControl from WVoE and Audio[Send|Receive]Stream. (Closed)
Patch Set: rebase+comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/mock_voe_channel_proxy.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 11 #ifndef WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
12 #define WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 12 #define WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/modules/audio_device/include/mock_audio_device.h" 16 #include "webrtc/modules/audio_device/include/mock_audio_device.h"
17 #include "webrtc/modules/audio_device/include/mock_audio_transport.h" 17 #include "webrtc/modules/audio_device/include/mock_audio_transport.h"
18 #include "webrtc/modules/audio_processing/include/mock_audio_processing.h" 18 #include "webrtc/modules/audio_processing/include/mock_audio_processing.h"
19 #include "webrtc/test/gmock.h" 19 #include "webrtc/test/gmock.h"
20 #include "webrtc/test/mock_voe_channel_proxy.h" 20 #include "webrtc/test/mock_voe_channel_proxy.h"
21 #include "webrtc/voice_engine/voice_engine_impl.h" 21 #include "webrtc/voice_engine/voice_engine_impl.h"
22 22
23 namespace webrtc { 23 namespace webrtc {
24 namespace voe {
25 class TransmitMixer;
26 } // namespace voe
27
24 namespace test { 28 namespace test {
25 29
26 // NOTE: This class inherits from VoiceEngineImpl so that its clients will be 30 // NOTE: This class inherits from VoiceEngineImpl so that its clients will be
27 // able to get the various interfaces as usual, via T::GetInterface(). 31 // able to get the various interfaces as usual, via T::GetInterface().
28 class MockVoiceEngine : public VoiceEngineImpl { 32 class MockVoiceEngine : public VoiceEngineImpl {
29 public: 33 public:
30 // TODO(nisse): Valid overrides commented out, because the gmock 34 // TODO(nisse): Valid overrides commented out, because the gmock
31 // methods don't use any override declarations, and we want to avoid 35 // methods don't use any override declarations, and we want to avoid
32 // warnings from -Winconsistent-missing-override. See 36 // warnings from -Winconsistent-missing-override. See
33 // http://crbug.com/428099. 37 // http://crbug.com/428099.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // VoEBase 119 // VoEBase
116 MOCK_METHOD1(RegisterVoiceEngineObserver, int(VoiceEngineObserver& observer)); 120 MOCK_METHOD1(RegisterVoiceEngineObserver, int(VoiceEngineObserver& observer));
117 MOCK_METHOD0(DeRegisterVoiceEngineObserver, int()); 121 MOCK_METHOD0(DeRegisterVoiceEngineObserver, int());
118 MOCK_METHOD3( 122 MOCK_METHOD3(
119 Init, 123 Init,
120 int(AudioDeviceModule* external_adm, 124 int(AudioDeviceModule* external_adm,
121 AudioProcessing* audioproc, 125 AudioProcessing* audioproc,
122 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory)); 126 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory));
123 MOCK_METHOD0(audio_processing, AudioProcessing*()); 127 MOCK_METHOD0(audio_processing, AudioProcessing*());
124 MOCK_METHOD0(audio_device_module, AudioDeviceModule*()); 128 MOCK_METHOD0(audio_device_module, AudioDeviceModule*());
129 MOCK_METHOD0(transmit_mixer, voe::TransmitMixer*());
125 MOCK_METHOD0(Terminate, int()); 130 MOCK_METHOD0(Terminate, int());
126 MOCK_METHOD0(CreateChannel, int()); 131 MOCK_METHOD0(CreateChannel, int());
127 MOCK_METHOD1(CreateChannel, int(const ChannelConfig& config)); 132 MOCK_METHOD1(CreateChannel, int(const ChannelConfig& config));
128 MOCK_METHOD1(DeleteChannel, int(int channel)); 133 MOCK_METHOD1(DeleteChannel, int(int channel));
129 MOCK_METHOD1(StartReceive, int(int channel)); 134 MOCK_METHOD1(StartReceive, int(int channel));
130 MOCK_METHOD1(StopReceive, int(int channel)); 135 MOCK_METHOD1(StopReceive, int(int channel));
131 MOCK_METHOD1(StartPlayout, int(int channel)); 136 MOCK_METHOD1(StartPlayout, int(int channel));
132 MOCK_METHOD1(StopPlayout, int(int channel)); 137 MOCK_METHOD1(StopPlayout, int(int channel));
133 MOCK_METHOD1(StartSend, int(int channel)); 138 MOCK_METHOD1(StartSend, int(int channel));
134 MOCK_METHOD1(StopSend, int(int channel)); 139 MOCK_METHOD1(StopSend, int(int channel));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 unsigned int& maxJitterMs, 287 unsigned int& maxJitterMs,
283 unsigned int& discardedPackets)); 288 unsigned int& discardedPackets));
284 MOCK_METHOD2(GetRTCPStatistics, int(int channel, CallStatistics& stats)); 289 MOCK_METHOD2(GetRTCPStatistics, int(int channel, CallStatistics& stats));
285 MOCK_METHOD2(GetRemoteRTCPReportBlocks, 290 MOCK_METHOD2(GetRemoteRTCPReportBlocks,
286 int(int channel, std::vector<ReportBlock>* receive_blocks)); 291 int(int channel, std::vector<ReportBlock>* receive_blocks));
287 MOCK_METHOD3(SetREDStatus, int(int channel, bool enable, int redPayloadtype)); 292 MOCK_METHOD3(SetREDStatus, int(int channel, bool enable, int redPayloadtype));
288 MOCK_METHOD3(GetREDStatus, 293 MOCK_METHOD3(GetREDStatus,
289 int(int channel, bool& enable, int& redPayloadtype)); 294 int(int channel, bool& enable, int& redPayloadtype));
290 MOCK_METHOD3(SetNACKStatus, int(int channel, bool enable, int maxNoPackets)); 295 MOCK_METHOD3(SetNACKStatus, int(int channel, bool enable, int maxNoPackets));
291 296
292 // VoEVolumeControl
293 MOCK_METHOD1(SetSpeakerVolume, int(unsigned int volume));
294 MOCK_METHOD1(GetSpeakerVolume, int(unsigned int& volume));
295 MOCK_METHOD1(SetMicVolume, int(unsigned int volume));
296 MOCK_METHOD1(GetMicVolume, int(unsigned int& volume));
297 MOCK_METHOD2(SetInputMute, int(int channel, bool enable));
298 MOCK_METHOD2(GetInputMute, int(int channel, bool& enabled));
299 MOCK_METHOD1(GetSpeechInputLevel, int(unsigned int& level));
300 MOCK_METHOD2(GetSpeechOutputLevel, int(int channel, unsigned int& level));
301 MOCK_METHOD1(GetSpeechInputLevelFullRange, int(unsigned int& level));
302 MOCK_METHOD2(GetSpeechOutputLevelFullRange,
303 int(int channel, unsigned& level));
304 MOCK_METHOD2(SetChannelOutputVolumeScaling, int(int channel, float scaling));
305 MOCK_METHOD2(GetChannelOutputVolumeScaling, int(int channel, float& scaling));
306 MOCK_METHOD3(SetOutputVolumePan, int(int channel, float left, float right));
307 MOCK_METHOD3(GetOutputVolumePan, int(int channel, float& left, float& right));
308
309 private: 297 private:
310 // TODO(ossu): I'm not particularly happy about keeping the decoder factory 298 // TODO(ossu): I'm not particularly happy about keeping the decoder factory
311 // here, but due to how gmock is implemented, I cannot just keep it in the 299 // here, but due to how gmock is implemented, I cannot just keep it in the
312 // functor implementing the default version of ChannelProxyFactory, above. 300 // functor implementing the default version of ChannelProxyFactory, above.
313 // GMock creates an unfortunate copy of the functor, which would cause us to 301 // GMock creates an unfortunate copy of the functor, which would cause us to
314 // return a dangling reference. Fortunately, this should go away once 302 // return a dangling reference. Fortunately, this should go away once
315 // voe::Channel does. 303 // voe::Channel does.
316 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; 304 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
317 305
318 MockAudioDeviceModule mock_audio_device_; 306 MockAudioDeviceModule mock_audio_device_;
319 MockAudioProcessing mock_audio_processing_; 307 MockAudioProcessing mock_audio_processing_;
320 MockAudioTransport mock_audio_transport_; 308 MockAudioTransport mock_audio_transport_;
321 }; 309 };
322 } // namespace test 310 } // namespace test
323 } // namespace webrtc 311 } // namespace webrtc
324 312
325 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 313 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
OLDNEW
« no previous file with comments | « webrtc/test/mock_voe_channel_proxy.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698