xref: /aosp_15_r20/external/webrtc/modules/audio_device/include/mock_audio_transport.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2016 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 MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
12 #define MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
13 
14 #include "modules/audio_device/include/audio_device_defines.h"
15 #include "test/gmock.h"
16 
17 namespace webrtc {
18 namespace test {
19 
20 class MockAudioTransport : public AudioTransport {
21  public:
MockAudioTransport()22   MockAudioTransport() {}
~MockAudioTransport()23   ~MockAudioTransport() {}
24 
25   MOCK_METHOD(int32_t,
26               RecordedDataIsAvailable,
27               (const void* audioSamples,
28                size_t nSamples,
29                size_t nBytesPerSample,
30                size_t nChannels,
31                uint32_t samplesPerSec,
32                uint32_t totalDelayMS,
33                int32_t clockDrift,
34                uint32_t currentMicLevel,
35                bool keyPressed,
36                uint32_t& newMicLevel),
37               (override));
38 
39   MOCK_METHOD(int32_t,
40               RecordedDataIsAvailable,
41               (const void* audioSamples,
42                size_t nSamples,
43                size_t nBytesPerSample,
44                size_t nChannels,
45                uint32_t samplesPerSec,
46                uint32_t totalDelayMS,
47                int32_t clockDrift,
48                uint32_t currentMicLevel,
49                bool keyPressed,
50                uint32_t& newMicLevel,
51                int64_t estimated_capture_time_ns),
52               (override));
53 
54   MOCK_METHOD(int32_t,
55               NeedMorePlayData,
56               (size_t nSamples,
57                size_t nBytesPerSample,
58                size_t nChannels,
59                uint32_t samplesPerSec,
60                void* audioSamples,
61                size_t& nSamplesOut,
62                int64_t* elapsed_time_ms,
63                int64_t* ntp_time_ms),
64               (override));
65 
66   MOCK_METHOD(void,
67               PullRenderData,
68               (int bits_per_sample,
69                int sample_rate,
70                size_t number_of_channels,
71                size_t number_of_frames,
72                void* audio_data,
73                int64_t* elapsed_time_ms,
74                int64_t* ntp_time_ms),
75               (override));
76 };
77 
78 }  // namespace test
79 }  // namespace webrtc
80 
81 #endif  // MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_TRANSPORT_H_
82