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.

53 lines
1.7 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_DECODER_H_
  11. #define API_TEST_MOCK_VIDEO_DECODER_H_
  12. #include "api/video_codecs/video_decoder.h"
  13. #include "test/gmock.h"
  14. namespace webrtc {
  15. class MockDecodedImageCallback : public DecodedImageCallback {
  16. public:
  17. MockDecodedImageCallback();
  18. ~MockDecodedImageCallback() override;
  19. MOCK_METHOD1(Decoded, int32_t(VideoFrame& decodedImage)); // NOLINT
  20. MOCK_METHOD2(Decoded,
  21. int32_t(VideoFrame& decodedImage, // NOLINT
  22. int64_t decode_time_ms));
  23. MOCK_METHOD3(Decoded,
  24. void(VideoFrame& decodedImage, // NOLINT
  25. absl::optional<int32_t> decode_time_ms,
  26. absl::optional<uint8_t> qp));
  27. };
  28. class MockVideoDecoder : public VideoDecoder {
  29. public:
  30. MockVideoDecoder();
  31. ~MockVideoDecoder() override;
  32. MOCK_METHOD2(InitDecode,
  33. int32_t(const VideoCodec* codecSettings, int32_t numberOfCores));
  34. MOCK_METHOD3(Decode,
  35. int32_t(const EncodedImage& inputImage,
  36. bool missingFrames,
  37. int64_t renderTimeMs));
  38. MOCK_METHOD1(RegisterDecodeCompleteCallback,
  39. int32_t(DecodedImageCallback* callback));
  40. MOCK_METHOD0(Release, int32_t());
  41. MOCK_METHOD0(Copy, VideoDecoder*());
  42. };
  43. } // namespace webrtc
  44. #endif // API_TEST_MOCK_VIDEO_DECODER_H_