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