OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #ifndef WEBRTC_TEST_ENCODER_SETTINGS_H_ | 10 #ifndef WEBRTC_TEST_ENCODER_SETTINGS_H_ |
11 #define WEBRTC_TEST_ENCODER_SETTINGS_H_ | 11 #define WEBRTC_TEST_ENCODER_SETTINGS_H_ |
12 | 12 |
13 #include <vector> | |
14 | |
13 #include "webrtc/video_receive_stream.h" | 15 #include "webrtc/video_receive_stream.h" |
14 #include "webrtc/video_send_stream.h" | 16 #include "webrtc/video_send_stream.h" |
15 | 17 |
16 namespace webrtc { | 18 namespace webrtc { |
17 namespace test { | 19 namespace test { |
18 std::vector<VideoStream> CreateVideoStreams(size_t num_streams); | 20 |
21 class DefaultVideoStreamFactory | |
22 : public VideoEncoderConfig::VideoStreamFactoryInterface { | |
23 public: | |
24 DefaultVideoStreamFactory(); | |
25 | |
26 static const size_t kMaxNumberOfStreams = 3; | |
27 static constexpr int kMaxBitratePerStream[]{150000, 450000, 1500000}; | |
28 static constexpr int kDefaultMinBitratePerStream[]{50000, 200000, 700000}; | |
29 | |
30 private: | |
31 std::vector<VideoStream> CreateEncoderStreams( | |
32 int width, | |
33 int height, | |
34 const VideoEncoderConfig& encoder_config) override; | |
35 }; | |
36 | |
37 // Creates |encoder_config.number_of_streams| VideoStreams where layer 0 has | |
perkj_webrtc
2016/09/27 13:45:18
fix this comment
| |
38 // index |encoder_config.number_of_streams| have width = |width|, height = | |
39 // |height|. | |
40 // The total max bitrate of all VideoStreams is | |
41 // |encoder_config.max_bitrate_bps|. | |
42 std::vector<VideoStream> CreateVideoStreams( | |
43 int width, | |
44 int height, | |
45 const webrtc::VideoEncoderConfig& encoder_config); | |
46 | |
47 void FillEncoderConfiguration(size_t num_streams, | |
48 VideoEncoderConfig* configuration); | |
19 | 49 |
20 VideoReceiveStream::Decoder CreateMatchingDecoder( | 50 VideoReceiveStream::Decoder CreateMatchingDecoder( |
21 const VideoSendStream::Config::EncoderSettings& encoder_settings); | 51 const VideoSendStream::Config::EncoderSettings& encoder_settings); |
22 } // namespace test | 52 } // namespace test |
23 } // namespace webrtc | 53 } // namespace webrtc |
24 | 54 |
25 #endif // WEBRTC_TEST_ENCODER_SETTINGS_H_ | 55 #endif // WEBRTC_TEST_ENCODER_SETTINGS_H_ |
OLD | NEW |