blob: a90c861f1aceb9a9e94f67d88ad8ff10889532cf [file] [log] [blame]
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +00001/*
2 * Copyright (c) 2013 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef TEST_FAKE_DECODER_H_
12#define TEST_FAKE_DECODER_H_
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000013
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/video_coding/include/video_codec_interface.h"
17#include "system_wrappers/include/clock.h"
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000018
19namespace webrtc {
20namespace test {
21
22class FakeDecoder : public VideoDecoder {
23 public:
24 FakeDecoder();
stefan@webrtc.org79c33592014-08-06 09:24:53 +000025 virtual ~FakeDecoder() {}
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000026
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000027 int32_t InitDecode(const VideoCodec* config,
28 int32_t number_of_cores) override;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000029
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000030 int32_t Decode(const EncodedImage& input,
31 bool missing_frames,
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000032 const CodecSpecificInfo* codec_specific_info,
33 int64_t render_time_ms) override;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000034
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000035 int32_t RegisterDecodeCompleteCallback(
36 DecodedImageCallback* callback) override;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000037
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000038 int32_t Release() override;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000039
Peter Boströmb7d9a972015-12-18 16:01:11 +010040 const char* ImplementationName() const override;
41
42 static const char* kImplementationName;
43
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000044 private:
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000045 DecodedImageCallback* callback_;
philipel0e075722018-04-05 13:04:42 +020046 int width_;
47 int height_;
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000048};
stefan@webrtc.org79c33592014-08-06 09:24:53 +000049
50class FakeH264Decoder : public FakeDecoder {
51 public:
52 virtual ~FakeH264Decoder() {}
53
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000054 int32_t Decode(const EncodedImage& input,
55 bool missing_frames,
stefan@webrtc.org48ac2262015-03-02 16:18:56 +000056 const CodecSpecificInfo* codec_specific_info,
57 int64_t render_time_ms) override;
58};
59
pbos@webrtc.org0181b5f2013-09-09 08:26:30 +000060} // namespace test
61} // namespace webrtc
62
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020063#endif // TEST_FAKE_DECODER_H_