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 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 public: | 33 public: |
34 RampUpTester(size_t num_video_streams, | 34 RampUpTester(size_t num_video_streams, |
35 size_t num_audio_streams, | 35 size_t num_audio_streams, |
36 unsigned int start_bitrate_bps, | 36 unsigned int start_bitrate_bps, |
37 const std::string& extension_type, | 37 const std::string& extension_type, |
38 bool rtx, | 38 bool rtx, |
39 bool red); | 39 bool red); |
40 ~RampUpTester() override; | 40 ~RampUpTester() override; |
41 | 41 |
42 size_t GetNumVideoStreams() const override; | 42 size_t GetNumVideoStreams() const override; |
| 43 size_t GetNumAudioStreams() const override; |
43 | 44 |
44 void PerformTest() override; | 45 void PerformTest() override; |
45 | 46 |
46 protected: | 47 protected: |
47 virtual bool PollStats(); | 48 virtual bool PollStats(); |
48 | 49 |
49 void AccumulateStats(const VideoSendStream::StreamStats& stream, | 50 void AccumulateStats(const VideoSendStream::StreamStats& stream, |
50 size_t* total_packets_sent, | 51 size_t* total_packets_sent, |
51 size_t* total_sent, | 52 size_t* total_sent, |
52 size_t* padding_sent, | 53 size_t* padding_sent, |
(...skipping 19 matching lines...) Expand all Loading... |
72 | 73 |
73 Call::Config GetSenderCallConfig() override; | 74 Call::Config GetSenderCallConfig() override; |
74 void OnVideoStreamsCreated( | 75 void OnVideoStreamsCreated( |
75 VideoSendStream* send_stream, | 76 VideoSendStream* send_stream, |
76 const std::vector<VideoReceiveStream*>& receive_streams) override; | 77 const std::vector<VideoReceiveStream*>& receive_streams) override; |
77 test::PacketTransport* CreateSendTransport(Call* sender_call) override; | 78 test::PacketTransport* CreateSendTransport(Call* sender_call) override; |
78 void ModifyVideoConfigs( | 79 void ModifyVideoConfigs( |
79 VideoSendStream::Config* send_config, | 80 VideoSendStream::Config* send_config, |
80 std::vector<VideoReceiveStream::Config>* receive_configs, | 81 std::vector<VideoReceiveStream::Config>* receive_configs, |
81 VideoEncoderConfig* encoder_config) override; | 82 VideoEncoderConfig* encoder_config) override; |
| 83 void ModifyAudioConfigs( |
| 84 AudioSendStream::Config* send_config, |
| 85 std::vector<AudioReceiveStream::Config>* receive_configs) override; |
82 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; | 86 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; |
83 | 87 |
84 static bool BitrateStatsPollingThread(void* obj); | 88 static bool BitrateStatsPollingThread(void* obj); |
85 | 89 |
86 const int start_bitrate_bps_; | 90 const int start_bitrate_bps_; |
87 bool start_bitrate_verified_; | 91 bool start_bitrate_verified_; |
88 int expected_bitrate_bps_; | 92 int expected_bitrate_bps_; |
89 int64_t test_start_ms_; | 93 int64_t test_start_ms_; |
90 int64_t ramp_up_finished_ms_; | 94 int64_t ramp_up_finished_ms_; |
91 | 95 |
92 const std::string extension_type_; | 96 const std::string extension_type_; |
93 std::vector<uint32_t> video_ssrcs_; | 97 std::vector<uint32_t> video_ssrcs_; |
94 std::vector<uint32_t> video_rtx_ssrcs_; | 98 std::vector<uint32_t> video_rtx_ssrcs_; |
95 std::vector<uint32_t> audio_ssrcs_; | 99 std::vector<uint32_t> audio_ssrcs_; |
96 SsrcMap rtx_ssrc_map_; | 100 SsrcMap rtx_ssrc_map_; |
97 | 101 |
98 rtc::PlatformThread poller_thread_; | 102 rtc::PlatformThread poller_thread_; |
99 Call* sender_call_; | 103 Call* sender_call_; |
100 }; | 104 }; |
101 | 105 |
102 class RampUpDownUpTester : public RampUpTester { | 106 class RampUpDownUpTester : public RampUpTester { |
103 public: | 107 public: |
104 RampUpDownUpTester(size_t num_streams, | 108 RampUpDownUpTester(size_t num_video_streams, |
| 109 size_t num_audio_streams, |
105 unsigned int start_bitrate_bps, | 110 unsigned int start_bitrate_bps, |
106 const std::string& extension_type, | 111 const std::string& extension_type, |
107 bool rtx, | 112 bool rtx, |
108 bool red); | 113 bool red); |
109 ~RampUpDownUpTester() override; | 114 ~RampUpDownUpTester() override; |
110 | 115 |
111 protected: | 116 protected: |
112 bool PollStats() override; | 117 bool PollStats() override; |
113 | 118 |
114 private: | 119 private: |
115 static const int kHighBandwidthLimitBps = 80000; | 120 static const int kHighBandwidthLimitBps = 80000; |
116 static const int kExpectedHighBitrateBps = 60000; | 121 static const int kExpectedHighBitrateBps = 60000; |
117 static const int kLowBandwidthLimitBps = 20000; | 122 static const int kLowBandwidthLimitBps = 20000; |
118 static const int kExpectedLowBitrateBps = 20000; | 123 static const int kExpectedLowBitrateBps = 20000; |
119 enum TestStates { kFirstRampup, kLowRate, kSecondRampup }; | 124 enum TestStates { kFirstRampup, kLowRate, kSecondRampup }; |
120 | 125 |
121 Call::Config GetReceiverCallConfig() override; | 126 Call::Config GetReceiverCallConfig() override; |
122 | 127 |
123 std::string GetModifierString() const; | 128 std::string GetModifierString() const; |
124 void EvolveTestState(int bitrate_bps, bool suspended); | 129 void EvolveTestState(int bitrate_bps, bool suspended); |
125 | 130 |
126 TestStates test_state_; | 131 TestStates test_state_; |
127 int64_t state_start_ms_; | 132 int64_t state_start_ms_; |
128 int64_t interval_start_ms_; | 133 int64_t interval_start_ms_; |
129 int sent_bytes_; | 134 int sent_bytes_; |
130 }; | 135 }; |
131 } // namespace webrtc | 136 } // namespace webrtc |
132 #endif // WEBRTC_CALL_RAMPUP_TESTS_H_ | 137 #endif // WEBRTC_CALL_RAMPUP_TESTS_H_ |
OLD | NEW |