Chromium Code Reviews| 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..3d98d1028b21ca8e1cd6c2007fbd9efd071e8f1d 100644 |
| --- a/webrtc/modules/pacing/packet_router.h |
| +++ b/webrtc/modules/pacing/packet_router.h |
| @@ -44,15 +44,16 @@ class PacketRouter : public PacedSender::PacketSender, |
| // TODO(nisse): Delete, as soon as downstream app is updated. |
| RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) { |
| - AddReceiveRtpModule(rtp_module); |
| + constexpr bool remb_candidate = true; // Default to old behavior. |
| + AddReceiveRtpModule(rtp_module, remb_candidate); |
| } |
| RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) { |
| RemoveReceiveRtpModule(rtp_module); |
| } |
| - void AddSendRtpModule(RtpRtcp* rtp_module); |
| + void AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate); |
|
danilchap
2017/07/19 12:47:20
overload to make the change backward compatible.
(
eladalon
2017/07/27 15:57:26
Done.
(For posterity - keeping remb_candidate beca
|
| void RemoveSendRtpModule(RtpRtcp* rtp_module); |
| - void AddReceiveRtpModule(RtpRtcp* rtp_module); |
| + void AddReceiveRtpModule(RtpRtcp* rtp_module, bool remb_candidate); |
| void RemoveReceiveRtpModule(RtpRtcp* rtp_module); |
| // Implements PacedSender::Callback. |
| @@ -84,11 +85,19 @@ 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 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 caleld 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 +105,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); |