2013-09-09 08:26:30 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-12-09 12:13:30 +01:00
|
|
|
#ifndef WEBRTC_TEST_FAKE_DECODER_H_
|
|
|
|
|
#define WEBRTC_TEST_FAKE_DECODER_H_
|
2013-09-09 08:26:30 +00:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2015-11-18 22:00:21 +01:00
|
|
|
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/clock.h"
|
2013-09-09 08:26:30 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
class FakeDecoder : public VideoDecoder {
|
|
|
|
|
public:
|
|
|
|
|
FakeDecoder();
|
2014-08-06 09:24:53 +00:00
|
|
|
virtual ~FakeDecoder() {}
|
2013-09-09 08:26:30 +00:00
|
|
|
|
2015-03-02 16:18:56 +00:00
|
|
|
int32_t InitDecode(const VideoCodec* config,
|
|
|
|
|
int32_t number_of_cores) override;
|
2013-09-09 08:26:30 +00:00
|
|
|
|
2015-03-02 16:18:56 +00:00
|
|
|
int32_t Decode(const EncodedImage& input,
|
|
|
|
|
bool missing_frames,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation,
|
|
|
|
|
const CodecSpecificInfo* codec_specific_info,
|
|
|
|
|
int64_t render_time_ms) override;
|
2013-09-09 08:26:30 +00:00
|
|
|
|
2015-03-02 16:18:56 +00:00
|
|
|
int32_t RegisterDecodeCompleteCallback(
|
|
|
|
|
DecodedImageCallback* callback) override;
|
2013-09-09 08:26:30 +00:00
|
|
|
|
2015-03-02 16:18:56 +00:00
|
|
|
int32_t Release() override;
|
2013-09-09 08:26:30 +00:00
|
|
|
|
2015-12-18 16:01:11 +01:00
|
|
|
const char* ImplementationName() const override;
|
|
|
|
|
|
|
|
|
|
static const char* kImplementationName;
|
|
|
|
|
|
2013-09-09 08:26:30 +00:00
|
|
|
private:
|
|
|
|
|
VideoCodec config_;
|
|
|
|
|
DecodedImageCallback* callback_;
|
|
|
|
|
};
|
2014-08-06 09:24:53 +00:00
|
|
|
|
|
|
|
|
class FakeH264Decoder : public FakeDecoder {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~FakeH264Decoder() {}
|
|
|
|
|
|
2015-03-02 16:18:56 +00:00
|
|
|
int32_t Decode(const EncodedImage& input,
|
|
|
|
|
bool missing_frames,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation,
|
|
|
|
|
const CodecSpecificInfo* codec_specific_info,
|
|
|
|
|
int64_t render_time_ms) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FakeNullDecoder : public FakeDecoder {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~FakeNullDecoder() {}
|
|
|
|
|
|
|
|
|
|
int32_t Decode(const EncodedImage& input,
|
|
|
|
|
bool missing_frames,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation,
|
|
|
|
|
const CodecSpecificInfo* codec_specific_info,
|
|
|
|
|
int64_t render_time_ms) override {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2014-08-06 09:24:53 +00:00
|
|
|
};
|
2013-09-09 08:26:30 +00:00
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2015-12-09 12:13:30 +01:00
|
|
|
#endif // WEBRTC_TEST_FAKE_DECODER_H_
|