blob: a3820baf7e5bdc4e9012fa3f707ceb127b2e5954 [file] [log] [blame]
sprang@webrtc.orgb589c652013-12-10 10:05:171/*
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_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
12#define WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
13
kwibergb670f852016-05-01 21:53:4614#include <memory>
sprang@webrtc.orgb589c652013-12-10 10:05:1715#include <vector>
16
pbos@webrtc.org1c655452014-09-17 09:02:2517#include "webrtc/video_encoder.h"
sprang@webrtc.orgb589c652013-12-10 10:05:1718
19namespace webrtc {
20namespace test {
21
22class ConfigurableFrameSizeEncoder : public VideoEncoder {
23 public:
pkasting@chromium.org0ab923a2014-11-20 22:28:1424 explicit ConfigurableFrameSizeEncoder(size_t max_frame_size);
sprang@webrtc.orgb589c652013-12-10 10:05:1725 virtual ~ConfigurableFrameSizeEncoder();
26
kjellander@webrtc.org860ac532015-03-04 12:58:3527 int32_t InitEncode(const VideoCodec* codec_settings,
28 int32_t number_of_cores,
29 size_t max_payload_size) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1730
Miguel Casas-Sanchez3ca60f32015-05-30 00:21:4031 int32_t Encode(const VideoFrame& input_image,
kjellander@webrtc.org860ac532015-03-04 12:58:3532 const CodecSpecificInfo* codec_specific_info,
pbosb63d8ad2015-10-19 09:39:0633 const std::vector<FrameType>* frame_types) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1734
kjellander@webrtc.org860ac532015-03-04 12:58:3535 int32_t RegisterEncodeCompleteCallback(
36 EncodedImageCallback* callback) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1737
kjellander@webrtc.org860ac532015-03-04 12:58:3538 int32_t Release() override;
sprang@webrtc.orgb589c652013-12-10 10:05:1739
kjellander@webrtc.org860ac532015-03-04 12:58:3540 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1741
Erik Språngfafcfc02016-11-16 15:41:3042 int32_t SetRateAllocation(const BitrateAllocation& allocation,
43 uint32_t framerate) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1744
kjellander@webrtc.org860ac532015-03-04 12:58:3545 int32_t SetPeriodicKeyFrames(bool enable) override;
sprang@webrtc.orgb589c652013-12-10 10:05:1746
pkasting@chromium.org0ab923a2014-11-20 22:28:1447 int32_t SetFrameSize(size_t size);
sprang@webrtc.orgb589c652013-12-10 10:05:1748
49 private:
50 EncodedImageCallback* callback_;
pkasting@chromium.org0ab923a2014-11-20 22:28:1451 const size_t max_frame_size_;
52 size_t current_frame_size_;
kwibergb670f852016-05-01 21:53:4653 std::unique_ptr<uint8_t[]> buffer_;
sprang@webrtc.orgb589c652013-12-10 10:05:1754};
55
56} // namespace test
57} // namespace webrtc
58
59#endif // WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_