2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
12 #define WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
16 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
17 #include "webrtc/video_encoder.h"
22 class ConfigurableFrameSizeEncoder : public VideoEncoder {
24 explicit ConfigurableFrameSizeEncoder(uint32_t max_frame_size);
25 virtual ~ConfigurableFrameSizeEncoder();
27 virtual int32_t InitEncode(const VideoCodec* codec_settings,
28 int32_t number_of_cores,
29 uint32_t max_payload_size) OVERRIDE;
31 virtual int32_t Encode(const I420VideoFrame& input_image,
32 const CodecSpecificInfo* codec_specific_info,
33 const std::vector<VideoFrameType>* frame_types)
36 virtual int32_t RegisterEncodeCompleteCallback(EncodedImageCallback* callback)
39 virtual int32_t Release() OVERRIDE;
41 virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) OVERRIDE;
43 virtual int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) OVERRIDE;
45 virtual int32_t SetPeriodicKeyFrames(bool enable) OVERRIDE;
47 virtual int32_t CodecConfigParameters(uint8_t* buffer, int32_t size) OVERRIDE;
49 int32_t SetFrameSize(uint32_t size);
52 EncodedImageCallback* callback_;
53 const uint32_t max_frame_size_;
54 uint32_t current_frame_size_;
55 scoped_ptr<uint8_t[]> buffer_;
61 #endif // WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_