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

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

Issue 1877253002: Replaced CriticalSectionWrapper with rtc::CriticalSection in rtp_rtcp module (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: git cl format dtmf_queue.cc Created 4 years, 8 months 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
Index: webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
index c85a19781dab9f36a0a037491292c528982449d6..6d0f7a4627bc49cad1680b11f34fb26090b9ff1e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc
@@ -25,7 +25,6 @@ static const int kDtmfFrequencyHz = 8000;
RTPSenderAudio::RTPSenderAudio(Clock* clock, RTPSender* rtpSender)
: _clock(clock),
_rtpSender(rtpSender),
- _sendAudioCritsect(CriticalSectionWrapper::CreateCriticalSection()),
_packetSizeSamples(160),
_dtmfEventIsOn(false),
_dtmfEventFirstPacketSent(false),
@@ -54,7 +53,7 @@ int RTPSenderAudio::AudioFrequency() const {
// set audio packet size, used to determine when it's time to send a DTMF packet
// in silence (CNG)
int32_t RTPSenderAudio::SetAudioPacketSize(uint16_t packetSizeSamples) {
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
_packetSizeSamples = packetSizeSamples;
return 0;
@@ -68,7 +67,7 @@ int32_t RTPSenderAudio::RegisterAudioPayload(
const uint32_t rate,
RtpUtility::Payload** payload) {
if (RtpUtility::StringCompare(payloadName, "cn", 2)) {
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
// we can have multiple CNG payload types
switch (frequency) {
case 8000:
@@ -87,7 +86,7 @@ int32_t RTPSenderAudio::RegisterAudioPayload(
return -1;
}
} else if (RtpUtility::StringCompare(payloadName, "telephone-event", 15)) {
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
// Don't add it to the list
// we dont want to allow send with a DTMF payloadtype
_dtmfPayloadType = payloadType;
@@ -105,7 +104,7 @@ int32_t RTPSenderAudio::RegisterAudioPayload(
}
bool RTPSenderAudio::MarkerBit(FrameType frameType, int8_t payload_type) {
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
// for audio true for first packet in a speech burst
bool markerBit = false;
if (_lastPayloadType != payload_type) {
@@ -163,7 +162,7 @@ int32_t RTPSenderAudio::SendAudio(FrameType frameType,
int8_t dtmf_payload_type;
uint16_t packet_size_samples;
{
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
red_payload_type = _REDPayloadType;
audio_level_dbov = _audioLevel_dBov;
dtmf_payload_type = _dtmfPayloadType;
@@ -336,7 +335,7 @@ int32_t RTPSenderAudio::SendAudio(FrameType frameType,
}
{
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
_lastPayloadType = payloadType;
}
// Update audio level extension, if included.
@@ -365,7 +364,7 @@ int32_t RTPSenderAudio::SetAudioLevel(uint8_t level_dBov) {
if (level_dBov > 127) {
return -1;
}
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
_audioLevel_dBov = level_dBov;
return 0;
}
@@ -375,14 +374,14 @@ int32_t RTPSenderAudio::SetRED(int8_t payloadType) {
if (payloadType < -1) {
return -1;
}
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
_REDPayloadType = payloadType;
return 0;
}
// Get payload type for Redundant Audio Data RFC 2198
int32_t RTPSenderAudio::RED(int8_t* payloadType) const {
- CriticalSectionScoped cs(_sendAudioCritsect.get());
+ rtc::CritScope cs(&_sendAudioCritsect);
if (_REDPayloadType == -1) {
// not configured
return -1;
@@ -396,7 +395,7 @@ int32_t RTPSenderAudio::SendTelephoneEvent(uint8_t key,
uint16_t time_ms,
uint8_t level) {
{
- CriticalSectionScoped lock(_sendAudioCritsect.get());
+ rtc::CritScope lock(&_sendAudioCritsect);
if (_dtmfPayloadType < 0) {
// TelephoneEvent payloadtype not configured
return -1;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_video.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698