mock_transformable_audio_frame.h (2875B)
1 /* 2 * Copyright (c) 2020 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 API_TEST_MOCK_TRANSFORMABLE_AUDIO_FRAME_H_ 12 #define API_TEST_MOCK_TRANSFORMABLE_AUDIO_FRAME_H_ 13 14 #include <cstdint> 15 #include <optional> 16 #include <string> 17 18 #include "api/array_view.h" 19 #include "api/frame_transformer_interface.h" 20 #include "api/units/time_delta.h" 21 #include "api/units/timestamp.h" 22 #include "test/gmock.h" 23 24 namespace webrtc { 25 26 class MockTransformableAudioFrame : public TransformableAudioFrameInterface { 27 public: 28 MockTransformableAudioFrame() : TransformableAudioFrameInterface(Passkey()) {} 29 30 MOCK_METHOD(ArrayView<const uint8_t>, GetData, (), (const, override)); 31 MOCK_METHOD(void, SetData, (ArrayView<const uint8_t>), (override)); 32 MOCK_METHOD(void, SetRTPTimestamp, (uint32_t), (override)); 33 MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override)); 34 MOCK_METHOD(bool, CanSetPayloadType, (), (const, override)); 35 MOCK_METHOD(void, SetPayloadType, (uint8_t), (override)); 36 MOCK_METHOD(uint32_t, GetSsrc, (), (const, override)); 37 MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override)); 38 MOCK_METHOD(std::string, GetMimeType, (), (const, override)); 39 MOCK_METHOD(ArrayView<const uint32_t>, 40 GetContributingSources, 41 (), 42 (const, override)); 43 MOCK_METHOD(const std::optional<uint16_t>, 44 SequenceNumber, 45 (), 46 (const, override)); 47 MOCK_METHOD(TransformableFrameInterface::Direction, 48 GetDirection, 49 (), 50 (const, override)); 51 MOCK_METHOD(std::optional<uint64_t>, 52 AbsoluteCaptureTimestamp, 53 (), 54 (const, override)); 55 MOCK_METHOD(TransformableAudioFrameInterface::FrameType, 56 Type, 57 (), 58 (const, override)); 59 MOCK_METHOD(std::optional<uint8_t>, AudioLevel, (), (const, override)); 60 MOCK_METHOD(bool, CanSetAudioLevel, (), (const, override)); 61 MOCK_METHOD(void, SetAudioLevel, (std::optional<uint8_t>), (override)); 62 63 MOCK_METHOD(std::optional<Timestamp>, ReceiveTime, (), (const, override)); 64 MOCK_METHOD(std::optional<Timestamp>, CaptureTime, (), (const, override)); 65 MOCK_METHOD(bool, CanSetCaptureTime, (), (const, override)); 66 MOCK_METHOD(void, SetCaptureTime, (std::optional<Timestamp>), (override)); 67 MOCK_METHOD(std::optional<TimeDelta>, 68 SenderCaptureTimeOffset, 69 (), 70 (const, override)); 71 }; 72 73 } // namespace webrtc 74 75 #endif // API_TEST_MOCK_TRANSFORMABLE_AUDIO_FRAME_H_