Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1278)

Unified Diff: webrtc/modules/rtp_rtcp/source/flexfec_sender.cc

Issue 2565693002: [OLD] Change sequence checker to lock in FlexfecSender. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/flexfec_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/flexfec_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/flexfec_sender.cc b/webrtc/modules/rtp_rtcp/source/flexfec_sender.cc
index ec8bbdcbe9cae9fb3e48f3beb730d3f8e7c335b8..b9bfb2f72a0528696fd9cd47cadd99be9e45c017 100644
--- a/webrtc/modules/rtp_rtcp/source/flexfec_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/flexfec_sender.cc
@@ -80,10 +80,6 @@ FlexfecSender::FlexfecSender(
// This object should not have been instantiated if FlexFEC is disabled.
RTC_DCHECK_GE(payload_type, 0);
RTC_DCHECK_LE(payload_type, 127);
-
- // It's OK to create this object on a different thread/task queue than
- // the one used during main operation.
- sequence_checker_.Detach();
}
FlexfecSender::~FlexfecSender() = default;
@@ -91,13 +87,13 @@ FlexfecSender::~FlexfecSender() = default;
// We are reusing the implementation from UlpfecGenerator for SetFecParameters,
// AddRtpPacketAndGenerateFec, and FecAvailable.
void FlexfecSender::SetFecParameters(const FecProtectionParams& params) {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_);
+ rtc::CritScope cs(&crit_sect_);
ulpfec_generator_.SetFecParameters(params);
}
bool FlexfecSender::AddRtpPacketAndGenerateFec(
const RtpPacketToSend& packet) {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_);
+ rtc::CritScope cs(&crit_sect_);
// TODO(brandtr): Generalize this SSRC check when we support multistream
// protection.
RTC_DCHECK_EQ(packet.Ssrc(), protected_media_ssrc_);
@@ -106,13 +102,13 @@ bool FlexfecSender::AddRtpPacketAndGenerateFec(
}
bool FlexfecSender::FecAvailable() const {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_);
+ rtc::CritScope cs(&crit_sect_);
return ulpfec_generator_.FecAvailable();
}
std::vector<std::unique_ptr<RtpPacketToSend>>
FlexfecSender::GetFecPackets() {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_);
+ rtc::CritScope cs(&crit_sect_);
std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets_to_send;
fec_packets_to_send.reserve(ulpfec_generator_.generated_fec_packets_.size());
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/flexfec_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698