diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc index a3de360cf6..a5fccebad1 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc +++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc @@ -10,20 +10,14 @@ #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" -#include // assert #include // memcpy -#include // min -#include // max -#include - #include "webrtc/base/checks.h" #include "webrtc/base/logging.h" #include "webrtc/base/trace_event.h" #include "webrtc/call.h" #include "webrtc/call/rtc_event_log.h" #include "webrtc/common_types.h" -#include "webrtc/modules/rtp_rtcp/source/byte_io.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" @@ -41,12 +35,9 @@ #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" -#include "webrtc/system_wrappers/include/critical_section_wrapper.h" namespace webrtc { -using RTCPUtility::RTCPCnameInformation; - NACKStringBuilder::NACKStringBuilder() : stream_(""), count_(0), prevNack_(0), consecutive_(false) {} @@ -129,18 +120,14 @@ class RTCPSender::RtcpContext { bool repeat, uint64_t picture_id, uint32_t ntp_sec, - uint32_t ntp_frac, - PacketContainer* container) + uint32_t ntp_frac) : feedback_state_(feedback_state), nack_size_(nack_size), nack_list_(nack_list), repeat_(repeat), picture_id_(picture_id), ntp_sec_(ntp_sec), - ntp_frac_(ntp_frac), - container_(container) {} - - virtual ~RtcpContext() {} + ntp_frac_(ntp_frac) {} const FeedbackState& feedback_state_; const int32_t nack_size_; @@ -149,8 +136,6 @@ class RTCPSender::RtcpContext { const uint64_t picture_id_; const uint32_t ntp_sec_; const uint32_t ntp_frac_; - - PacketContainer* const container_; }; RTCPSender::RTCPSender( @@ -166,9 +151,6 @@ RTCPSender::RTCPSender( method_(RtcpMode::kOff), event_log_(event_log), transport_(outgoing_transport), - - critical_section_rtcp_sender_( - CriticalSectionWrapper::CreateCriticalSection()), using_nack_(false), sending_(false), remb_enabled_(false), @@ -219,12 +201,12 @@ RTCPSender::RTCPSender( RTCPSender::~RTCPSender() {} RtcpMode RTCPSender::Status() const { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); return method_; } void RTCPSender::SetRTCPStatus(RtcpMode method) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); method_ = method; if (method == RtcpMode::kOff) @@ -235,7 +217,7 @@ void RTCPSender::SetRTCPStatus(RtcpMode method) { } bool RTCPSender::Sending() const { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); return sending_; } @@ -243,7 +225,7 @@ int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, bool sending) { bool sendRTCPBye = false; { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (method_ != RtcpMode::kOff) { if (sending == false && sending_ == true) { @@ -259,18 +241,18 @@ int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, } bool RTCPSender::REMB() const { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); return remb_enabled_; } void RTCPSender::SetREMBStatus(bool enable) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); remb_enabled_ = enable; } void RTCPSender::SetREMBData(uint32_t bitrate, const std::vector& ssrcs) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); remb_bitrate_ = bitrate; remb_ssrcs_ = ssrcs; @@ -282,12 +264,12 @@ void RTCPSender::SetREMBData(uint32_t bitrate, } bool RTCPSender::TMMBR() const { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); return IsFlagPresent(RTCPPacketType::kRtcpTmmbr); } void RTCPSender::SetTMMBRStatus(bool enable) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (enable) { SetFlag(RTCPPacketType::kRtcpTmmbr, false); } else { @@ -296,13 +278,13 @@ void RTCPSender::SetTMMBRStatus(bool enable) { } void RTCPSender::SetStartTimestamp(uint32_t start_timestamp) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); start_timestamp_ = start_timestamp; } void RTCPSender::SetLastRtpTime(uint32_t rtp_timestamp, int64_t capture_time_ms) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); last_rtp_timestamp_ = rtp_timestamp; if (capture_time_ms < 0) { // We don't currently get a capture time from VoiceEngine. @@ -313,7 +295,7 @@ void RTCPSender::SetLastRtpTime(uint32_t rtp_timestamp, } void RTCPSender::SetSSRC(uint32_t ssrc) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (ssrc_ != 0) { // not first SetSSRC, probably due to a collision @@ -325,7 +307,7 @@ void RTCPSender::SetSSRC(uint32_t ssrc) { } void RTCPSender::SetRemoteSSRC(uint32_t ssrc) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); remote_ssrc_ = ssrc; } @@ -334,15 +316,15 @@ int32_t RTCPSender::SetCNAME(const char* c_name) { return -1; RTC_DCHECK_LT(strlen(c_name), static_cast(RTCP_CNAME_SIZE)); - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); cname_ = c_name; return 0; } int32_t RTCPSender::AddMixedCNAME(uint32_t SSRC, const char* c_name) { - assert(c_name); + RTC_DCHECK(c_name); RTC_DCHECK_LT(strlen(c_name), static_cast(RTCP_CNAME_SIZE)); - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (csrc_cnames_.size() >= kRtpCsrcSize) return -1; @@ -351,7 +333,7 @@ int32_t RTCPSender::AddMixedCNAME(uint32_t SSRC, const char* c_name) { } int32_t RTCPSender::RemoveMixedCNAME(uint32_t SSRC) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); auto it = csrc_cnames_.find(SSRC); if (it == csrc_cnames_.end()) @@ -422,7 +404,7 @@ bool RTCPSender::TimeToSendRTCPReport(bool sendKeyframeBeforeRTP) const { int64_t now = clock_->TimeInMilliseconds(); - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (method_ == RtcpMode::kOff) return false; @@ -443,7 +425,7 @@ bool RTCPSender::TimeToSendRTCPReport(bool sendKeyframeBeforeRTP) const { return false; } -rtc::scoped_ptr RTCPSender::BuildSR(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildSR(const RtcpContext& ctx) { // The timestamp of this RTCP packet should be estimated as the timestamp of // the frame being captured at this moment. We are calculating that // timestamp as the last frame's timestamp + the time since the last frame @@ -465,10 +447,10 @@ rtc::scoped_ptr RTCPSender::BuildSR(const RtcpContext& ctx) { report_blocks_.clear(); - return rtc::scoped_ptr(report); + return std::unique_ptr(report); } -rtc::scoped_ptr RTCPSender::BuildSDES( +std::unique_ptr RTCPSender::BuildSDES( const RtcpContext& ctx) { size_t length_cname = cname_.length(); RTC_CHECK_LT(length_cname, static_cast(RTCP_CNAME_SIZE)); @@ -479,20 +461,20 @@ rtc::scoped_ptr RTCPSender::BuildSDES( for (const auto it : csrc_cnames_) sdes->WithCName(it.first, it.second); - return rtc::scoped_ptr(sdes); + return std::unique_ptr(sdes); } -rtc::scoped_ptr RTCPSender::BuildRR(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildRR(const RtcpContext& ctx) { rtcp::ReceiverReport* report = new rtcp::ReceiverReport(); report->From(ssrc_); for (auto it : report_blocks_) report->WithReportBlock(it.second); report_blocks_.clear(); - return rtc::scoped_ptr(report); + return std::unique_ptr(report); } -rtc::scoped_ptr RTCPSender::BuildPLI(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildPLI(const RtcpContext& ctx) { rtcp::Pli* pli = new rtcp::Pli(); pli->From(ssrc_); pli->To(remote_ssrc_); @@ -503,10 +485,10 @@ rtc::scoped_ptr RTCPSender::BuildPLI(const RtcpContext& ctx) { TRACE_COUNTER_ID1(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "RTCP_PLICount", ssrc_, packet_type_counter_.pli_packets); - return rtc::scoped_ptr(pli); + return std::unique_ptr(pli); } -rtc::scoped_ptr RTCPSender::BuildFIR(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildFIR(const RtcpContext& ctx) { if (!ctx.repeat_) ++sequence_number_fir_; // Do not increase if repetition. @@ -520,7 +502,7 @@ rtc::scoped_ptr RTCPSender::BuildFIR(const RtcpContext& ctx) { TRACE_COUNTER_ID1(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "RTCP_FIRCount", ssrc_, packet_type_counter_.fir_packets); - return rtc::scoped_ptr(fir); + return std::unique_ptr(fir); } /* @@ -530,14 +512,14 @@ rtc::scoped_ptr RTCPSender::BuildFIR(const RtcpContext& ctx) { | First | Number | PictureID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ -rtc::scoped_ptr RTCPSender::BuildSLI(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildSLI(const RtcpContext& ctx) { rtcp::Sli* sli = new rtcp::Sli(); sli->From(ssrc_); sli->To(remote_ssrc_); // Crop picture id to 6 least significant bits. sli->WithPictureId(ctx.picture_id_ & 0x3F); - return rtc::scoped_ptr(sli); + return std::unique_ptr(sli); } /* @@ -552,7 +534,7 @@ rtc::scoped_ptr RTCPSender::BuildSLI(const RtcpContext& ctx) { /* * Note: not generic made for VP8 */ -rtc::scoped_ptr RTCPSender::BuildRPSI( +std::unique_ptr RTCPSender::BuildRPSI( const RtcpContext& ctx) { if (ctx.feedback_state_.send_payload_type == 0xFF) return nullptr; @@ -563,10 +545,10 @@ rtc::scoped_ptr RTCPSender::BuildRPSI( rpsi->WithPayloadType(ctx.feedback_state_.send_payload_type); rpsi->WithPictureId(ctx.picture_id_); - return rtc::scoped_ptr(rpsi); + return std::unique_ptr(rpsi); } -rtc::scoped_ptr RTCPSender::BuildREMB( +std::unique_ptr RTCPSender::BuildREMB( const RtcpContext& ctx) { rtcp::Remb* remb = new rtcp::Remb(); remb->From(ssrc_); @@ -577,15 +559,15 @@ rtc::scoped_ptr RTCPSender::BuildREMB( TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "RTCPSender::REMB"); - return rtc::scoped_ptr(remb); + return std::unique_ptr(remb); } void RTCPSender::SetTargetBitrate(unsigned int target_bitrate) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); tmmbr_send_ = target_bitrate / 1000; } -rtc::scoped_ptr RTCPSender::BuildTMMBR( +std::unique_ptr RTCPSender::BuildTMMBR( const RtcpContext& ctx) { if (ctx.feedback_state_.module == nullptr) return nullptr; @@ -643,10 +625,10 @@ rtc::scoped_ptr RTCPSender::BuildTMMBR( request.set_packet_overhead(packet_oh_send_); tmmbr->WithTmmbr(request); - return rtc::scoped_ptr(tmmbr); + return std::unique_ptr(tmmbr); } -rtc::scoped_ptr RTCPSender::BuildTMMBN( +std::unique_ptr RTCPSender::BuildTMMBN( const RtcpContext& ctx) { TMMBRSet* boundingSet = tmmbr_help_.BoundingSetToSend(); if (boundingSet == nullptr) @@ -661,20 +643,20 @@ rtc::scoped_ptr RTCPSender::BuildTMMBN( } } - return rtc::scoped_ptr(tmmbn); + return std::unique_ptr(tmmbn); } -rtc::scoped_ptr RTCPSender::BuildAPP(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildAPP(const RtcpContext& ctx) { rtcp::App* app = new rtcp::App(); app->From(ssrc_); app->WithSubType(app_sub_type_); app->WithName(app_name_); app->WithData(app_data_.get(), app_length_); - return rtc::scoped_ptr(app); + return std::unique_ptr(app); } -rtc::scoped_ptr RTCPSender::BuildNACK( +std::unique_ptr RTCPSender::BuildNACK( const RtcpContext& ctx) { rtcp::Nack* nack = new rtcp::Nack(); nack->From(ssrc_); @@ -697,19 +679,19 @@ rtc::scoped_ptr RTCPSender::BuildNACK( TRACE_COUNTER_ID1(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "RTCP_NACKCount", ssrc_, packet_type_counter_.nack_packets); - return rtc::scoped_ptr(nack); + return std::unique_ptr(nack); } -rtc::scoped_ptr RTCPSender::BuildBYE(const RtcpContext& ctx) { +std::unique_ptr RTCPSender::BuildBYE(const RtcpContext& ctx) { rtcp::Bye* bye = new rtcp::Bye(); bye->From(ssrc_); for (uint32_t csrc : csrcs_) bye->WithCsrc(csrc); - return rtc::scoped_ptr(bye); + return std::unique_ptr(bye); } -rtc::scoped_ptr RTCPSender::BuildReceiverReferenceTime( +std::unique_ptr RTCPSender::BuildReceiverReferenceTime( const RtcpContext& ctx) { rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); @@ -722,10 +704,10 @@ rtc::scoped_ptr RTCPSender::BuildReceiverReferenceTime( // TODO(sprang): Merge XR report sending to contain all of RRTR, DLRR, VOIP? - return rtc::scoped_ptr(xr); + return std::unique_ptr(xr); } -rtc::scoped_ptr RTCPSender::BuildDlrr( +std::unique_ptr RTCPSender::BuildDlrr( const RtcpContext& ctx) { rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); xr->From(ssrc_); @@ -736,11 +718,11 @@ rtc::scoped_ptr RTCPSender::BuildDlrr( xr->WithDlrr(dlrr); - return rtc::scoped_ptr(xr); + return std::unique_ptr(xr); } // TODO(sprang): Add a unit test for this, or remove if the code isn't used. -rtc::scoped_ptr RTCPSender::BuildVoIPMetric( +std::unique_ptr RTCPSender::BuildVoIPMetric( const RtcpContext& context) { rtcp::ExtendedReports* xr = new rtcp::ExtendedReports(); xr->From(ssrc_); @@ -751,7 +733,7 @@ rtc::scoped_ptr RTCPSender::BuildVoIPMetric( xr->WithVoipMetric(voip); - return rtc::scoped_ptr(xr); + return std::unique_ptr(xr); } int32_t RTCPSender::SendRTCP(const FeedbackState& feedback_state, @@ -774,7 +756,7 @@ int32_t RTCPSender::SendCompoundRTCP( uint64_t pictureID) { PacketContainer container(transport_, event_log_); { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (method_ == RtcpMode::kOff) { LOG(LS_WARNING) << "Can't send rtcp if it is disabled."; return -1; @@ -785,11 +767,11 @@ int32_t RTCPSender::SendCompoundRTCP( uint32_t ntp_frac; clock_->CurrentNtp(ntp_sec, ntp_frac); RtcpContext context(feedback_state, nack_size, nack_list, repeat, pictureID, - ntp_sec, ntp_frac, &container); + ntp_sec, ntp_frac); PrepareReport(packet_types, feedback_state); - rtc::scoped_ptr packet_bye; + std::unique_ptr packet_bye; auto it = report_flags_.begin(); while (it != report_flags_.end()) { @@ -802,7 +784,7 @@ int32_t RTCPSender::SendCompoundRTCP( } BuilderFunc func = builder_it->second; - rtc::scoped_ptr packet = (this->*func)(context); + std::unique_ptr packet = (this->*func)(context); if (packet.get() == nullptr) return -1; // If there is a BYE, don't append now - save it and append it @@ -939,8 +921,8 @@ bool RTCPSender::AddReportBlock(const FeedbackState& feedback_state, } void RTCPSender::SetCsrcs(const std::vector& csrcs) { - assert(csrcs.size() <= kRtpCsrcSize); - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + RTC_DCHECK_LE(csrcs.size(), static_cast(kRtpCsrcSize)); + rtc::CritScope lock(&critical_section_rtcp_sender_); csrcs_ = csrcs; } @@ -952,7 +934,7 @@ int32_t RTCPSender::SetApplicationSpecificData(uint8_t subType, LOG(LS_ERROR) << "Failed to SetApplicationSpecificData."; return -1; } - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); SetFlag(kRtcpApp, true); app_sub_type_ = subType; @@ -964,7 +946,7 @@ int32_t RTCPSender::SetApplicationSpecificData(uint8_t subType, } int32_t RTCPSender::SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); memcpy(&xr_voip_metric_, VoIPMetric, sizeof(RTCPVoIPMetric)); SetFlag(kRtcpXrVoipMetric, true); @@ -972,18 +954,18 @@ int32_t RTCPSender::SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric) { } void RTCPSender::SendRtcpXrReceiverReferenceTime(bool enable) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); xr_send_receiver_reference_time_enabled_ = enable; } bool RTCPSender::RtcpXrReceiverReferenceTime() const { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); return xr_send_receiver_reference_time_enabled_; } // no callbacks allowed inside this function int32_t RTCPSender::SetTMMBN(const TMMBRSet* boundingSet) { - CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); + rtc::CritScope lock(&critical_section_rtcp_sender_); if (0 == tmmbr_help_.SetTMMBRBoundingSetToSend(boundingSet)) { SetFlag(kRtcpTmmbn, true); diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h index 977c1ff43a..5183b56b9f 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.h +++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.h @@ -12,13 +12,14 @@ #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ #include +#include #include #include #include #include +#include "webrtc/base/criticalsection.h" #include "webrtc/base/random.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" @@ -27,7 +28,6 @@ #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" #include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h" #include "webrtc/transport.h" #include "webrtc/typedefs.h" @@ -162,38 +162,38 @@ class RTCPSender { StreamStatistician* statistician) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildSR(const RtcpContext& context) + std::unique_ptr BuildSR(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildRR(const RtcpContext& context) + std::unique_ptr BuildRR(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildSDES(const RtcpContext& context) + std::unique_ptr BuildSDES(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildPLI(const RtcpContext& context) + std::unique_ptr BuildPLI(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildREMB(const RtcpContext& context) + std::unique_ptr BuildREMB(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildTMMBR(const RtcpContext& context) + std::unique_ptr BuildTMMBR(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildTMMBN(const RtcpContext& context) + std::unique_ptr BuildTMMBN(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildAPP(const RtcpContext& context) + std::unique_ptr BuildAPP(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildVoIPMetric(const RtcpContext& context) + std::unique_ptr BuildVoIPMetric(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildBYE(const RtcpContext& context) + std::unique_ptr BuildBYE(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildFIR(const RtcpContext& context) + std::unique_ptr BuildFIR(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildSLI(const RtcpContext& context) + std::unique_ptr BuildSLI(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildRPSI(const RtcpContext& context) + std::unique_ptr BuildRPSI(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildNACK(const RtcpContext& context) + std::unique_ptr BuildNACK(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildReceiverReferenceTime( + std::unique_ptr BuildReceiverReferenceTime( const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); - rtc::scoped_ptr BuildDlrr(const RtcpContext& context) + std::unique_ptr BuildDlrr(const RtcpContext& context) EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); private: @@ -205,7 +205,7 @@ class RTCPSender { RtcEventLog* const event_log_; Transport* const transport_; - rtc::scoped_ptr critical_section_rtcp_sender_; + rtc::CriticalSection critical_section_rtcp_sender_; bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_); bool sending_ GUARDED_BY(critical_section_rtcp_sender_); bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_); @@ -244,7 +244,7 @@ class RTCPSender { // APP uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_); uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_); - rtc::scoped_ptr app_data_ + std::unique_ptr app_data_ GUARDED_BY(critical_section_rtcp_sender_); uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_); @@ -282,7 +282,7 @@ class RTCPSender { std::set report_flags_ GUARDED_BY(critical_section_rtcp_sender_); - typedef rtc::scoped_ptr (RTCPSender::*BuilderFunc)( + typedef std::unique_ptr (RTCPSender::*BuilderFunc)( const RtcpContext&); std::map builders_;