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

Side by Side Diff: webrtc/voice_engine/transport_feedback_packet_loss_tracker.h

Issue 2754373002: TransportFeedbackPacketLossTracker to receive std::vector<PacketFeedback> in place of the entire fe… (Closed)
Patch Set: . Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_ 11 #ifndef WEBRTC_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
12 #define WEBRTC_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_ 12 #define WEBRTC_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
13 13
14 #include <map> 14 #include <map>
15 15
16 #include "webrtc/base/optional.h" 16 #include "webrtc/base/optional.h"
17 #include "webrtc/modules/include/module_common_types.h" 17 #include "webrtc/modules/include/module_common_types.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 20
21 namespace rtcp { 21 namespace rtcp {
22 class TransportFeedback; 22 class TransportFeedback;
23 } 23 }
24 24
25 struct PacketFeedback;
26
25 class TransportFeedbackPacketLossTracker final { 27 class TransportFeedbackPacketLossTracker final {
26 public: 28 public:
27 // * We count up to |max_window_size_ms| from the sent 29 // * We count up to |max_window_size_ms| from the sent
28 // time of the latest acked packet for the calculation of the metrics. 30 // time of the latest acked packet for the calculation of the metrics.
29 // * PLR (packet-loss-rate) is reliably computable once the statuses of 31 // * PLR (packet-loss-rate) is reliably computable once the statuses of
30 // |plr_min_num_acked_packets| packets are known. 32 // |plr_min_num_acked_packets| packets are known.
31 // * RPLR (recoverable-packet-loss-rate) is reliably computable once the 33 // * RPLR (recoverable-packet-loss-rate) is reliably computable once the
32 // statuses of |rplr_min_num_acked_pairs| pairs are known. 34 // statuses of |rplr_min_num_acked_pairs| pairs are known.
33 TransportFeedbackPacketLossTracker(int64_t max_window_size_ms, 35 TransportFeedbackPacketLossTracker(int64_t max_window_size_ms,
34 size_t plr_min_num_acked_packets, 36 size_t plr_min_num_acked_packets,
35 size_t rplr_min_num_acked_pairs); 37 size_t rplr_min_num_acked_pairs);
36 38
37 void OnPacketAdded(uint16_t seq_num, int64_t send_time_ms); 39 void OnPacketAdded(uint16_t seq_num, int64_t send_time_ms);
38 40
39 void OnReceivedTransportFeedback(const rtcp::TransportFeedback& feedback); 41 void OnNewTransportFeedbackVector(
42 const std::vector<PacketFeedback>& packet_feedbacks_vector);
40 43
41 // Returns the packet loss rate, if the window has enough packet statuses to 44 // Returns the packet loss rate, if the window has enough packet statuses to
42 // reliably compute it. Otherwise, returns empty. 45 // reliably compute it. Otherwise, returns empty.
43 rtc::Optional<float> GetPacketLossRate() const; 46 rtc::Optional<float> GetPacketLossRate() const;
44 47
45 // Returns the first-order-FEC recoverable packet loss rate, if the window has 48 // Returns the first-order-FEC recoverable packet loss rate, if the window has
46 // enough status pairs to reliably compute it. Otherwise, returns empty. 49 // enough status pairs to reliably compute it. Otherwise, returns empty.
47 rtc::Optional<float> GetRecoverablePacketLossRate() const; 50 rtc::Optional<float> GetRecoverablePacketLossRate() const;
48 51
49 // Verifies that the internal states are correct. Only used for tests. 52 // Verifies that the internal states are correct. Only used for tests.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // of all pairs of consecutive acked packets. 132 // of all pairs of consecutive acked packets.
130 const size_t min_num_acked_pairs_; 133 const size_t min_num_acked_pairs_;
131 size_t num_acked_pairs_; 134 size_t num_acked_pairs_;
132 size_t num_recoverable_losses_; 135 size_t num_recoverable_losses_;
133 } rplr_state_; 136 } rplr_state_;
134 }; 137 };
135 138
136 } // namespace webrtc 139 } // namespace webrtc
137 140
138 #endif // WEBRTC_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_ 141 #endif // WEBRTC_VOICE_ENGINE_TRANSPORT_FEEDBACK_PACKET_LOSS_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698