| Index: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
|
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
|
| index 87c975d845a1ea4210da199da3ba6640e3f01838..d617f10dad815124be0ad782ec58b83dd1e97a2a 100644
|
| --- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
|
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
|
| @@ -24,14 +24,12 @@
|
| #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h"
|
| #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h"
|
| #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h"
|
| -#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
|
|
| namespace webrtc {
|
| enum { REDForFECHeaderLength = 1 };
|
|
|
| RTPSenderVideo::RTPSenderVideo(Clock* clock, RTPSenderInterface* rtpSender)
|
| : _rtpSender(*rtpSender),
|
| - crit_(CriticalSectionWrapper::CreateCriticalSection()),
|
| _videoType(kRtpVideoGeneric),
|
| _retransmissionSettings(kRetransmitBaseLayer),
|
| // Generic FEC
|
| @@ -119,7 +117,7 @@ void RTPSenderVideo::SendVideoPacketAsRed(uint8_t* data_buffer,
|
| uint16_t next_fec_sequence_number = 0;
|
| {
|
| // Only protect while creating RED and FEC packets, not when sending.
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| red_packet.reset(producer_fec_.BuildRedPacket(
|
| data_buffer, payload_length, rtp_header_length, red_payload_type_));
|
| if (protect) {
|
| @@ -170,7 +168,7 @@ void RTPSenderVideo::SendVideoPacketAsRed(uint8_t* data_buffer,
|
| void RTPSenderVideo::SetGenericFECStatus(const bool enable,
|
| const uint8_t payloadTypeRED,
|
| const uint8_t payloadTypeFEC) {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| fec_enabled_ = enable;
|
| red_payload_type_ = payloadTypeRED;
|
| fec_payload_type_ = payloadTypeFEC;
|
| @@ -184,14 +182,14 @@ void RTPSenderVideo::SetGenericFECStatus(const bool enable,
|
| void RTPSenderVideo::GenericFECStatus(bool* enable,
|
| uint8_t* payloadTypeRED,
|
| uint8_t* payloadTypeFEC) const {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| *enable = fec_enabled_;
|
| *payloadTypeRED = red_payload_type_;
|
| *payloadTypeFEC = fec_payload_type_;
|
| }
|
|
|
| size_t RTPSenderVideo::FECPacketOverhead() const {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| if (fec_enabled_) {
|
| // Overhead is FEC headers plus RED for FEC header plus anything in RTP
|
| // header beyond the 12 bytes base header (CSRC list, extensions...)
|
| @@ -206,7 +204,7 @@ size_t RTPSenderVideo::FECPacketOverhead() const {
|
|
|
| void RTPSenderVideo::SetFecParameters(const FecProtectionParams* delta_params,
|
| const FecProtectionParams* key_params) {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| RTC_DCHECK(delta_params);
|
| RTC_DCHECK(key_params);
|
| delta_fec_params_ = *delta_params;
|
| @@ -234,7 +232,7 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType,
|
| bool fec_enabled;
|
| bool first_frame = first_frame_sent_();
|
| {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| FecProtectionParams* fec_params =
|
| frameType == kVideoFrameKey ? &key_fec_params_ : &delta_fec_params_;
|
| producer_fec_.SetFecParameters(fec_params, 0);
|
| @@ -345,12 +343,12 @@ uint32_t RTPSenderVideo::FecOverheadRate() const {
|
| }
|
|
|
| int RTPSenderVideo::SelectiveRetransmissions() const {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| return _retransmissionSettings;
|
| }
|
|
|
| void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
|
| - CriticalSectionScoped cs(crit_.get());
|
| + rtc::CritScope cs(&crit_);
|
| _retransmissionSettings = settings;
|
| }
|
|
|
|
|