blob: e7d42098c429ead74255237a4d7ebfae17802df6 [file] [log] [blame]
Erik Språngc84cd952018-10-15 11:55:13 +02001/*
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
11#ifndef API_TEST_MOCK_VIDEO_DECODER_H_
12#define API_TEST_MOCK_VIDEO_DECODER_H_
13
14#include "api/video_codecs/video_decoder.h"
15#include "test/gmock.h"
16
17namespace webrtc {
18
19class MockDecodedImageCallback : public DecodedImageCallback {
20 public:
21 MockDecodedImageCallback();
22 ~MockDecodedImageCallback() override;
23
24 MOCK_METHOD1(Decoded, int32_t(VideoFrame& decodedImage)); // NOLINT
25 MOCK_METHOD2(Decoded,
26 int32_t(VideoFrame& decodedImage, // NOLINT
27 int64_t decode_time_ms));
28 MOCK_METHOD3(Decoded,
29 void(VideoFrame& decodedImage, // NOLINT
30 absl::optional<int32_t> decode_time_ms,
31 absl::optional<uint8_t> qp));
Erik Språngc84cd952018-10-15 11:55:13 +020032};
33
34class MockVideoDecoder : public VideoDecoder {
35 public:
36 MockVideoDecoder();
37 ~MockVideoDecoder() override;
38
39 MOCK_METHOD2(InitDecode,
40 int32_t(const VideoCodec* codecSettings, int32_t numberOfCores));
Niels Möller7aacdd92019-03-25 09:11:40 +010041 MOCK_METHOD3(Decode,
Erik Språngc84cd952018-10-15 11:55:13 +020042 int32_t(const EncodedImage& inputImage,
43 bool missingFrames,
Erik Språngc84cd952018-10-15 11:55:13 +020044 int64_t renderTimeMs));
45 MOCK_METHOD1(RegisterDecodeCompleteCallback,
46 int32_t(DecodedImageCallback* callback));
47 MOCK_METHOD0(Release, int32_t());
48 MOCK_METHOD0(Copy, VideoDecoder*());
49};
50
51} // namespace webrtc
52
53#endif // API_TEST_MOCK_VIDEO_DECODER_H_