blob: 86ef0bbc431146873622828df58a1ca5380be527 [file] [log] [blame]
pbos@webrtc.orgf577ae92014-03-19 08:43:571/*
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 04:47:3110#ifndef TEST_ENCODER_SETTINGS_H_
11#define TEST_ENCODER_SETTINGS_H_
pbos@webrtc.orgf577ae92014-03-19 08:43:5712
Yves Gerey3e707812018-11-28 15:47:4913#include <stddef.h>
Jonas Olssona4d87372019-07-05 17:08:3314
Yves Gerey3e707812018-11-28 15:47:4915#include <string>
perkjfa10b552016-10-03 06:45:2616#include <vector>
17
Yves Gerey3e707812018-11-28 15:47:4918#include "api/video_codecs/video_encoder_config.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3119#include "call/video_receive_stream.h"
20#include "call/video_send_stream.h"
pbos@webrtc.orgf577ae92014-03-19 08:43:5721
22namespace webrtc {
23namespace test {
perkjfa10b552016-10-03 06:45:2624
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 13:03:0552void FillEncoderConfiguration(VideoCodecType codec_type,
53 size_t num_streams,
perkjfa10b552016-10-03 06:45:2654 VideoEncoderConfig* configuration);
pbos@webrtc.orgf577ae92014-03-19 08:43:5755
pbos@webrtc.org776e6f22014-10-29 15:28:3956VideoReceiveStream::Decoder CreateMatchingDecoder(
Yves Gerey665174f2018-06-19 13:03:0557 int payload_type,
58 const std::string& payload_name);
Niels Möller259a4972018-04-05 13:36:5159
60VideoReceiveStream::Decoder CreateMatchingDecoder(
61 const VideoSendStream::Config& config);
pbos@webrtc.orgf577ae92014-03-19 08:43:5762} // namespace test
63} // namespace webrtc
64
Mirko Bonadei92ea95e2017-09-15 04:47:3165#endif // TEST_ENCODER_SETTINGS_H_