| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bool report_perf_stats); | 42 bool report_perf_stats); |
| 43 ~RampUpTester() override; | 43 ~RampUpTester() override; |
| 44 | 44 |
| 45 size_t GetNumVideoStreams() const override; | 45 size_t GetNumVideoStreams() const override; |
| 46 size_t GetNumAudioStreams() const override; | 46 size_t GetNumAudioStreams() const override; |
| 47 size_t GetNumFlexfecStreams() const override; | 47 size_t GetNumFlexfecStreams() const override; |
| 48 | 48 |
| 49 void PerformTest() override; | 49 void PerformTest() override; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 virtual bool PollStats(); | 52 virtual void PollStats(); |
| 53 | 53 |
| 54 void AccumulateStats(const VideoSendStream::StreamStats& stream, | 54 void AccumulateStats(const VideoSendStream::StreamStats& stream, |
| 55 size_t* total_packets_sent, | 55 size_t* total_packets_sent, |
| 56 size_t* total_sent, | 56 size_t* total_sent, |
| 57 size_t* padding_sent, | 57 size_t* padding_sent, |
| 58 size_t* media_sent) const; | 58 size_t* media_sent) const; |
| 59 | 59 |
| 60 void ReportResult(const std::string& measurement, | 60 void ReportResult(const std::string& measurement, |
| 61 size_t value, | 61 size_t value, |
| 62 const std::string& units) const; | 62 const std::string& units) const; |
| 63 void TriggerTestDone(); | 63 void TriggerTestDone(); |
| 64 | 64 |
| 65 webrtc::RtcEventLogNullImpl event_log_; | 65 webrtc::RtcEventLogNullImpl event_log_; |
| 66 rtc::Event event_; | 66 rtc::Event stop_event_; |
| 67 Clock* const clock_; | 67 Clock* const clock_; |
| 68 FakeNetworkPipe::Config forward_transport_config_; | 68 FakeNetworkPipe::Config forward_transport_config_; |
| 69 const size_t num_video_streams_; | 69 const size_t num_video_streams_; |
| 70 const size_t num_audio_streams_; | 70 const size_t num_audio_streams_; |
| 71 const size_t num_flexfec_streams_; | 71 const size_t num_flexfec_streams_; |
| 72 const bool rtx_; | 72 const bool rtx_; |
| 73 const bool red_; | 73 const bool red_; |
| 74 Call* sender_call_; | 74 Call* sender_call_; |
| 75 VideoSendStream* send_stream_; | 75 VideoSendStream* send_stream_; |
| 76 test::PacketTransport* send_transport_; | 76 test::PacketTransport* send_transport_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 88 VideoSendStream::Config* send_config, | 88 VideoSendStream::Config* send_config, |
| 89 std::vector<VideoReceiveStream::Config>* receive_configs, | 89 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 90 VideoEncoderConfig* encoder_config) override; | 90 VideoEncoderConfig* encoder_config) override; |
| 91 void ModifyAudioConfigs( | 91 void ModifyAudioConfigs( |
| 92 AudioSendStream::Config* send_config, | 92 AudioSendStream::Config* send_config, |
| 93 std::vector<AudioReceiveStream::Config>* receive_configs) override; | 93 std::vector<AudioReceiveStream::Config>* receive_configs) override; |
| 94 void ModifyFlexfecConfigs( | 94 void ModifyFlexfecConfigs( |
| 95 std::vector<FlexfecReceiveStream::Config>* receive_configs) override; | 95 std::vector<FlexfecReceiveStream::Config>* receive_configs) override; |
| 96 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; | 96 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; |
| 97 | 97 |
| 98 static bool BitrateStatsPollingThread(void* obj); | 98 static void BitrateStatsPollingThread(void* obj); |
| 99 | 99 |
| 100 const int start_bitrate_bps_; | 100 const int start_bitrate_bps_; |
| 101 const int64_t min_run_time_ms_; | 101 const int64_t min_run_time_ms_; |
| 102 const bool report_perf_stats_; | 102 const bool report_perf_stats_; |
| 103 int expected_bitrate_bps_; | 103 int expected_bitrate_bps_; |
| 104 int64_t test_start_ms_; | 104 int64_t test_start_ms_; |
| 105 int64_t ramp_up_finished_ms_; | 105 int64_t ramp_up_finished_ms_; |
| 106 | 106 |
| 107 const std::string extension_type_; | 107 const std::string extension_type_; |
| 108 std::vector<uint32_t> video_ssrcs_; | 108 std::vector<uint32_t> video_ssrcs_; |
| 109 std::vector<uint32_t> video_rtx_ssrcs_; | 109 std::vector<uint32_t> video_rtx_ssrcs_; |
| 110 std::vector<uint32_t> audio_ssrcs_; | 110 std::vector<uint32_t> audio_ssrcs_; |
| 111 | 111 |
| 112 rtc::PlatformThread poller_thread_; | 112 rtc::PlatformThread poller_thread_; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 class RampUpDownUpTester : public RampUpTester { | 115 class RampUpDownUpTester : public RampUpTester { |
| 116 public: | 116 public: |
| 117 RampUpDownUpTester(size_t num_video_streams, | 117 RampUpDownUpTester(size_t num_video_streams, |
| 118 size_t num_audio_streams, | 118 size_t num_audio_streams, |
| 119 size_t num_flexfec_streams, | 119 size_t num_flexfec_streams, |
| 120 unsigned int start_bitrate_bps, | 120 unsigned int start_bitrate_bps, |
| 121 const std::string& extension_type, | 121 const std::string& extension_type, |
| 122 bool rtx, | 122 bool rtx, |
| 123 bool red, | 123 bool red, |
| 124 const std::vector<int>& loss_rates); | 124 const std::vector<int>& loss_rates); |
| 125 ~RampUpDownUpTester() override; | 125 ~RampUpDownUpTester() override; |
| 126 | 126 |
| 127 protected: | 127 protected: |
| 128 bool PollStats() override; | 128 void PollStats() override; |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 enum TestStates { | 131 enum TestStates { |
| 132 kFirstRampup = 0, | 132 kFirstRampup = 0, |
| 133 kLowRate, | 133 kLowRate, |
| 134 kSecondRampup, | 134 kSecondRampup, |
| 135 kTestEnd, | 135 kTestEnd, |
| 136 kTransitionToNextState, | 136 kTransitionToNextState, |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 Call::Config GetReceiverCallConfig() override; | 139 Call::Config GetReceiverCallConfig() override; |
| 140 | 140 |
| 141 std::string GetModifierString() const; | 141 std::string GetModifierString() const; |
| 142 int GetExpectedHighBitrate() const; | 142 int GetExpectedHighBitrate() const; |
| 143 int GetHighLinkCapacity() const; | 143 int GetHighLinkCapacity() const; |
| 144 size_t GetFecBytes() const; | 144 size_t GetFecBytes() const; |
| 145 bool ExpectingFec() const; | 145 bool ExpectingFec() const; |
| 146 void EvolveTestState(int bitrate_bps, bool suspended); | 146 void EvolveTestState(int bitrate_bps, bool suspended); |
| 147 | 147 |
| 148 const std::vector<int> link_rates_; | 148 const std::vector<int> link_rates_; |
| 149 TestStates test_state_; | 149 TestStates test_state_; |
| 150 TestStates next_state_; | 150 TestStates next_state_; |
| 151 int64_t state_start_ms_; | 151 int64_t state_start_ms_; |
| 152 int64_t interval_start_ms_; | 152 int64_t interval_start_ms_; |
| 153 int sent_bytes_; | 153 int sent_bytes_; |
| 154 std::vector<int> loss_rates_; | 154 std::vector<int> loss_rates_; |
| 155 }; | 155 }; |
| 156 } // namespace webrtc | 156 } // namespace webrtc |
| 157 #endif // WEBRTC_CALL_RAMPUP_TESTS_H_ | 157 #endif // WEBRTC_CALL_RAMPUP_TESTS_H_ |
| OLD | NEW |