OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2015 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_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | |
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | |
13 | |
14 #include <memory> | |
15 #include <vector> | |
16 | |
17 #include "webrtc/base/criticalsection.h" | |
18 #include "webrtc/base/thread_annotations.h" | |
19 #include "webrtc/modules/include/module_common_types.h" | |
20 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | |
21 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" | |
22 | |
23 namespace webrtc { | |
24 | |
25 class ProcessThread; | |
26 | |
27 class TransportFeedbackAdapter : public TransportFeedbackObserver, | |
28 public CallStatsObserver { | |
29 public: | |
30 explicit TransportFeedbackAdapter(Clock* clock); | |
31 virtual ~TransportFeedbackAdapter(); | |
32 | |
33 void SetBitrateEstimator(RemoteBitrateEstimator* rbe); | |
34 RemoteBitrateEstimator* GetBitrateEstimator() const { | |
35 return bitrate_estimator_.get(); | |
36 } | |
37 | |
38 // Implements TransportFeedbackObserver. | |
39 void AddPacket(uint16_t sequence_number, | |
40 size_t length, | |
41 int probe_cluster_id) override; | |
42 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); | |
43 | |
44 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; | |
45 std::vector<PacketInfo> GetTransportFeedbackVector() const override; | |
46 | |
47 // Implements CallStatsObserver. | |
48 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | |
49 | |
50 private: | |
51 std::vector<PacketInfo> GetPacketFeedbackVector( | |
52 const rtcp::TransportFeedback& feedback); | |
53 | |
54 rtc::CriticalSection lock_; | |
55 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); | |
56 std::unique_ptr<RemoteBitrateEstimator> bitrate_estimator_; | |
57 Clock* const clock_; | |
58 int64_t current_offset_ms_; | |
59 int64_t last_timestamp_us_; | |
60 std::vector<PacketInfo> last_packet_feedback_vector_; | |
61 }; | |
62 | |
63 } // namespace webrtc | |
64 | |
65 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | |
OLD | NEW |