Index: webrtc/modules/pacing/packet_router.h |
diff --git a/webrtc/modules/pacing/packet_router.h b/webrtc/modules/pacing/packet_router.h |
index ffc0c1a59d3bc8f86ecea77aed4ac05d6ebe139d..ecf70d0e32051ce34d62b91a28096fcae53524ba 100644 |
--- a/webrtc/modules/pacing/packet_router.h |
+++ b/webrtc/modules/pacing/packet_router.h |
@@ -20,6 +20,7 @@ |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/common_types.h" |
#include "webrtc/modules/pacing/paced_sender.h" |
+#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" |
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
namespace webrtc { |
@@ -35,7 +36,8 @@ class TransportFeedback; |
// (receiver report). For the latter case, we also keep track of the |
// receive modules. |
class PacketRouter : public PacedSender::PacketSender, |
- public TransportSequenceNumberAllocator { |
+ public TransportSequenceNumberAllocator, |
+ public RemoteBitrateObserver { |
public: |
PacketRouter(); |
virtual ~PacketRouter(); |
@@ -66,8 +68,16 @@ class PacketRouter : public PacedSender::PacketSender, |
void SetTransportWideSequenceNumber(uint16_t sequence_number); |
uint16_t AllocateSequenceNumber() override; |
+ // Called every time there is a new bitrate estimate for a receive channel |
+ // group. This call will trigger a new RTCP REMB packet if the bitrate |
+ // estimate has decreased or if no RTCP REMB packet has been sent for |
+ // a certain time interval. |
+ // Implements RtpReceiveBitrateUpdate. |
+ void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, |
+ uint32_t bitrate) override; |
+ |
// Send transport feedback packet to send-side. |
- virtual bool SendFeedback(rtcp::TransportFeedback* packet); |
+ virtual bool SendTransportFeedback(rtcp::TransportFeedback* packet); |
private: |
rtc::ThreadChecker pacer_thread_checker_; |
@@ -75,6 +85,13 @@ class PacketRouter : public PacedSender::PacketSender, |
std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_); |
std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_); |
+ rtc::CriticalSection remb_crit_; |
+ // The last time a REMB was sent. |
+ int64_t last_remb_time_ GUARDED_BY(remb_crit_); |
+ uint32_t last_send_bitrate_ GUARDED_BY(remb_crit_); |
+ // The last bitrate update. |
+ uint32_t bitrate_ GUARDED_BY(remb_crit_); |
stefan-webrtc
2017/04/03 12:31:51
Add units to these members
nisse-webrtc
2017/04/03 14:45:02
Done.
|
+ |
volatile int transport_seq_; |
RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); |