Change RtpRtcp::SetRemb signature to match RtcpTransceiver::SetRemb
in particular change bitrate type to int64_t to follow style guide. With an extra interface it will allow to add both RtpRtcp module and RtcpTransceiver as feedback sender to PacketRouter Bug: webrtc:8239 Change-Id: I9ea265686d7cd2d709f0b42e8a983ebe1790a6ba Reviewed-on: https://webrtc-review.googlesource.com/32302 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21250}
This commit is contained in:
committed by
Commit Bot
parent
59283e4c66
commit
1de4b62955
@ -341,8 +341,7 @@ class RtpRtcp : public Module {
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
// Schedules sending REMB on next and following sender/receiver reports.
|
||||
virtual void SetRemb(uint32_t bitrate_bps,
|
||||
const std::vector<uint32_t>& ssrcs) = 0;
|
||||
virtual void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) = 0;
|
||||
// Stops sending REMB on next and following sender/receiver reports.
|
||||
virtual void UnsetRemb() = 0;
|
||||
|
||||
|
||||
@ -157,8 +157,7 @@ class MockRtpRtcp : public RtpRtcp {
|
||||
MOCK_METHOD1(SetRTCPVoIPMetrics, int32_t(const RTCPVoIPMetric* voip_metric));
|
||||
MOCK_METHOD1(SetRtcpXrRrtrStatus, void(bool enable));
|
||||
MOCK_CONST_METHOD0(RtcpXrRrtrStatus, bool());
|
||||
MOCK_METHOD2(SetRemb,
|
||||
void(uint32_t bitrate, const std::vector<uint32_t>& ssrcs));
|
||||
MOCK_METHOD2(SetRemb, void(int64_t bitrate, std::vector<uint32_t> ssrcs));
|
||||
MOCK_METHOD0(UnsetRemb, void());
|
||||
MOCK_CONST_METHOD0(TMMBR, bool());
|
||||
MOCK_METHOD1(SetTMMBRStatus, void(bool enable));
|
||||
|
||||
@ -230,10 +230,11 @@ int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RTCPSender::SetRemb(uint32_t bitrate, const std::vector<uint32_t>& ssrcs) {
|
||||
void RTCPSender::SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) {
|
||||
RTC_CHECK_GE(bitrate_bps, 0);
|
||||
rtc::CritScope lock(&critical_section_rtcp_sender_);
|
||||
remb_bitrate_ = bitrate;
|
||||
remb_ssrcs_ = ssrcs;
|
||||
remb_bitrate_ = bitrate_bps;
|
||||
remb_ssrcs_ = std::move(ssrcs);
|
||||
|
||||
SetFlag(kRtcpRemb, /*is_volatile=*/false);
|
||||
// Send a REMB immediately if we have a new REMB. The frequency of REMBs is
|
||||
|
||||
@ -120,7 +120,7 @@ class RTCPSender {
|
||||
int32_t nackSize = 0,
|
||||
const uint16_t* nackList = 0);
|
||||
|
||||
void SetRemb(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs);
|
||||
|
||||
void UnsetRemb();
|
||||
|
||||
@ -221,7 +221,7 @@ class RTCPSender {
|
||||
uint8_t sequence_number_fir_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
|
||||
|
||||
// REMB
|
||||
uint32_t remb_bitrate_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
|
||||
int64_t remb_bitrate_ RTC_GUARDED_BY(critical_section_rtcp_sender_);
|
||||
std::vector<uint32_t> remb_ssrcs_
|
||||
RTC_GUARDED_BY(critical_section_rtcp_sender_);
|
||||
|
||||
|
||||
@ -67,7 +67,8 @@ void RtcpTransceiver::SendCompoundPacket() {
|
||||
});
|
||||
}
|
||||
|
||||
void RtcpTransceiver::SetRemb(int bitrate_bps, std::vector<uint32_t> ssrcs) {
|
||||
void RtcpTransceiver::SetRemb(int64_t bitrate_bps,
|
||||
std::vector<uint32_t> ssrcs) {
|
||||
// TODO(danilchap): Replace with lambda with move capture when available.
|
||||
struct SetRembClosure {
|
||||
void operator()() {
|
||||
@ -76,7 +77,7 @@ void RtcpTransceiver::SetRemb(int bitrate_bps, std::vector<uint32_t> ssrcs) {
|
||||
}
|
||||
|
||||
rtc::WeakPtr<RtcpTransceiverImpl> ptr;
|
||||
int bitrate_bps;
|
||||
int64_t bitrate_bps;
|
||||
std::vector<uint32_t> ssrcs;
|
||||
};
|
||||
task_queue_->PostTask(SetRembClosure{ptr_, bitrate_bps, std::move(ssrcs)});
|
||||
|
||||
@ -40,7 +40,7 @@ class RtcpTransceiver {
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
// Includes REMB in following compound packets.
|
||||
void SetRemb(int bitrate_bps, std::vector<uint32_t> ssrcs);
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs);
|
||||
// Stops sending REMB in following compound packets.
|
||||
void UnsetRemb();
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ void RtcpTransceiverImpl::SendCompoundPacket() {
|
||||
ReschedulePeriodicCompoundPackets();
|
||||
}
|
||||
|
||||
void RtcpTransceiverImpl::SetRemb(int bitrate_bps,
|
||||
void RtcpTransceiverImpl::SetRemb(int64_t bitrate_bps,
|
||||
std::vector<uint32_t> ssrcs) {
|
||||
RTC_DCHECK_GE(bitrate_bps, 0);
|
||||
remb_.emplace();
|
||||
|
||||
@ -47,7 +47,7 @@ class RtcpTransceiverImpl {
|
||||
|
||||
void SendCompoundPacket();
|
||||
|
||||
void SetRemb(int bitrate_bps, std::vector<uint32_t> ssrcs);
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs);
|
||||
void UnsetRemb();
|
||||
|
||||
void SendNack(uint32_t ssrc, std::vector<uint16_t> sequence_numbers);
|
||||
|
||||
@ -629,9 +629,9 @@ int32_t ModuleRtpRtcpImpl::RemoteRTCPStat(
|
||||
}
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
void ModuleRtpRtcpImpl::SetRemb(uint32_t bitrate_bps,
|
||||
const std::vector<uint32_t>& ssrcs) {
|
||||
rtcp_sender_.SetRemb(bitrate_bps, ssrcs);
|
||||
void ModuleRtpRtcpImpl::SetRemb(int64_t bitrate_bps,
|
||||
std::vector<uint32_t> ssrcs) {
|
||||
rtcp_sender_.SetRemb(bitrate_bps, std::move(ssrcs));
|
||||
}
|
||||
|
||||
void ModuleRtpRtcpImpl::UnsetRemb() {
|
||||
|
||||
@ -192,8 +192,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
|
||||
std::vector<RTCPReportBlock>* receive_blocks) const override;
|
||||
|
||||
// (REMB) Receiver Estimated Max Bitrate.
|
||||
void SetRemb(uint32_t bitrate_bps,
|
||||
const std::vector<uint32_t>& ssrcs) override;
|
||||
void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) override;
|
||||
void UnsetRemb() override;
|
||||
|
||||
// (TMMBR) Temporary Max Media Bit Rate.
|
||||
|
||||
Reference in New Issue
Block a user