blob: 946f45cc762708ed213d77dbc9015042b97c96e7 [file] [log] [blame]
Sebastian Jansson652dc912018-04-19 15:09:151/*
2 * Copyright 2018 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 VIDEO_TEST_MOCK_VIDEO_STREAM_ENCODER_H_
11#define VIDEO_TEST_MOCK_VIDEO_STREAM_ENCODER_H_
12
Henrik Boströmf4a99912020-06-11 10:07:1413#include <vector>
14
Sebastian Jansson652dc912018-04-19 15:09:1515#include "test/gmock.h"
Jonas Oreland6c2dae22022-09-29 08:28:2416#include "video/video_stream_encoder_interface.h"
Sebastian Jansson652dc912018-04-19 15:09:1517
18namespace webrtc {
19
20class MockVideoStreamEncoder : public VideoStreamEncoderInterface {
21 public:
Danil Chapovalov91fdc602020-05-14 17:17:5122 MOCK_METHOD(void,
Henrik Boströmf4a99912020-06-11 10:07:1423 AddAdaptationResource,
24 (rtc::scoped_refptr<Resource>),
25 (override));
26 MOCK_METHOD(std::vector<rtc::scoped_refptr<Resource>>,
27 GetAdaptationResources,
28 (),
29 (override));
30 MOCK_METHOD(void,
Danil Chapovalov91fdc602020-05-14 17:17:5131 SetSource,
32 (rtc::VideoSourceInterface<VideoFrame>*,
33 const DegradationPreference&),
34 (override));
35 MOCK_METHOD(void, SetSink, (EncoderSink*, bool), (override));
36 MOCK_METHOD(void, SetStartBitrate, (int), (override));
Philipp Hanckea1b4eb22022-11-04 13:45:2337 MOCK_METHOD(void,
38 SendKeyFrame,
39 (const std::vector<VideoFrameType>&),
40 (override));
Danil Chapovalov91fdc602020-05-14 17:17:5141 MOCK_METHOD(void,
42 OnLossNotification,
43 (const VideoEncoder::LossNotification&),
44 (override));
45 MOCK_METHOD(void,
46 OnBitrateUpdated,
47 (DataRate, DataRate, DataRate, uint8_t, int64_t, double),
48 (override));
Danil Chapovalov91fdc602020-05-14 17:17:5149 MOCK_METHOD(void,
Danil Chapovalov91fdc602020-05-14 17:17:5150 SetFecControllerOverride,
51 (FecControllerOverride*),
52 (override));
53 MOCK_METHOD(void, Stop, (), (override));
Sebastian Jansson652dc912018-04-19 15:09:1554
Danil Chapovalov91fdc602020-05-14 17:17:5155 MOCK_METHOD(void,
56 MockedConfigureEncoder,
57 (const VideoEncoderConfig&, size_t));
Florent Castelliacabb362022-10-18 15:05:1658 MOCK_METHOD(void,
59 MockedConfigureEncoder,
60 (const VideoEncoderConfig&, size_t, SetParametersCallback));
Sebastian Jansson652dc912018-04-19 15:09:1561 // gtest generates implicit copy which is not allowed on VideoEncoderConfig,
62 // so we can't mock ConfigureEncoder directly.
63 void ConfigureEncoder(VideoEncoderConfig config,
Niels Möllerf1338562018-04-26 07:51:4764 size_t max_data_payload_length) {
65 MockedConfigureEncoder(config, max_data_payload_length);
Sebastian Jansson652dc912018-04-19 15:09:1566 }
Florent Castelliacabb362022-10-18 15:05:1667 void ConfigureEncoder(VideoEncoderConfig config,
68 size_t max_data_payload_length,
69 SetParametersCallback) {
70 MockedConfigureEncoder(config, max_data_payload_length);
71 }
Sebastian Jansson652dc912018-04-19 15:09:1572};
73
74} // namespace webrtc
75
76#endif // VIDEO_TEST_MOCK_VIDEO_STREAM_ENCODER_H_