Index: webrtc/modules/pacing/packet_router.h |
diff --git a/webrtc/modules/pacing/packet_router.h b/webrtc/modules/pacing/packet_router.h |
index 12d726a2aacdabbfea8e920fd0c7f250a287ceb9..e5abdeb2ab18e2dec47ec4734aa44720bc4f65a1 100644 |
--- a/webrtc/modules/pacing/packet_router.h |
+++ b/webrtc/modules/pacing/packet_router.h |
@@ -49,11 +49,18 @@ class PacketRouter : public PacedSender::PacketSender, |
RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) { |
RemoveReceiveRtpModule(rtp_module); |
} |
- void AddSendRtpModule(RtpRtcp* rtp_module); |
+ |
+ void AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate); |
void RemoveSendRtpModule(RtpRtcp* rtp_module); |
+ RTC_DEPRECATED void AddSendRtpModule(RtpRtcp* rtp_module) { |
+ AddSendRtpModule(rtp_module, true); |
+ } |
- void AddReceiveRtpModule(RtpRtcp* rtp_module); |
+ void AddReceiveRtpModule(RtpRtcp* rtp_module, bool remb_candidate); |
void RemoveReceiveRtpModule(RtpRtcp* rtp_module); |
+ RTC_DEPRECATED void AddReceiveRtpModule(RtpRtcp* rtp_module) { |
+ AddReceiveRtpModule(rtp_module, true); |
+ } |
// Implements PacedSender::Callback. |
bool TimeToSendPacket(uint32_t ssrc, |
@@ -84,11 +91,20 @@ class PacketRouter : public PacedSender::PacketSender, |
virtual bool SendTransportFeedback(rtcp::TransportFeedback* packet); |
private: |
+ void AddRembModuleCandidate(RtpRtcp* candidate_module, bool sender) |
+ EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); |
+ void MaybeRemoveRembModuleCandidate(RtpRtcp* candidate_module, bool sender) |
+ EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); |
+ void UnsetActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); |
+ void DetermineActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_); |
+ |
rtc::RaceChecker pacer_race_; |
rtc::CriticalSection modules_crit_; |
std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_); |
std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_); |
+ // TODO(eladalon): remb_crit_ only ever held from one function, and it's not |
+ // clear if that function can actually be called from more than one thread. |
rtc::CriticalSection remb_crit_; |
// The last time a REMB was sent. |
int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_); |
@@ -96,6 +112,12 @@ class PacketRouter : public PacedSender::PacketSender, |
// The last bitrate update. |
uint32_t bitrate_bps_ GUARDED_BY(remb_crit_); |
+ // Candidates for the REMB module can be RTP sender/receiver modules, with |
+ // the sender modules taking precedence. |
+ std::vector<RtpRtcp*> sender_remb_candidates_ GUARDED_BY(modules_crit_); |
+ std::vector<RtpRtcp*> receiver_remb_candidates_ GUARDED_BY(modules_crit_); |
+ RtpRtcp* active_remb_module_ GUARDED_BY(modules_crit_); |
+ |
volatile int transport_seq_; |
RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); |