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 |
11 #ifndef WEBRTC_VIDEO_RAMPUP_TESTS_H_ | 11 #ifndef WEBRTC_CALL_RAMPUP_TESTS_H_ |
12 #define WEBRTC_VIDEO_RAMPUP_TESTS_H_ | 12 #define WEBRTC_CALL_RAMPUP_TESTS_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/event.h" | 18 #include "webrtc/base/event.h" |
19 #include "webrtc/base/scoped_ptr.h" | 19 #include "webrtc/base/scoped_ptr.h" |
20 #include "webrtc/call.h" | 20 #include "webrtc/call.h" |
21 #include "webrtc/call/transport_adapter.h" | |
22 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | |
23 #include "webrtc/test/call_test.h" | 21 #include "webrtc/test/call_test.h" |
24 | 22 |
25 namespace webrtc { | 23 namespace webrtc { |
26 | 24 |
27 static const int kTransmissionTimeOffsetExtensionId = 6; | 25 static const int kTransmissionTimeOffsetExtensionId = 6; |
28 static const int kAbsSendTimeExtensionId = 7; | 26 static const int kAbsSendTimeExtensionId = 7; |
29 static const int kTransportSequenceNumberExtensionId = 8; | 27 static const int kTransportSequenceNumberExtensionId = 8; |
30 static const unsigned int kSingleStreamTargetBps = 1000000; | 28 static const unsigned int kSingleStreamTargetBps = 1000000; |
31 | 29 |
32 class Clock; | 30 class Clock; |
33 class PacketRouter; | |
34 class ReceiveStatistics; | |
35 class RtpHeaderParser; | |
36 class RTPPayloadRegistry; | |
37 class RtpRtcp; | |
38 | 31 |
39 class RampUpTester : public test::EndToEndTest { | 32 class RampUpTester : public test::EndToEndTest { |
40 public: | 33 public: |
41 RampUpTester(size_t num_streams, | 34 RampUpTester(size_t num_video_streams, |
| 35 size_t num_audio_streams, |
42 unsigned int start_bitrate_bps, | 36 unsigned int start_bitrate_bps, |
43 const std::string& extension_type, | 37 const std::string& extension_type, |
44 bool rtx, | 38 bool rtx, |
45 bool red); | 39 bool red); |
46 ~RampUpTester() override; | 40 ~RampUpTester() override; |
47 | 41 |
48 void PerformTest() override; | 42 void PerformTest() override; |
49 | 43 |
50 protected: | 44 protected: |
51 virtual bool PollStats(); | 45 virtual bool PollStats(); |
52 | 46 |
53 void AccumulateStats(const VideoSendStream::StreamStats& stream, | 47 void AccumulateStats(const VideoSendStream::StreamStats& stream, |
54 size_t* total_packets_sent, | 48 size_t* total_packets_sent, |
55 size_t* total_sent, | 49 size_t* total_sent, |
56 size_t* padding_sent, | 50 size_t* padding_sent, |
57 size_t* media_sent) const; | 51 size_t* media_sent) const; |
58 | 52 |
59 void ReportResult(const std::string& measurement, | 53 void ReportResult(const std::string& measurement, |
60 size_t value, | 54 size_t value, |
61 const std::string& units) const; | 55 const std::string& units) const; |
62 void TriggerTestDone(); | 56 void TriggerTestDone(); |
63 | 57 |
64 rtc::Event event_; | 58 rtc::Event event_; |
65 Clock* const clock_; | 59 Clock* const clock_; |
66 FakeNetworkPipe::Config forward_transport_config_; | 60 FakeNetworkPipe::Config forward_transport_config_; |
67 const size_t num_streams_; | 61 const size_t num_video_streams_; |
| 62 const size_t num_audio_streams_; |
68 const bool rtx_; | 63 const bool rtx_; |
69 const bool red_; | 64 const bool red_; |
70 VideoSendStream* send_stream_; | 65 VideoSendStream* send_stream_; |
71 test::PacketTransport* send_transport_; | 66 test::PacketTransport* send_transport_; |
72 | 67 |
73 private: | 68 private: |
74 typedef std::map<uint32_t, uint32_t> SsrcMap; | 69 typedef std::map<uint32_t, uint32_t> SsrcMap; |
75 | 70 |
76 Call::Config GetSenderCallConfig() override; | 71 Call::Config GetSenderCallConfig() override; |
77 void OnStreamsCreated( | 72 void OnVideoStreamsCreated( |
78 VideoSendStream* send_stream, | 73 VideoSendStream* send_stream, |
79 const std::vector<VideoReceiveStream*>& receive_streams) override; | 74 const std::vector<VideoReceiveStream*>& receive_streams) override; |
80 void OnTransportsCreated(test::PacketTransport* send_transport, | 75 void OnTransportsCreated(test::PacketTransport* send_transport, |
81 test::PacketTransport* receive_transport) override; | 76 test::PacketTransport* receive_transport) override; |
82 size_t GetNumStreams() const; | 77 void ModifyVideoConfigs( |
83 void ModifyConfigs(VideoSendStream::Config* send_config, | 78 VideoSendStream::Config* send_config, |
84 std::vector<VideoReceiveStream::Config>* receive_configs, | 79 std::vector<VideoReceiveStream::Config>* receive_configs, |
85 VideoEncoderConfig* encoder_config) override; | 80 VideoEncoderConfig* encoder_config) override; |
86 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; | 81 void OnCallsCreated(Call* sender_call, Call* receiver_call) override; |
87 | 82 |
88 static bool BitrateStatsPollingThread(void* obj); | 83 static bool BitrateStatsPollingThread(void* obj); |
89 | 84 |
90 const int start_bitrate_bps_; | 85 const int start_bitrate_bps_; |
91 bool start_bitrate_verified_; | 86 bool start_bitrate_verified_; |
92 int expected_bitrate_bps_; | 87 int expected_bitrate_bps_; |
93 int64_t test_start_ms_; | 88 int64_t test_start_ms_; |
94 int64_t ramp_up_finished_ms_; | 89 int64_t ramp_up_finished_ms_; |
95 | 90 |
96 const std::string extension_type_; | 91 const std::string extension_type_; |
97 std::vector<uint32_t> ssrcs_; | 92 std::vector<uint32_t> video_ssrcs_; |
98 std::vector<uint32_t> rtx_ssrcs_; | 93 std::vector<uint32_t> video_rtx_ssrcs_; |
| 94 std::vector<uint32_t> audio_ssrcs_; |
99 SsrcMap rtx_ssrc_map_; | 95 SsrcMap rtx_ssrc_map_; |
100 | 96 |
101 rtc::PlatformThread poller_thread_; | 97 rtc::PlatformThread poller_thread_; |
102 Call* sender_call_; | 98 Call* sender_call_; |
103 }; | 99 }; |
104 | 100 |
105 class RampUpDownUpTester : public RampUpTester { | 101 class RampUpDownUpTester : public RampUpTester { |
106 public: | 102 public: |
107 RampUpDownUpTester(size_t num_streams, | 103 RampUpDownUpTester(size_t num_streams, |
108 unsigned int start_bitrate_bps, | 104 unsigned int start_bitrate_bps, |
(...skipping 16 matching lines...) Expand all Loading... |
125 | 121 |
126 std::string GetModifierString() const; | 122 std::string GetModifierString() const; |
127 void EvolveTestState(int bitrate_bps, bool suspended); | 123 void EvolveTestState(int bitrate_bps, bool suspended); |
128 | 124 |
129 TestStates test_state_; | 125 TestStates test_state_; |
130 int64_t state_start_ms_; | 126 int64_t state_start_ms_; |
131 int64_t interval_start_ms_; | 127 int64_t interval_start_ms_; |
132 int sent_bytes_; | 128 int sent_bytes_; |
133 }; | 129 }; |
134 } // namespace webrtc | 130 } // namespace webrtc |
135 #endif // WEBRTC_VIDEO_RAMPUP_TESTS_H_ | 131 #endif // WEBRTC_CALL_RAMPUP_TESTS_H_ |
OLD | NEW |