Migrate modules/audio_coding, audio_mixer/ and audio_processing/ to webrtc::Mutex.

Bug: webrtc:11567
Change-Id: I03b78bd2e411e9bcca199f85e4457511826cd17e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176745
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31649}
This commit is contained in:
Markus Handell
2020-07-07 15:53:34 +02:00
committed by Commit Bot
parent 1e257cacbf
commit 0df0faefd5
16 changed files with 314 additions and 312 deletions

View File

@ -58,7 +58,7 @@ int32_t Channel::SendData(AudioFrameType frameType,
}
}
_channelCritSect.Enter();
_channelCritSect.Lock();
if (_saveBitStream) {
// fwrite(payloadData, sizeof(uint8_t), payloadSize, _bitStreamFile);
}
@ -69,7 +69,7 @@ int32_t Channel::SendData(AudioFrameType frameType,
_useLastFrameSize = false;
_lastInTimestamp = timeStamp;
_totalBytes += payloadDataSize;
_channelCritSect.Leave();
_channelCritSect.Unlock();
if (_useFECTestWithPacketLoss) {
_packetLoss += 1;
@ -238,7 +238,7 @@ void Channel::RegisterReceiverACM(AudioCodingModule* acm) {
void Channel::ResetStats() {
int n;
int k;
_channelCritSect.Enter();
_channelCritSect.Lock();
_lastPayloadType = -1;
for (n = 0; n < MAX_NUM_PAYLOADS; n++) {
_payloadStats[n].payloadType = -1;
@ -253,23 +253,23 @@ void Channel::ResetStats() {
}
_beginTime = rtc::TimeMillis();
_totalBytes = 0;
_channelCritSect.Leave();
_channelCritSect.Unlock();
}
uint32_t Channel::LastInTimestamp() {
uint32_t timestamp;
_channelCritSect.Enter();
_channelCritSect.Lock();
timestamp = _lastInTimestamp;
_channelCritSect.Leave();
_channelCritSect.Unlock();
return timestamp;
}
double Channel::BitRate() {
double rate;
uint64_t currTime = rtc::TimeMillis();
_channelCritSect.Enter();
_channelCritSect.Lock();
rate = ((double)_totalBytes * 8.0) / (double)(currTime - _beginTime);
_channelCritSect.Leave();
_channelCritSect.Unlock();
return rate;
}