OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | 11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ |
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | 12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
17 #include "webrtc/base/thread_annotations.h" | 17 #include "webrtc/base/thread_annotations.h" |
18 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 18 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
19 #include "webrtc/modules/include/module_common_types.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" | 20 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" |
22 | 21 |
23 namespace webrtc { | 22 namespace webrtc { |
24 | 23 |
25 class ProcessThread; | 24 class ProcessThread; |
25 class RemoteBitrateEstimator; | |
26 | 26 |
27 class TransportFeedbackAdapter : public TransportFeedbackObserver, | 27 class TransportFeedbackAdapter : public TransportFeedbackObserver, |
28 public CallStatsObserver, | 28 public CallStatsObserver, |
29 public RemoteBitrateObserver { | 29 public RemoteBitrateObserver { |
30 public: | 30 public: |
31 TransportFeedbackAdapter(BitrateController* bitrate_controller, | 31 TransportFeedbackAdapter(BitrateController* bitrate_controller, Clock* clock); |
32 Clock* clock, | |
33 ProcessThread* process_thread); | |
34 virtual ~TransportFeedbackAdapter(); | 32 virtual ~TransportFeedbackAdapter(); |
35 | 33 |
36 void AddPacket(uint16_t sequence_number, | 34 void AddPacket(uint16_t sequence_number, |
the sun
2016/02/17 13:50:55
Can we group the overrides by interface, like else
stefan-webrtc
2016/02/17 14:14:27
Done.
| |
37 size_t length, | 35 size_t length, |
38 bool was_paced) override; | 36 bool was_paced) override; |
39 | 37 |
40 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); | 38 void OnSentPacket(uint16_t sequence_number, int64_t send_time_ms); |
41 | 39 |
42 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; | 40 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; |
43 | 41 |
44 void SetBitrateEstimator(RemoteBitrateEstimator* rbe); | 42 void SetBitrateEstimator(RemoteBitrateEstimator* rbe); |
45 | 43 |
46 RemoteBitrateEstimator* GetBitrateEstimator() const { | 44 RemoteBitrateEstimator* GetBitrateEstimator() const { |
47 return bitrate_estimator_.get(); | 45 return bitrate_estimator_.get(); |
48 } | 46 } |
49 | 47 |
48 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | |
49 | |
50 private: | 50 private: |
51 void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, | 51 void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, |
52 uint32_t bitrate) override; | 52 uint32_t bitrate) override; |
53 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | |
54 | 53 |
55 rtc::CriticalSection lock_; | 54 rtc::CriticalSection lock_; |
56 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); | 55 SendTimeHistory send_time_history_ GUARDED_BY(&lock_); |
57 BitrateController* bitrate_controller_; | 56 BitrateController* bitrate_controller_; |
58 rtc::scoped_ptr<RemoteBitrateEstimator> bitrate_estimator_; | 57 rtc::scoped_ptr<RemoteBitrateEstimator> bitrate_estimator_; |
59 ProcessThread* const process_thread_; | |
60 Clock* const clock_; | 58 Clock* const clock_; |
61 int64_t current_offset_ms_; | 59 int64_t current_offset_ms_; |
62 int64_t last_timestamp_us_; | 60 int64_t last_timestamp_us_; |
63 }; | 61 }; |
64 | 62 |
65 } // namespace webrtc | 63 } // namespace webrtc |
66 | 64 |
67 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ | 65 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TRANSPORT_FEEDBACK_ADAPTER_H_ |
OLD | NEW |