diff options
author | Tomas Gunnarsson <tommi@webrtc.org> | 2021-04-23 20:31:08 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-25 15:27:38 +0000 |
commit | dbcf5d39188f24adda82d3d79235da9ff2a09e4e (patch) | |
tree | 911df34e84c1803dc3f3d494b1b941374d9e8332 /modules/rtp_rtcp/source/rtcp_sender.cc | |
parent | 5ec1d0b25c157482040963b5a6256dcbdcbd6435 (diff) | |
download | webrtc-dbcf5d39188f24adda82d3d79235da9ff2a09e4e.tar.gz |
Change return type of SetSendingStatus to be void.
The eventual implementation of changing the status will be async so the
return value isn't that useful and was in fact only being used to log
a warning if an error occured.
This change is to facilitate upcoming changes related to media engine.
Bug: webrtc:11993
Change-Id: Ia7f85a9ea18b2648b511fa356918cf32a201461f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215975
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33825}
Diffstat (limited to 'modules/rtp_rtcp/source/rtcp_sender.cc')
-rw-r--r-- | modules/rtp_rtcp/source/rtcp_sender.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc index 8b519b5c7d..ba63fd036f 100644 --- a/modules/rtp_rtcp/source/rtcp_sender.cc +++ b/modules/rtp_rtcp/source/rtcp_sender.cc @@ -187,8 +187,8 @@ bool RTCPSender::Sending() const { return sending_; } -int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, - bool sending) { +void RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, + bool sending) { bool sendRTCPBye = false; { MutexLock lock(&mutex_rtcp_sender_); @@ -201,9 +201,11 @@ int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, } sending_ = sending; } - if (sendRTCPBye) - return SendRTCP(feedback_state, kRtcpBye); - return 0; + if (sendRTCPBye) { + if (SendRTCP(feedback_state, kRtcpBye) != 0) { + RTC_LOG(LS_WARNING) << "Failed to send RTCP BYE"; + } + } } int32_t RTCPSender::SendLossNotification(const FeedbackState& feedback_state, @@ -213,11 +215,10 @@ int32_t RTCPSender::SendLossNotification(const FeedbackState& feedback_state, bool buffering_allowed) { int32_t error_code = -1; auto callback = [&](rtc::ArrayView<const uint8_t> packet) { - if (transport_->SendRtcp(packet.data(), packet.size())) { - error_code = 0; - if (event_log_) { - event_log_->Log(std::make_unique<RtcEventRtcpPacketOutgoing>(packet)); - } + transport_->SendRtcp(packet.data(), packet.size()); + error_code = 0; + if (event_log_) { + event_log_->Log(std::make_unique<RtcEventRtcpPacketOutgoing>(packet)); } }; absl::optional<PacketSender> sender; |