mock_audio_receive_stream.h (2898B)
1 /* 2 * Copyright (c) 2025 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 11 #ifndef CALL_TEST_MOCK_AUDIO_RECEIVE_STREAM_H_ 12 #define CALL_TEST_MOCK_AUDIO_RECEIVE_STREAM_H_ 13 14 #include <cstdint> 15 #include <map> 16 #include <vector> 17 18 #include "api/audio/audio_frame.h" 19 #include "api/audio/audio_mixer.h" 20 #include "api/audio_codecs/audio_format.h" 21 #include "api/crypto/frame_decryptor_interface.h" 22 #include "api/frame_transformer_interface.h" 23 #include "api/rtp_headers.h" 24 #include "api/scoped_refptr.h" 25 #include "api/transport/rtp/rtp_source.h" 26 #include "call/audio_receive_stream.h" 27 #include "test/gmock.h" 28 29 namespace webrtc { 30 namespace test { 31 32 class MockAudioReceiveStream : public AudioReceiveStreamInterface, 33 public AudioMixer::Source { 34 public: 35 MOCK_METHOD(uint32_t, remote_ssrc, (), (const override)); 36 MOCK_METHOD(void, Start, (), (override)); 37 MOCK_METHOD(void, Stop, (), (override)); 38 MOCK_METHOD(bool, IsRunning, (), (const override)); 39 MOCK_METHOD(void, 40 SetDepacketizerToDecoderFrameTransformer, 41 (scoped_refptr<FrameTransformerInterface>), 42 (override)); 43 MOCK_METHOD(void, 44 SetDecoderMap, 45 ((std::map<int, SdpAudioFormat>)), 46 (override)); 47 MOCK_METHOD(void, SetNackHistory, (int), (override)); 48 MOCK_METHOD(void, SetRtcpMode, (RtcpMode), (override)); 49 MOCK_METHOD(void, SetNonSenderRttMeasurement, (bool), (override)); 50 MOCK_METHOD(void, 51 SetFrameDecryptor, 52 (scoped_refptr<FrameDecryptorInterface>), 53 (override)); 54 55 MOCK_METHOD(webrtc::AudioReceiveStreamInterface::Stats, 56 GetStats, 57 (bool), 58 (const override)); 59 MOCK_METHOD(void, SetSink, (webrtc::AudioSinkInterface*), (override)); 60 MOCK_METHOD(void, SetGain, (float), (override)); 61 MOCK_METHOD(bool, SetBaseMinimumPlayoutDelayMs, (int), (override)); 62 MOCK_METHOD(int, GetBaseMinimumPlayoutDelayMs, (), (const override)); 63 MOCK_METHOD(std::vector<webrtc::RtpSource>, GetSources, (), (const override)); 64 65 // TODO (b/397376626): Create a MockAudioMixerSource, and instead 66 // have a member variable here. 67 AudioMixer::Source* source() override { return this; } 68 69 MOCK_METHOD(AudioFrameInfo, 70 GetAudioFrameWithInfo, 71 (int, AudioFrame*), 72 (override)); 73 MOCK_METHOD(int, Ssrc, (), (const override)); 74 MOCK_METHOD(int, PreferredSampleRate, (), (const override)); 75 }; 76 77 } // namespace test 78 } // namespace webrtc 79 80 #endif // CALL_TEST_MOCK_AUDIO_RECEIVE_STREAM_H_