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

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h

Issue 2904183002: Structure of BBR's implementation,some main classes and functions which are going to be used (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h
diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h
new file mode 100644
index 0000000000000000000000000000000000000000..93f519966f52c833e20471d1a2e89d6b99da7ec1
--- /dev/null
+++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ *
+ */
+
+#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
+#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_
+
+#include <climits>
+#include <map>
+#include <memory>
+#include <vector>
+#include <utility>
philipel 2017/05/29 09:38:50 Please add an empty line between 19 and 20.
gnish2 2017/05/29 11:04:26 Done.
+#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h"
+#include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
+#include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
+#include "webrtc/modules/remote_bitrate_estimator/test/estimators/stats.h"
+
+namespace webrtc {
+namespace testing {
+namespace bwe {
philipel 2017/05/29 09:38:50 newline 27-28
gnish2 2017/05/29 11:04:26 Done.
+class BbrBweSender : public BweSender {
+ public:
+ BbrBweSender(int kbps, BitrateObserver* observer, Clock* clock);
+ virtual ~BbrBweSender();
+
+ enum Mode {
+ // Startup phase.
+ STARTUP,
+ // Queue draining phase,which where created during startup.
+ DRAIN,
+ // Cruising.
+ PROBE_BW,
+ // Temporarily decreasing throughtput in order to measure
+ // minimum RTT.
+ PROBE_RTT
+ };
+
+ enum RecoveryState {
philipel 2017/05/29 09:38:50 If this is not used yet, remove it.
gnish2 2017/05/29 11:04:26 Done.
+ // Do not limit number of packets sent.
+ NOT_IN_RECOVERY,
+ // Send one packet for each packet acknowledged.
+ CONSERVATION,
+ // Allow sending extra packet for each packet acknowledged
+ GROWTH
+ };
+
+ void OnPacketsSent(const Packets& packets) override;
+ void EnterStartup();
+ void EnterDrain(const FeedbackPacket& feedback);
+ void EnterCruise(const FeedbackPacket& feedback);
+ void EnterDecreasingThroughput(const FeedbackPacket& feedback);
+ bool UpdateBandwidthAndMinRtt(
+ int64_t now,
+ const std::vector<std::pair<uint64_t, int64_t> >& feedback_vector,
philipel 2017/05/29 09:38:50 "> >" to ">>"
gnish2 2017/05/29 11:04:26 Done.
+ int64_t bytes_acked);
+ void TryExitingStartup();
+ void TryExitingDrain(int64_t now);
+ void EnterProbeBw(int64_t now);
+ void EnterProbeRtt(int64_t now);
+ void TryExitingProbeRtt(int64_t now);
+ void TryUpdatingCyclePhase(int64_t now);
+ int GetPacketSize(const uint64_t sequence_number);
+ int GetFeedbackIntervalMs() const override;
+ void GiveFeedback(const FeedbackPacket& feedback) override;
+
+ int64_t TimeUntilNextProcess() override;
+ void Process() override;
+
+ private:
+ Clock* const clock_;
+ BitrateObserver* const observer_;
+ int64_t last_feedback_ms_ = 0;
+ std::map<uint16_t, int64_t> send_time_;
+ Mode mode_;
+ Data* stats_;
+ uint64_t round_trip_end_;
+ int64_t rt_count_;
+ int64_t last_packet_sent_;
+};
philipel 2017/05/29 09:38:50 newline :)
gnish2 2017/05/29 11:04:26 Done.
+class BbrBweReceiver : public BweReceiver {
+ public:
+ explicit BbrBweReceiver(int flow_id);
+ virtual ~BbrBweReceiver();
+ void ReceivePacket(int64_t arrival_time_ms,
+ const MediaPacket& media_packet) override;
+ FeedbackPacket* GetFeedback(int64_t now_ms) override;
+ static const int64_t kReceivingRateTimeWindowMs;
+ int64_t last_feedback_ms_;
+
+ private:
+ SimulatedClock clock_;
+ std::vector<std::pair<uint64_t, int64_t> > packet_feedbacks_;
+};
+} // namespace bwe
+} // namespace testing
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_BBR_H_

Powered by Google App Engine
This is Rietveld 408576698