You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright (c) 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 API_TEST_MOCK_VIDEO_ENCODER_H_
  11. #define API_TEST_MOCK_VIDEO_ENCODER_H_
  12. #include <vector>
  13. #include "api/video_codecs/video_encoder.h"
  14. #include "test/gmock.h"
  15. namespace webrtc {
  16. class MockEncodedImageCallback : public EncodedImageCallback {
  17. public:
  18. MockEncodedImageCallback();
  19. ~MockEncodedImageCallback();
  20. MOCK_METHOD3(OnEncodedImage,
  21. Result(const EncodedImage& encodedImage,
  22. const CodecSpecificInfo* codecSpecificInfo,
  23. const RTPFragmentationHeader* fragmentation));
  24. };
  25. class MockVideoEncoder : public VideoEncoder {
  26. public:
  27. MockVideoEncoder();
  28. ~MockVideoEncoder();
  29. MOCK_METHOD1(SetFecControllerOverride,
  30. void(FecControllerOverride* fec_controller_override));
  31. MOCK_CONST_METHOD2(Version, int32_t(int8_t* version, int32_t length));
  32. MOCK_METHOD3(InitEncode,
  33. int32_t(const VideoCodec* codecSettings,
  34. int32_t numberOfCores,
  35. size_t maxPayloadSize));
  36. MOCK_METHOD2(InitEncode,
  37. int32_t(const VideoCodec* codecSettings,
  38. const VideoEncoder::Settings& settings));
  39. MOCK_METHOD2(Encode,
  40. int32_t(const VideoFrame& inputImage,
  41. const std::vector<VideoFrameType>* frame_types));
  42. MOCK_METHOD1(RegisterEncodeCompleteCallback,
  43. int32_t(EncodedImageCallback* callback));
  44. MOCK_METHOD0(Release, int32_t());
  45. MOCK_METHOD0(Reset, int32_t());
  46. MOCK_METHOD1(SetRates, void(const RateControlParameters& parameters));
  47. MOCK_CONST_METHOD0(GetEncoderInfo, EncoderInfo(void));
  48. };
  49. } // namespace webrtc
  50. #endif // API_TEST_MOCK_VIDEO_ENCODER_H_