Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_PROBING_CALCULATOR_H_ | |
| 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_PROBING_CALCULATOR_H_ | |
| 13 | |
| 14 #include <map> | |
| 15 #include <limits> | |
| 16 | |
| 17 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | |
| 18 | |
| 19 namespace webrtc { | |
|
brandtr
2016/07/07 14:58:30
Add newline in between.
philipel
2016/07/08 09:27:48
Done.
| |
| 20 class ProbingResultCallback { | |
| 21 public: | |
| 22 virtual void ProbingResult(int bps, int64_t timestamp) = 0; | |
| 23 virtual ~ProbingResultCallback() {} | |
| 24 }; | |
| 25 | |
| 26 class ProbingCalculator { | |
| 27 public: | |
| 28 explicit ProbingCalculator(ProbingResultCallback* result_callback); | |
| 29 void PacketFeedback(const PacketInfo& packet_info); | |
|
brandtr
2016/07/07 14:58:30
Maybe add a comment what this member function does
philipel
2016/07/08 09:27:48
Done.
| |
| 30 | |
| 31 private: | |
| 32 struct AggregatedCluster { | |
| 33 int num_probes = 0; | |
| 34 int64_t first_send_ms = std::numeric_limits<int64_t>::max(); | |
| 35 int64_t last_send_ms = 0; | |
| 36 int64_t first_receive_ms = std::numeric_limits<int64_t>::max(); | |
| 37 int64_t last_receive_ms = 0; | |
| 38 size_t size = 0; | |
| 39 }; | |
| 40 | |
| 41 std::map<int, AggregatedCluster> clusters_; | |
| 42 ProbingResultCallback* result_callback_; | |
| 43 int last_valid_cluster_id_; | |
| 44 }; | |
| 45 | |
| 46 } // namespace webrtc | |
| 47 | |
| 48 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_PROBING_CALCULATOR_H_ | |
| OLD | NEW |