fake_frame_rate_provider.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef CALL_ADAPTATION_TEST_FAKE_FRAME_RATE_PROVIDER_H_
  11. #define CALL_ADAPTATION_TEST_FAKE_FRAME_RATE_PROVIDER_H_
  12. #include <string>
  13. #include <vector>
  14. #include "api/video/video_stream_encoder_observer.h"
  15. #include "test/gmock.h"
  16. namespace webrtc {
  17. class MockVideoStreamEncoderObserver : public VideoStreamEncoderObserver {
  18. public:
  19. MOCK_METHOD(void, OnEncodedFrameTimeMeasured, (int, int), (override));
  20. MOCK_METHOD(void, OnIncomingFrame, (int, int), (override));
  21. MOCK_METHOD(void,
  22. OnSendEncodedImage,
  23. (const EncodedImage&, const CodecSpecificInfo*),
  24. (override));
  25. MOCK_METHOD(void,
  26. OnEncoderImplementationChanged,
  27. (const std::string&),
  28. (override));
  29. MOCK_METHOD(void, OnFrameDropped, (DropReason), (override));
  30. MOCK_METHOD(void,
  31. OnEncoderReconfigured,
  32. (const VideoEncoderConfig&, const std::vector<VideoStream>&),
  33. (override));
  34. MOCK_METHOD(void,
  35. OnAdaptationChanged,
  36. (VideoAdaptationReason,
  37. const VideoAdaptationCounters&,
  38. const VideoAdaptationCounters&),
  39. (override));
  40. MOCK_METHOD(void, ClearAdaptationStats, (), (override));
  41. MOCK_METHOD(void,
  42. UpdateAdaptationSettings,
  43. (AdaptationSettings, AdaptationSettings),
  44. (override));
  45. MOCK_METHOD(void, OnMinPixelLimitReached, (), (override));
  46. MOCK_METHOD(void, OnInitialQualityResolutionAdaptDown, (), (override));
  47. MOCK_METHOD(void, OnSuspendChange, (bool), (override));
  48. MOCK_METHOD(void,
  49. OnBitrateAllocationUpdated,
  50. (const VideoCodec&, const VideoBitrateAllocation&),
  51. (override));
  52. MOCK_METHOD(void, OnEncoderInternalScalerUpdate, (bool), (override));
  53. MOCK_METHOD(int, GetInputFrameRate, (), (const, override));
  54. };
  55. class FakeFrameRateProvider : public MockVideoStreamEncoderObserver {
  56. public:
  57. FakeFrameRateProvider();
  58. void set_fps(int fps);
  59. };
  60. } // namespace webrtc
  61. #endif // CALL_ADAPTATION_TEST_FAKE_FRAME_RATE_PROVIDER_H_