blob: fa2a1b6249b5932a3fece64100372f25a39f4ad1 [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"
Yves Gerey3e707812018-11-28 16:47:49 +010020#include "common_types.h" // NOLINT(build/include)
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000021
22namespace webrtc {
23namespace test {
perkjfa10b552016-10-02 23:45:26 -070024
25class DefaultVideoStreamFactory
26 : public VideoEncoderConfig::VideoStreamFactoryInterface {
27 public:
28 DefaultVideoStreamFactory();
29
30 static const size_t kMaxNumberOfStreams = 3;
31 // Defined as {150000, 450000, 1500000};
32 static const int kMaxBitratePerStream[];
33 // Defined as {50000, 200000, 700000};
34 static const int kDefaultMinBitratePerStream[];
35
36 private:
37 std::vector<VideoStream> CreateEncoderStreams(
38 int width,
39 int height,
40 const VideoEncoderConfig& encoder_config) override;
41};
42
43// Creates |encoder_config.number_of_streams| VideoStreams where index
44// |encoder_config.number_of_streams -1| have width = |width|, height =
45// |height|. The total max bitrate of all VideoStreams is
46// |encoder_config.max_bitrate_bps|.
47std::vector<VideoStream> CreateVideoStreams(
48 int width,
49 int height,
50 const webrtc::VideoEncoderConfig& encoder_config);
51
Yves Gerey665174f2018-06-19 15:03:05 +020052void FillEncoderConfiguration(VideoCodecType codec_type,
53 size_t num_streams,
perkjfa10b552016-10-02 23:45:26 -070054 VideoEncoderConfig* configuration);
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000055
pbos@webrtc.org776e6f22014-10-29 15:28:39 +000056VideoReceiveStream::Decoder CreateMatchingDecoder(
Yves Gerey665174f2018-06-19 15:03:05 +020057 int payload_type,
58 const std::string& payload_name);
Niels Möller259a4972018-04-05 15:36:51 +020059
60VideoReceiveStream::Decoder CreateMatchingDecoder(
61 const VideoSendStream::Config& config);
pbos@webrtc.orgf577ae92014-03-19 08:43:57 +000062} // namespace test
63} // namespace webrtc
64
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020065#endif // TEST_ENCODER_SETTINGS_H_