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:
committed by
Commit Bot
parent
1e257cacbf
commit
0df0faefd5
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include "modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "modules/include/module_common_types.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -88,7 +88,7 @@ class Channel : public AudioPacketizationCallback {
|
||||
// 60msec * 32 sample(max)/msec * 2 description (maybe) * 2 bytes/sample
|
||||
uint8_t _payloadData[60 * 32 * 2 * 2];
|
||||
|
||||
rtc::CriticalSection _channelCritSect;
|
||||
Mutex _channelCritSect;
|
||||
FILE* _bitStreamFile;
|
||||
bool _saveBitStream;
|
||||
int16_t _lastPayloadType;
|
||||
|
||||
Reference in New Issue
Block a user