mock_video_decoder.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. MOCK_METHOD(int32_t,
  18. Decoded,
  19. (VideoFrame & decoded_image), // NOLINT
  20. (override));
  21. MOCK_METHOD(int32_t,
  22. Decoded,
  23. (VideoFrame & decoded_image, // NOLINT
  24. int64_t decode_time_ms),
  25. (override));
  26. MOCK_METHOD(void,
  27. Decoded,
  28. (VideoFrame & decoded_image, // NOLINT
  29. absl::optional<int32_t> decode_time_ms,
  30. absl::optional<uint8_t> qp),
  31. (override));
  32. };
  33. class MockVideoDecoder : public VideoDecoder {
  34. public:
  35. MOCK_METHOD(int32_t,
  36. InitDecode,
  37. (const VideoCodec* codec_settings, int32_t number_of_cores),
  38. (override));
  39. MOCK_METHOD(int32_t,
  40. Decode,
  41. (const EncodedImage& input_image,
  42. bool missing_frames,
  43. int64_t render_time_ms),
  44. (override));
  45. MOCK_METHOD(int32_t,
  46. RegisterDecodeCompleteCallback,
  47. (DecodedImageCallback * callback),
  48. (override));
  49. MOCK_METHOD(int32_t, Release, (), (override));
  50. };
  51. } // namespace webrtc
  52. #endif // API_TEST_MOCK_VIDEO_DECODER_H_