blob: 3c740f01d8d99dd3fc34e7d03ccab19930aa4f74 [file] [log] [blame]
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +00001/*
2 * Copyright (c) 2014 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 */
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef TEST_ENCODER_SETTINGS_H_
11#define TEST_ENCODER_SETTINGS_H_
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <stddef.h>
14#include <string>
perkjfa10b552016-10-02 23:45:26 -070015#include <vector>
16
Yves Gerey3e707812018-11-28 16:47:49 +010017#include "api/video_codecs/video_encoder_config.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "call/video_receive_stream.h"
19#include "call/video_send_stream.h"
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000020
21namespace webrtc {
22namespace test {
perkjfa10b552016-10-02 23:45:26 -070023
24class DefaultVideoStreamFactory
25 : public VideoEncoderConfig::VideoStreamFactoryInterface {
26 public:
27 DefaultVideoStreamFactory();
28
29 static const size_t kMaxNumberOfStreams = 3;
30 // Defined as {150000, 450000, 1500000};
31 static const int kMaxBitratePerStream[];
32 // Defined as {50000, 200000, 700000};
33 static const int kDefaultMinBitratePerStream[];
34
35 private:
36 std::vector<VideoStream> CreateEncoderStreams(
37 int width,
38 int height,
39 const VideoEncoderConfig& encoder_config) override;
40};
41
42// Creates |encoder_config.number_of_streams| VideoStreams where index
43// |encoder_config.number_of_streams -1| have width = |width|, height =
44// |height|. The total max bitrate of all VideoStreams is
45// |encoder_config.max_bitrate_bps|.
46std::vector<VideoStream> CreateVideoStreams(
47 int width,
48 int height,
49 const webrtc::VideoEncoderConfig& encoder_config);
50
Yves Gerey665174f2018-06-19 15:03:05 +020051void FillEncoderConfiguration(VideoCodecType codec_type,
52 size_t num_streams,
perkjfa10b552016-10-02 23:45:26 -070053 VideoEncoderConfig* configuration);
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000054
pbos@webrtc.org776e6f22014-10-29 15:28:39 +000055VideoReceiveStream::Decoder CreateMatchingDecoder(
Yves Gerey665174f2018-06-19 15:03:05 +020056 int payload_type,
57 const std::string& payload_name);
Niels Möller259a4972018-04-05 15:36:51 +020058
59VideoReceiveStream::Decoder CreateMatchingDecoder(
60 const VideoSendStream::Config& config);
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000061} // namespace test
62} // namespace webrtc
63
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020064#endif // TEST_ENCODER_SETTINGS_H_