Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: webrtc/video/rampup_tests.h

Issue 1362303002: Reland "Wire up send-side bandwidth estimation." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/rampup_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_VIDEO_RAMPUP_TESTS_H_
12 #define WEBRTC_VIDEO_RAMPUP_TESTS_H_ 12 #define WEBRTC_VIDEO_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/scoped_ptr.h" 18 #include "webrtc/base/scoped_ptr.h"
19 #include "webrtc/call.h" 19 #include "webrtc/call.h"
20 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" 20 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h"
21 #include "webrtc/system_wrappers/interface/event_wrapper.h" 21 #include "webrtc/system_wrappers/interface/event_wrapper.h"
22 #include "webrtc/test/call_test.h" 22 #include "webrtc/test/call_test.h"
23 #include "webrtc/video/transport_adapter.h" 23 #include "webrtc/video/transport_adapter.h"
24 24
25 namespace webrtc { 25 namespace webrtc {
26 26
27 static const int kTransmissionTimeOffsetExtensionId = 6; 27 static const int kTransmissionTimeOffsetExtensionId = 6;
28 static const int kAbsSendTimeExtensionId = 7; 28 static const int kAbsSendTimeExtensionId = 7;
29 static const int kTransportSequenceNumberExtensionId = 8;
29 static const unsigned int kSingleStreamTargetBps = 1000000; 30 static const unsigned int kSingleStreamTargetBps = 1000000;
30 31
31 class Clock; 32 class Clock;
33 class PacketRouter;
32 class ReceiveStatistics; 34 class ReceiveStatistics;
33 class RtpHeaderParser; 35 class RtpHeaderParser;
34 class RTPPayloadRegistry; 36 class RTPPayloadRegistry;
35 class RtpRtcp; 37 class RtpRtcp;
36 38
37 class StreamObserver : public newapi::Transport, public RemoteBitrateObserver { 39 class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
38 public: 40 public:
39 typedef std::map<uint32_t, int> BytesSentMap; 41 typedef std::map<uint32_t, int> BytesSentMap;
40 typedef std::map<uint32_t, uint32_t> SsrcMap; 42 typedef std::map<uint32_t, uint32_t> SsrcMap;
41 StreamObserver(const SsrcMap& rtx_media_ssrcs, 43 StreamObserver(const SsrcMap& rtx_media_ssrcs,
42 newapi::Transport* feedback_transport, 44 newapi::Transport* feedback_transport,
43 Clock* clock); 45 Clock* clock);
46 virtual ~StreamObserver();
44 47
45 void set_expected_bitrate_bps(unsigned int expected_bitrate_bps); 48 void set_expected_bitrate_bps(unsigned int expected_bitrate_bps);
46 49
47 void set_start_bitrate_bps(unsigned int start_bitrate_bps); 50 void set_start_bitrate_bps(unsigned int start_bitrate_bps);
48 51
49 void OnReceiveBitrateChanged(const std::vector<unsigned int>& ssrcs, 52 void OnReceiveBitrateChanged(const std::vector<unsigned int>& ssrcs,
50 unsigned int bitrate) override; 53 unsigned int bitrate) override;
51 54
52 bool SendRtp(const uint8_t* packet, size_t length) override; 55 bool SendRtp(const uint8_t* packet, size_t length) override;
53 56
54 bool SendRtcp(const uint8_t* packet, size_t length) override; 57 bool SendRtcp(const uint8_t* packet, size_t length) override;
55 58
56 EventTypeWrapper Wait(); 59 EventTypeWrapper Wait();
57 60
58 void SetRemoteBitrateEstimator(RemoteBitrateEstimator* rbe); 61 void SetRemoteBitrateEstimator(RemoteBitrateEstimator* rbe);
59 62
63 PacketRouter* GetPacketRouter();
64
60 private: 65 private:
61 void ReportResult(const std::string& measurement, 66 void ReportResult(const std::string& measurement,
62 size_t value, 67 size_t value,
63 const std::string& units); 68 const std::string& units);
64 void TriggerTestDone() EXCLUSIVE_LOCKS_REQUIRED(crit_); 69 void TriggerTestDone() EXCLUSIVE_LOCKS_REQUIRED(crit_);
65 70
66 Clock* const clock_; 71 Clock* const clock_;
67 const rtc::scoped_ptr<EventWrapper> test_done_; 72 const rtc::scoped_ptr<EventWrapper> test_done_;
68 const rtc::scoped_ptr<RtpHeaderParser> rtp_parser_; 73 const rtc::scoped_ptr<RtpHeaderParser> rtp_parser_;
69 rtc::scoped_ptr<RtpRtcp> rtp_rtcp_; 74 rtc::scoped_ptr<RtpRtcp> rtp_rtcp_;
75 rtc::scoped_ptr<PacketRouter> packet_router_;
70 internal::TransportAdapter feedback_transport_; 76 internal::TransportAdapter feedback_transport_;
71 const rtc::scoped_ptr<ReceiveStatistics> receive_stats_; 77 const rtc::scoped_ptr<ReceiveStatistics> receive_stats_;
72 const rtc::scoped_ptr<RTPPayloadRegistry> payload_registry_; 78 const rtc::scoped_ptr<RTPPayloadRegistry> payload_registry_;
73 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 79 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
74 80
75 rtc::CriticalSection crit_; 81 rtc::CriticalSection crit_;
76 unsigned int expected_bitrate_bps_ GUARDED_BY(crit_); 82 unsigned int expected_bitrate_bps_ GUARDED_BY(crit_);
77 unsigned int start_bitrate_bps_ GUARDED_BY(crit_); 83 unsigned int start_bitrate_bps_ GUARDED_BY(crit_);
78 SsrcMap rtx_media_ssrcs_ GUARDED_BY(crit_); 84 SsrcMap rtx_media_ssrcs_ GUARDED_BY(crit_);
79 size_t total_sent_ GUARDED_BY(crit_); 85 size_t total_sent_ GUARDED_BY(crit_);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 void RunRampUpTest(size_t num_streams, 159 void RunRampUpTest(size_t num_streams,
154 unsigned int start_bitrate_bps, 160 unsigned int start_bitrate_bps,
155 const std::string& extension_type, 161 const std::string& extension_type,
156 bool rtx, 162 bool rtx,
157 bool red); 163 bool red);
158 164
159 void RunRampUpDownUpTest(size_t number_of_streams, bool rtx, bool red); 165 void RunRampUpDownUpTest(size_t number_of_streams, bool rtx, bool red);
160 }; 166 };
161 } // namespace webrtc 167 } // namespace webrtc
162 #endif // WEBRTC_VIDEO_RAMPUP_TESTS_H_ 168 #endif // WEBRTC_VIDEO_RAMPUP_TESTS_H_
OLDNEW
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/rampup_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698