pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 | [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 04:47:31 | [diff] [blame] | 10 | #ifndef TEST_ENCODER_SETTINGS_H_ |
| 11 | #define TEST_ENCODER_SETTINGS_H_ |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 | [diff] [blame] | 12 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 13 | #include <stddef.h> |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 14 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 15 | #include <string> |
perkj | fa10b55 | 2016-10-03 06:45:26 | [diff] [blame] | 16 | #include <vector> |
| 17 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 18 | #include "api/video_codecs/video_encoder_config.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 19 | #include "call/video_receive_stream.h" |
| 20 | #include "call/video_send_stream.h" |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | namespace test { |
perkj | fa10b55 | 2016-10-03 06:45:26 | [diff] [blame] | 24 | |
| 25 | class 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|. |
| 47 | std::vector<VideoStream> CreateVideoStreams( |
| 48 | int width, |
| 49 | int height, |
| 50 | const webrtc::VideoEncoderConfig& encoder_config); |
| 51 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 52 | void FillEncoderConfiguration(VideoCodecType codec_type, |
| 53 | size_t num_streams, |
perkj | fa10b55 | 2016-10-03 06:45:26 | [diff] [blame] | 54 | VideoEncoderConfig* configuration); |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 | [diff] [blame] | 55 | |
pbos@webrtc.org | 776e6f2 | 2014-10-29 15:28:39 | [diff] [blame] | 56 | VideoReceiveStream::Decoder CreateMatchingDecoder( |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 57 | int payload_type, |
| 58 | const std::string& payload_name); |
Niels Möller | 259a497 | 2018-04-05 13:36:51 | [diff] [blame] | 59 | |
| 60 | VideoReceiveStream::Decoder CreateMatchingDecoder( |
| 61 | const VideoSendStream::Config& config); |
pbos@webrtc.org | f577ae9 | 2014-03-19 08:43:57 | [diff] [blame] | 62 | } // namespace test |
| 63 | } // namespace webrtc |
| 64 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 65 | #endif // TEST_ENCODER_SETTINGS_H_ |