Chromium Code Reviews| 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_REMOTE_ESTIMATOR_PROXY_H_ | 11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ |
| 12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ | 12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> | |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
| 19 #include "webrtc/base/optional.h" | |
| 18 #include "webrtc/modules/include/module_common_types.h" | 20 #include "webrtc/modules/include/module_common_types.h" |
| 19 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" | 21 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" |
| 20 | 22 |
| 21 namespace webrtc { | 23 namespace webrtc { |
| 22 | 24 |
| 23 class Clock; | 25 class Clock; |
| 24 class PacketRouter; | 26 class PacketRouter; |
| 25 namespace rtcp { | 27 namespace rtcp { |
| 26 class TransportFeedback; | 28 class TransportFeedback; |
| 27 } | 29 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 40 void IncomingPacket(int64_t arrival_time_ms, | 42 void IncomingPacket(int64_t arrival_time_ms, |
| 41 size_t payload_size, | 43 size_t payload_size, |
| 42 const RTPHeader& header) override; | 44 const RTPHeader& header) override; |
| 43 void RemoveStream(uint32_t ssrc) override {} | 45 void RemoveStream(uint32_t ssrc) override {} |
| 44 bool LatestEstimate(std::vector<unsigned int>* ssrcs, | 46 bool LatestEstimate(std::vector<unsigned int>* ssrcs, |
| 45 unsigned int* bitrate_bps) const override; | 47 unsigned int* bitrate_bps) const override; |
| 46 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override {} | 48 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override {} |
| 47 void SetMinBitrate(int min_bitrate_bps) override {} | 49 void SetMinBitrate(int min_bitrate_bps) override {} |
| 48 int64_t TimeUntilNextProcess() override; | 50 int64_t TimeUntilNextProcess() override; |
| 49 void Process() override; | 51 void Process() override; |
| 52 void OnBitrateChanged(int bitrate); | |
| 50 | 53 |
| 51 static const int kDefaultProcessIntervalMs; | 54 static const int kMinSendIntervalMs; |
| 55 static const int kMaxSendIntervalMs; | |
| 56 static const int kDefaultSendIntervalMs; | |
| 52 static const int kBackWindowMs; | 57 static const int kBackWindowMs; |
| 53 | 58 |
| 54 private: | 59 private: |
| 55 void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) | 60 void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) |
| 56 EXCLUSIVE_LOCKS_REQUIRED(&lock_); | 61 EXCLUSIVE_LOCKS_REQUIRED(&lock_); |
| 57 bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); | 62 bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); |
| 58 | 63 |
| 59 Clock* const clock_; | 64 Clock* const clock_; |
| 60 PacketRouter* const packet_router_; | 65 PacketRouter* const packet_router_; |
| 61 int64_t last_process_time_ms_; | 66 int64_t last_process_time_ms_; |
| 62 | 67 |
| 63 rtc::CriticalSection lock_; | 68 rtc::CriticalSection lock_; |
| 64 | 69 |
| 65 uint32_t media_ssrc_ GUARDED_BY(&lock_); | 70 uint32_t media_ssrc_ GUARDED_BY(&lock_); |
| 66 uint8_t feedback_sequence_ GUARDED_BY(&lock_); | 71 uint8_t feedback_sequence_ GUARDED_BY(&lock_); |
| 67 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); | 72 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); |
| 68 int64_t window_start_seq_ GUARDED_BY(&lock_); | 73 int64_t window_start_seq_ GUARDED_BY(&lock_); |
| 69 // Map unwrapped seq -> time. | 74 // Map unwrapped seq -> time. |
| 70 std::map<int64_t, int64_t> packet_arrival_times_ GUARDED_BY(&lock_); | 75 std::map<int64_t, int64_t> packet_arrival_times_ GUARDED_BY(&lock_); |
| 76 int send_interval_ms_ GUARDED_BY(&lock_); | |
|
stefan-webrtc
2016/11/03 10:28:43
int64_t for time
michaelt
2016/11/03 12:36:53
Done.
| |
| 71 }; | 77 }; |
| 72 | 78 |
| 73 } // namespace webrtc | 79 } // namespace webrtc |
| 74 | 80 |
| 75 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ | 81 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ |
| OLD | NEW |