| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace rtcp { | 25 namespace rtcp { |
| 26 class TransportFeedback; | 26 class TransportFeedback; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Class used when send-side BWE is enabled: This proxy is instantiated on the | 29 // Class used when send-side BWE is enabled: This proxy is instantiated on the |
| 30 // receive side. It buffers a number of receive timestamps and then sends | 30 // receive side. It buffers a number of receive timestamps and then sends |
| 31 // transport feedback messages back too the send side. | 31 // transport feedback messages back too the send side. |
| 32 | 32 |
| 33 class RemoteEstimatorProxy : public RemoteBitrateEstimator { | 33 class RemoteEstimatorProxy : public RemoteBitrateEstimator { |
| 34 public: | 34 public: |
| 35 RemoteEstimatorProxy(Clock* clock, PacketRouter* packet_router); | 35 RemoteEstimatorProxy(const Clock* clock, PacketRouter* packet_router); |
| 36 virtual ~RemoteEstimatorProxy(); | 36 virtual ~RemoteEstimatorProxy(); |
| 37 | 37 |
| 38 void IncomingPacket(int64_t arrival_time_ms, | 38 void IncomingPacket(int64_t arrival_time_ms, |
| 39 size_t payload_size, | 39 size_t payload_size, |
| 40 const RTPHeader& header) override; | 40 const RTPHeader& header) override; |
| 41 void RemoveStream(uint32_t ssrc) override {} | 41 void RemoveStream(uint32_t ssrc) override {} |
| 42 bool LatestEstimate(std::vector<unsigned int>* ssrcs, | 42 bool LatestEstimate(std::vector<unsigned int>* ssrcs, |
| 43 unsigned int* bitrate_bps) const override; | 43 unsigned int* bitrate_bps) const override; |
| 44 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override {} | 44 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override {} |
| 45 void SetMinBitrate(int min_bitrate_bps) override {} | 45 void SetMinBitrate(int min_bitrate_bps) override {} |
| 46 int64_t TimeUntilNextProcess() override; | 46 int64_t TimeUntilNextProcess() override; |
| 47 void Process() override; | 47 void Process() override; |
| 48 void OnBitrateChanged(int bitrate); | 48 void OnBitrateChanged(int bitrate); |
| 49 | 49 |
| 50 static const int kMinSendIntervalMs; | 50 static const int kMinSendIntervalMs; |
| 51 static const int kMaxSendIntervalMs; | 51 static const int kMaxSendIntervalMs; |
| 52 static const int kDefaultSendIntervalMs; | 52 static const int kDefaultSendIntervalMs; |
| 53 static const int kBackWindowMs; | 53 static const int kBackWindowMs; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) | 56 void OnPacketArrival(uint16_t sequence_number, int64_t arrival_time) |
| 57 EXCLUSIVE_LOCKS_REQUIRED(&lock_); | 57 EXCLUSIVE_LOCKS_REQUIRED(&lock_); |
| 58 bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); | 58 bool BuildFeedbackPacket(rtcp::TransportFeedback* feedback_packet); |
| 59 | 59 |
| 60 Clock* const clock_; | 60 const Clock* const clock_; |
| 61 PacketRouter* const packet_router_; | 61 PacketRouter* const packet_router_; |
| 62 int64_t last_process_time_ms_; | 62 int64_t last_process_time_ms_; |
| 63 | 63 |
| 64 rtc::CriticalSection lock_; | 64 rtc::CriticalSection lock_; |
| 65 | 65 |
| 66 uint32_t media_ssrc_ GUARDED_BY(&lock_); | 66 uint32_t media_ssrc_ GUARDED_BY(&lock_); |
| 67 uint8_t feedback_sequence_ GUARDED_BY(&lock_); | 67 uint8_t feedback_sequence_ GUARDED_BY(&lock_); |
| 68 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); | 68 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(&lock_); |
| 69 int64_t window_start_seq_ GUARDED_BY(&lock_); | 69 int64_t window_start_seq_ GUARDED_BY(&lock_); |
| 70 // Map unwrapped seq -> time. | 70 // Map unwrapped seq -> time. |
| 71 std::map<int64_t, int64_t> packet_arrival_times_ GUARDED_BY(&lock_); | 71 std::map<int64_t, int64_t> packet_arrival_times_ GUARDED_BY(&lock_); |
| 72 int64_t send_interval_ms_ GUARDED_BY(&lock_); | 72 int64_t send_interval_ms_ GUARDED_BY(&lock_); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace webrtc | 75 } // namespace webrtc |
| 76 | 76 |
| 77 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ | 77 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_REMOTE_ESTIMATOR_PROXY_H_ |
| OLD | NEW |