pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #ifndef TEST_ENCODER_SETTINGS_H_ |
| 11 | #define TEST_ENCODER_SETTINGS_H_ |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 12 | |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 13 | #include <vector> |
| 14 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 15 | #include "call/video_receive_stream.h" |
| 16 | #include "call/video_send_stream.h" |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | namespace test { |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 20 | |
| 21 | class DefaultVideoStreamFactory |
| 22 | : public VideoEncoderConfig::VideoStreamFactoryInterface { |
| 23 | public: |
| 24 | DefaultVideoStreamFactory(); |
| 25 | |
| 26 | static const size_t kMaxNumberOfStreams = 3; |
| 27 | // Defined as {150000, 450000, 1500000}; |
| 28 | static const int kMaxBitratePerStream[]; |
| 29 | // Defined as {50000, 200000, 700000}; |
| 30 | static const int kDefaultMinBitratePerStream[]; |
| 31 | |
| 32 | private: |
| 33 | std::vector<VideoStream> CreateEncoderStreams( |
| 34 | int width, |
| 35 | int height, |
| 36 | const VideoEncoderConfig& encoder_config) override; |
| 37 | }; |
| 38 | |
| 39 | // Creates |encoder_config.number_of_streams| VideoStreams where index |
| 40 | // |encoder_config.number_of_streams -1| have width = |width|, height = |
| 41 | // |height|. The total max bitrate of all VideoStreams is |
| 42 | // |encoder_config.max_bitrate_bps|. |
| 43 | std::vector<VideoStream> CreateVideoStreams( |
| 44 | int width, |
| 45 | int height, |
| 46 | const webrtc::VideoEncoderConfig& encoder_config); |
| 47 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 48 | void FillEncoderConfiguration(VideoCodecType codec_type, |
| 49 | size_t num_streams, |
perkj | fa10b55 | 2016-10-02 23:45:26 -0700 | [diff] [blame] | 50 | VideoEncoderConfig* configuration); |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 51 | |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 +0000 | [diff] [blame] | 52 | VideoReceiveStream::Decoder CreateMatchingDecoder( |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 53 | int payload_type, |
| 54 | const std::string& payload_name); |
Niels Möller | 259a497 | 2018-04-05 15:36:51 +0200 | [diff] [blame] | 55 | |
| 56 | VideoReceiveStream::Decoder CreateMatchingDecoder( |
| 57 | const VideoSendStream::Config& config); |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 +0000 | [diff] [blame] | 58 | } // namespace test |
| 59 | } // namespace webrtc |
| 60 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 61 | #endif // TEST_ENCODER_SETTINGS_H_ |