• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
11 #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_DECODER_H_
12 #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_DECODER_H_
13 
14 #include <vector>
15 
16 #include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
17 #include "webrtc/system_wrappers/interface/clock.h"
18 
19 namespace webrtc {
20 namespace test {
21 
22 class FakeDecoder : public VideoDecoder {
23  public:
24   FakeDecoder();
~FakeDecoder()25   virtual ~FakeDecoder() {}
26 
27   virtual int32_t InitDecode(const VideoCodec* config,
28                              int32_t number_of_cores) OVERRIDE;
29 
30   virtual int32_t Decode(const EncodedImage& input,
31                          bool missing_frames,
32                          const RTPFragmentationHeader* fragmentation,
33                          const CodecSpecificInfo* codec_specific_info,
34                          int64_t render_time_ms) OVERRIDE;
35 
36   virtual int32_t RegisterDecodeCompleteCallback(
37       DecodedImageCallback* callback) OVERRIDE;
38 
39   virtual int32_t Release() OVERRIDE;
40   virtual int32_t Reset() OVERRIDE;
41 
42  private:
43   VideoCodec config_;
44   I420VideoFrame frame_;
45   DecodedImageCallback* callback_;
46 };
47 
48 class FakeH264Decoder : public FakeDecoder {
49  public:
~FakeH264Decoder()50   virtual ~FakeH264Decoder() {}
51 
52   virtual int32_t Decode(const EncodedImage& input,
53                          bool missing_frames,
54                          const RTPFragmentationHeader* fragmentation,
55                          const CodecSpecificInfo* codec_specific_info,
56                          int64_t render_time_ms) OVERRIDE;
57 };
58 }  // namespace test
59 }  // namespace webrtc
60 
61 #endif  // WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_DECODER_H_
62