blob: e1272c749c63f516f95f5bf90309d71f0f8ae24d [file] [log] [blame]
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +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
11#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_ENCODER_H_
12#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_ENCODER_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
19namespace webrtc {
20
21class FakeEncoder : public VideoEncoder {
22 public:
23 explicit FakeEncoder(Clock* clock);
24
25 virtual ~FakeEncoder();
26
27 virtual int32_t InitEncode(const VideoCodec* config,
28 int32_t number_of_cores,
29 uint32_t max_payload_size) OVERRIDE;
30
31 virtual int32_t Encode(
32 const I420VideoFrame& input_image,
33 const CodecSpecificInfo* codec_specific_info,
34 const std::vector<VideoFrameType>* frame_types) OVERRIDE;
35
36 virtual int32_t RegisterEncodeCompleteCallback(
37 EncodedImageCallback* callback) OVERRIDE;
38
39 virtual int32_t Release() OVERRIDE;
40
41 virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
42
43 virtual int32_t SetRates(uint32_t new_target_bitrate,
44 uint32_t framerate) OVERRIDE;
45
46 private:
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000047 Clock* clock_;
48 VideoCodec config_;
49 EncodedImageCallback* callback_;
50 int target_bitrate_kbps_;
51 int64_t last_encode_time_ms_;
pbos@webrtc.org0f911c92013-08-22 12:34:58 +000052 uint8_t encoded_buffer_[100000];
stefan@webrtc.org55afdbe2013-08-22 09:29:56 +000053};
54} // namespace webrtc
55
56#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_FAKE_ENCODER_H_