mock_transformable_frame.h (2190B)
1 /* 2 * Copyright 2023 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_FRAME_H_ 12 #define API_TEST_MOCK_TRANSFORMABLE_FRAME_H_ 13 14 #include <stdint.h> 15 16 #include <optional> 17 #include <string> 18 #include <type_traits> 19 20 #include "api/array_view.h" 21 #include "api/frame_transformer_interface.h" 22 #include "api/units/time_delta.h" 23 #include "api/units/timestamp.h" 24 #include "test/gmock.h" 25 26 namespace webrtc { 27 28 class MockTransformableFrame : public TransformableFrameInterface { 29 public: 30 MockTransformableFrame() : TransformableFrameInterface(Passkey()) {} 31 32 MOCK_METHOD(ArrayView<const uint8_t>, GetData, (), (const, override)); 33 MOCK_METHOD(void, SetData, (ArrayView<const uint8_t>), (override)); 34 MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override)); 35 MOCK_METHOD(bool, CanSetPayloadType, (), (const, override)); 36 MOCK_METHOD(void, SetPayloadType, (uint8_t), (override)); 37 MOCK_METHOD(uint32_t, GetSsrc, (), (const, override)); 38 MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override)); 39 MOCK_METHOD(void, SetRTPTimestamp, (uint32_t), (override)); 40 MOCK_METHOD(std::optional<Timestamp>, 41 GetPresentationTimestamp, 42 (), 43 (const, override)); 44 MOCK_METHOD(std::string, GetMimeType, (), (const, override)); 45 MOCK_METHOD(std::optional<Timestamp>, ReceiveTime, (), (const, override)); 46 MOCK_METHOD(std::optional<Timestamp>, CaptureTime, (), (const, override)); 47 MOCK_METHOD(bool, CanSetCaptureTime, (), (const, override)); 48 MOCK_METHOD(void, SetCaptureTime, (std::optional<Timestamp>), (override)); 49 MOCK_METHOD(std::optional<TimeDelta>, 50 SenderCaptureTimeOffset, 51 (), 52 (const, override)); 53 }; 54 55 static_assert(!std::is_abstract_v<MockTransformableFrame>, ""); 56 57 } // namespace webrtc 58 59 #endif // API_TEST_MOCK_TRANSFORMABLE_FRAME_H_