Add thread/sequence checks to ModuleRtpRtcpImpl.

This ended up with needing to fork the current implementation
in order to not break downstream projects that were inheriting
from it. While those get updated, we'll move on with the forked
class.

Bug: webrtc:11581,b/8278269
Change-Id: I05b596cbda71aa5b72894c31a7119d17d4761883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175500
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31334}
This commit is contained in:
Tommi
2020-05-20 09:32:51 +02:00
committed by Commit Bot
parent 704fb55255
commit 3a5742c880
12 changed files with 1851 additions and 32 deletions

View File

@ -33,7 +33,7 @@
#include "modules/rtp_rtcp/source/rtcp_packet/tmmbn.h"
#include "modules/rtp_rtcp/source/rtcp_packet/tmmbr.h"
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_impl.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
#include "modules/rtp_rtcp/source/time_util.h"
#include "modules/rtp_rtcp/source/tmmbr_help.h"
#include "rtc_base/checks.h"
@ -123,7 +123,7 @@ RTCPSender::FeedbackState::FeedbackState()
last_rr_ntp_secs(0),
last_rr_ntp_frac(0),
remote_sr(0),
module(nullptr) {}
receiver(nullptr) {}
RTCPSender::FeedbackState::FeedbackState(const FeedbackState&) = default;
@ -544,7 +544,7 @@ void RTCPSender::SetTargetBitrate(unsigned int target_bitrate) {
std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBR(
const RtcpContext& ctx) {
if (ctx.feedback_state_.module == nullptr)
if (ctx.feedback_state_.receiver == nullptr)
return nullptr;
// Before sending the TMMBR check the received TMMBN, only an owner is
// allowed to raise the bitrate:
@ -558,7 +558,7 @@ std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBR(
// will accuire criticalSectionRTCPReceiver_ is a potental deadlock but
// since RTCPreceiver is not doing the reverse we should be fine
std::vector<rtcp::TmmbItem> candidates =
ctx.feedback_state_.module->BoundingSet(&tmmbr_owner);
ctx.feedback_state_.receiver->BoundingSet(&tmmbr_owner);
if (!candidates.empty()) {
for (const auto& candidate : candidates) {