WebRtc_Word32 -> int32_t in audio_device/

BUG=314

Review URL: https://webrtc-codereview.appspot.com/1302006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3793 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2013-04-09 10:30:35 +00:00
parent 6141e13873
commit 2550988baa
48 changed files with 2801 additions and 2816 deletions

View File

@ -63,7 +63,7 @@ static const unsigned int ALSA_CAPTURE_WAIT_TIMEOUT = 5; // in ms
#define FUNC_GET_DEVICE_NAME 1
#define FUNC_GET_DEVICE_NAME_FOR_AN_ENUM 2
AudioDeviceLinuxALSA::AudioDeviceLinuxALSA(const WebRtc_Word32 id) :
AudioDeviceLinuxALSA::AudioDeviceLinuxALSA(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_ptrThreadRec(NULL),
@ -155,14 +155,14 @@ void AudioDeviceLinuxALSA::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer)
_ptrAudioBuffer->SetPlayoutChannels(0);
}
WebRtc_Word32 AudioDeviceLinuxALSA::ActiveAudioLayer(
int32_t AudioDeviceLinuxALSA::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const
{
audioLayer = AudioDeviceModule::kLinuxAlsaAudio;
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::Init()
int32_t AudioDeviceLinuxALSA::Init()
{
CriticalSectionScoped lock(&_critSect);
@ -192,7 +192,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::Init()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::Terminate()
int32_t AudioDeviceLinuxALSA::Terminate()
{
if (!_initialized)
@ -260,7 +260,7 @@ bool AudioDeviceLinuxALSA::Initialized() const
return (_initialized);
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::SpeakerIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@ -288,7 +288,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::InitSpeaker()
int32_t AudioDeviceLinuxALSA::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@ -303,7 +303,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::InitSpeaker()
return _mixerManager.OpenSpeaker(devName);
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::MicrophoneIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@ -331,7 +331,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::InitMicrophone()
int32_t AudioDeviceLinuxALSA::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@ -356,7 +356,7 @@ bool AudioDeviceLinuxALSA::MicrophoneIsInitialized() const
return (_mixerManager.MicrophoneIsInitialized());
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolumeIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::SpeakerVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@ -384,16 +384,16 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolumeIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetSpeakerVolume(WebRtc_UWord32 volume)
int32_t AudioDeviceLinuxALSA::SetSpeakerVolume(uint32_t volume)
{
return (_mixerManager.SetSpeakerVolume(volume));
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolume(WebRtc_UWord32& volume) const
int32_t AudioDeviceLinuxALSA::SpeakerVolume(uint32_t& volume) const
{
WebRtc_UWord32 level(0);
uint32_t level(0);
if (_mixerManager.SpeakerVolume(level) == -1)
{
@ -406,8 +406,8 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolume(WebRtc_UWord32& volume) const
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
WebRtc_UWord16 volumeRight)
int32_t AudioDeviceLinuxALSA::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -415,9 +415,9 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
return -1;
}
WebRtc_Word32 AudioDeviceLinuxALSA::WaveOutVolume(
WebRtc_UWord16& /*volumeLeft*/,
WebRtc_UWord16& /*volumeRight*/) const
int32_t AudioDeviceLinuxALSA::WaveOutVolume(
uint16_t& /*volumeLeft*/,
uint16_t& /*volumeRight*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -425,11 +425,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::WaveOutVolume(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MaxSpeakerVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioDeviceLinuxALSA::MaxSpeakerVolume(
uint32_t& maxVolume) const
{
WebRtc_UWord32 maxVol(0);
uint32_t maxVol(0);
if (_mixerManager.MaxSpeakerVolume(maxVol) == -1)
{
@ -441,11 +441,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MaxSpeakerVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MinSpeakerVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioDeviceLinuxALSA::MinSpeakerVolume(
uint32_t& minVolume) const
{
WebRtc_UWord32 minVol(0);
uint32_t minVol(0);
if (_mixerManager.MinSpeakerVolume(minVol) == -1)
{
@ -457,11 +457,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MinSpeakerVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioDeviceLinuxALSA::SpeakerVolumeStepSize(
uint16_t& stepSize) const
{
WebRtc_UWord16 delta(0);
uint16_t delta(0);
if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
{
@ -473,7 +473,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolumeStepSize(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@ -505,12 +505,12 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetSpeakerMute(bool enable)
int32_t AudioDeviceLinuxALSA::SetSpeakerMute(bool enable)
{
return (_mixerManager.SetSpeakerMute(enable));
}
WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerMute(bool& enabled) const
int32_t AudioDeviceLinuxALSA::SpeakerMute(bool& enabled) const
{
bool muted(0);
@ -525,7 +525,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMuteIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@ -558,7 +558,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMuteIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneMute(bool enable)
int32_t AudioDeviceLinuxALSA::SetMicrophoneMute(bool enable)
{
return (_mixerManager.SetMicrophoneMute(enable));
}
@ -567,7 +567,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneMute(bool enable)
// MicrophoneMute
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMute(bool& enabled) const
int32_t AudioDeviceLinuxALSA::MicrophoneMute(bool& enabled) const
{
bool muted(0);
@ -581,7 +581,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@ -612,13 +612,13 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneBoost(bool enable)
int32_t AudioDeviceLinuxALSA::SetMicrophoneBoost(bool enable)
{
return (_mixerManager.SetMicrophoneBoost(enable));
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneBoost(bool& enabled) const
int32_t AudioDeviceLinuxALSA::MicrophoneBoost(bool& enabled) const
{
bool onOff(0);
@ -633,7 +633,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneBoost(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@ -682,7 +682,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoRecording(bool enable)
int32_t AudioDeviceLinuxALSA::SetStereoRecording(bool enable)
{
if (enable)
@ -693,7 +693,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoRecording(bool enable)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecording(bool& enabled) const
int32_t AudioDeviceLinuxALSA::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@ -704,7 +704,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecording(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayoutIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::StereoPlayoutIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@ -753,7 +753,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayoutIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoPlayout(bool enable)
int32_t AudioDeviceLinuxALSA::SetStereoPlayout(bool enable)
{
if (enable)
@ -764,7 +764,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoPlayout(bool enable)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayout(bool& enabled) const
int32_t AudioDeviceLinuxALSA::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@ -775,7 +775,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayout(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetAGC(bool enable)
int32_t AudioDeviceLinuxALSA::SetAGC(bool enable)
{
_AGC = enable;
@ -789,7 +789,7 @@ bool AudioDeviceLinuxALSA::AGC() const
return _AGC;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolumeIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::MicrophoneVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@ -817,7 +817,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolumeIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneVolume(WebRtc_UWord32 volume)
int32_t AudioDeviceLinuxALSA::SetMicrophoneVolume(uint32_t volume)
{
return (_mixerManager.SetMicrophoneVolume(volume));
@ -825,10 +825,10 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneVolume(WebRtc_UWord32 volume)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolume(WebRtc_UWord32& volume) const
int32_t AudioDeviceLinuxALSA::MicrophoneVolume(uint32_t& volume) const
{
WebRtc_UWord32 level(0);
uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1)
{
@ -842,11 +842,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolume(WebRtc_UWord32& volume) con
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MaxMicrophoneVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioDeviceLinuxALSA::MaxMicrophoneVolume(
uint32_t& maxVolume) const
{
WebRtc_UWord32 maxVol(0);
uint32_t maxVol(0);
if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1)
{
@ -858,11 +858,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MaxMicrophoneVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MinMicrophoneVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioDeviceLinuxALSA::MinMicrophoneVolume(
uint32_t& minVolume) const
{
WebRtc_UWord32 minVol(0);
uint32_t minVol(0);
if (_mixerManager.MinMicrophoneVolume(minVol) == -1)
{
@ -874,11 +874,11 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MinMicrophoneVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioDeviceLinuxALSA::MicrophoneVolumeStepSize(
uint16_t& stepSize) const
{
WebRtc_UWord16 delta(0);
uint16_t delta(0);
if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
{
@ -890,13 +890,13 @@ WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolumeStepSize(
return 0;
}
WebRtc_Word16 AudioDeviceLinuxALSA::PlayoutDevices()
int16_t AudioDeviceLinuxALSA::PlayoutDevices()
{
return (WebRtc_Word16)GetDevicesInfo(0, true);
return (int16_t)GetDevicesInfo(0, true);
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(WebRtc_UWord16 index)
int32_t AudioDeviceLinuxALSA::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@ -904,7 +904,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(WebRtc_UWord16 index)
return -1;
}
WebRtc_UWord32 nDevices = GetDevicesInfo(0, true);
uint32_t nDevices = GetDevicesInfo(0, true);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable audio output devices is %u", nDevices);
@ -921,7 +921,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(WebRtc_UWord16 index)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(
int32_t AudioDeviceLinuxALSA::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@ -929,13 +929,13 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDeviceName(
WebRtc_UWord16 index,
int32_t AudioDeviceLinuxALSA::PlayoutDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
const WebRtc_UWord16 nDevices(PlayoutDevices());
const uint16_t nDevices(PlayoutDevices());
if ((index > (nDevices-1)) || (name == NULL))
{
@ -952,13 +952,13 @@ WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDeviceName(
return GetDevicesInfo(1, true, index, name, kAdmMaxDeviceNameSize);
}
WebRtc_Word32 AudioDeviceLinuxALSA::RecordingDeviceName(
WebRtc_UWord16 index,
int32_t AudioDeviceLinuxALSA::RecordingDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
const WebRtc_UWord16 nDevices(RecordingDevices());
const uint16_t nDevices(RecordingDevices());
if ((index > (nDevices-1)) || (name == NULL))
{
@ -975,13 +975,13 @@ WebRtc_Word32 AudioDeviceLinuxALSA::RecordingDeviceName(
return GetDevicesInfo(1, false, index, name, kAdmMaxDeviceNameSize);
}
WebRtc_Word16 AudioDeviceLinuxALSA::RecordingDevices()
int16_t AudioDeviceLinuxALSA::RecordingDevices()
{
return (WebRtc_Word16)GetDevicesInfo(0, false);
return (int16_t)GetDevicesInfo(0, false);
}
WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(WebRtc_UWord16 index)
int32_t AudioDeviceLinuxALSA::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@ -989,7 +989,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(WebRtc_UWord16 index)
return -1;
}
WebRtc_UWord32 nDevices = GetDevicesInfo(0, false);
uint32_t nDevices = GetDevicesInfo(0, false);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable audio input devices is %u", nDevices);
@ -1010,7 +1010,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(WebRtc_UWord16 index)
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(
int32_t AudioDeviceLinuxALSA::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@ -1018,7 +1018,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
{
available = false;
@ -1026,7 +1026,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
// Try to initialize the playout side with mono
// Assumes that user set num channels after calling this function
_playChannels = 1;
WebRtc_Word32 res = InitPlayout();
int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@ -1049,7 +1049,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
return res;
}
WebRtc_Word32 AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
int32_t AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
{
available = false;
@ -1057,7 +1057,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
// Try to initialize the recording side with mono
// Assumes that user set num channels after calling this function
_recChannels = 1;
WebRtc_Word32 res = InitRecording();
int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@ -1080,7 +1080,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
return res;
}
WebRtc_Word32 AudioDeviceLinuxALSA::InitPlayout()
int32_t AudioDeviceLinuxALSA::InitPlayout()
{
int errVal = 0;
@ -1233,7 +1233,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::InitPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::InitRecording()
int32_t AudioDeviceLinuxALSA::InitRecording()
{
int errVal = 0;
@ -1404,7 +1404,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::InitRecording()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StartRecording()
int32_t AudioDeviceLinuxALSA::StartRecording()
{
if (!_recIsInitialized)
@ -1424,7 +1424,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StartRecording()
// Make sure we only create the buffer once.
if (!_recordingBuffer)
_recordingBuffer = new WebRtc_Word8[_recordingBufferSizeIn10MS];
_recordingBuffer = new int8_t[_recordingBufferSizeIn10MS];
if (!_recordingBuffer)
{
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
@ -1492,7 +1492,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StartRecording()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StopRecording()
int32_t AudioDeviceLinuxALSA::StopRecording()
{
{
@ -1579,7 +1579,7 @@ bool AudioDeviceLinuxALSA::PlayoutIsInitialized() const
return (_playIsInitialized);
}
WebRtc_Word32 AudioDeviceLinuxALSA::StartPlayout()
int32_t AudioDeviceLinuxALSA::StartPlayout()
{
if (!_playIsInitialized)
{
@ -1595,7 +1595,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StartPlayout()
_playoutFramesLeft = 0;
if (!_playoutBuffer)
_playoutBuffer = new WebRtc_Word8[_playoutBufferSizeIn10MS];
_playoutBuffer = new int8_t[_playoutBufferSizeIn10MS];
if (!_playoutBuffer)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@ -1647,7 +1647,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StartPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::StopPlayout()
int32_t AudioDeviceLinuxALSA::StopPlayout()
{
{
@ -1708,16 +1708,16 @@ WebRtc_Word32 AudioDeviceLinuxALSA::StopPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDelay(WebRtc_UWord16& delayMS) const
int32_t AudioDeviceLinuxALSA::PlayoutDelay(uint16_t& delayMS) const
{
delayMS = (WebRtc_UWord16)_playoutDelay * 1000 / _playoutFreq;
delayMS = (uint16_t)_playoutDelay * 1000 / _playoutFreq;
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::RecordingDelay(WebRtc_UWord16& delayMS) const
int32_t AudioDeviceLinuxALSA::RecordingDelay(uint16_t& delayMS) const
{
// Adding 10ms adjusted value to the record delay due to 10ms buffering.
delayMS = (WebRtc_UWord16)(10 + _recordingDelay * 1000 / _recordingFreq);
delayMS = (uint16_t)(10 + _recordingDelay * 1000 / _recordingFreq);
return 0;
}
@ -1729,9 +1729,9 @@ bool AudioDeviceLinuxALSA::Playing() const
// SetPlayoutBuffer
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutBuffer(
int32_t AudioDeviceLinuxALSA::SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
WebRtc_UWord16 sizeMS)
uint16_t sizeMS)
{
_playBufType = type;
if (type == AudioDeviceModule::kFixedBufferSize)
@ -1741,9 +1741,9 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutBuffer(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutBuffer(
int32_t AudioDeviceLinuxALSA::PlayoutBuffer(
AudioDeviceModule::BufferType& type,
WebRtc_UWord16& sizeMS) const
uint16_t& sizeMS) const
{
type = _playBufType;
if (type == AudioDeviceModule::kFixedBufferSize)
@ -1758,7 +1758,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutBuffer(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::CPULoad(WebRtc_UWord16& load) const
int32_t AudioDeviceLinuxALSA::CPULoad(uint16_t& load) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -1810,12 +1810,12 @@ void AudioDeviceLinuxALSA::ClearRecordingError()
// Private Methods
// ============================================================================
WebRtc_Word32 AudioDeviceLinuxALSA::GetDevicesInfo(
const WebRtc_Word32 function,
int32_t AudioDeviceLinuxALSA::GetDevicesInfo(
const int32_t function,
const bool playback,
const WebRtc_Word32 enumDeviceNo,
const int32_t enumDeviceNo,
char* enumDeviceName,
const WebRtc_Word32 ednLen) const
const int32_t ednLen) const
{
// Device enumeration based on libjingle implementation
@ -1973,7 +1973,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::GetDevicesInfo(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const
int32_t AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const
{
if (_handleRecord == NULL)
{
@ -1984,7 +1984,7 @@ WebRtc_Word32 AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const
int32_t AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const
{
if (_handlePlayout == NULL)
{
@ -1995,8 +1995,8 @@ WebRtc_Word32 AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxALSA::ErrorRecovery(WebRtc_Word32 error,
snd_pcm_t* deviceHandle)
int32_t AudioDeviceLinuxALSA::ErrorRecovery(int32_t error,
snd_pcm_t* deviceHandle)
{
int st = LATE(snd_pcm_state)(deviceHandle);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
@ -2141,7 +2141,7 @@ bool AudioDeviceLinuxALSA::PlayThreadProcess()
assert(_playoutFramesLeft == _playoutFramesIn10MS);
}
if (static_cast<WebRtc_UWord32>(avail_frames) > _playoutFramesLeft)
if (static_cast<uint32_t>(avail_frames) > _playoutFramesLeft)
avail_frames = _playoutFramesLeft;
int size = LATE(snd_pcm_frames_to_bytes)(_handlePlayout,
@ -2178,7 +2178,7 @@ bool AudioDeviceLinuxALSA::RecThreadProcess()
int err;
snd_pcm_sframes_t frames;
snd_pcm_sframes_t avail_frames;
WebRtc_Word8 buffer[_recordingBufferSizeIn10MS];
int8_t buffer[_recordingBufferSizeIn10MS];
Lock();
@ -2207,7 +2207,7 @@ bool AudioDeviceLinuxALSA::RecThreadProcess()
return true;
}
if (static_cast<WebRtc_UWord32>(avail_frames) > _recordingFramesLeft)
if (static_cast<uint32_t>(avail_frames) > _recordingFramesLeft)
avail_frames = _recordingFramesLeft;
frames = LATE(snd_pcm_readi)(_handleRecord,
@ -2242,8 +2242,8 @@ bool AudioDeviceLinuxALSA::RecThreadProcess()
_ptrAudioBuffer->SetRecordedBuffer(_recordingBuffer,
_recordingFramesIn10MS);
WebRtc_UWord32 currentMicLevel = 0;
WebRtc_UWord32 newMicLevel = 0;
uint32_t currentMicLevel = 0;
uint32_t newMicLevel = 0;
if (AGC())
{

View File

@ -28,124 +28,123 @@ class ThreadWrapper;
class AudioDeviceLinuxALSA : public AudioDeviceGeneric
{
public:
AudioDeviceLinuxALSA(const WebRtc_Word32 id);
AudioDeviceLinuxALSA(const int32_t id);
~AudioDeviceLinuxALSA();
// Retrieve the currently utilized audio layer
virtual WebRtc_Word32 ActiveAudioLayer(
virtual int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const;
// Main initializaton and termination
virtual WebRtc_Word32 Init();
virtual WebRtc_Word32 Terminate();
virtual int32_t Init();
virtual int32_t Terminate();
virtual bool Initialized() const;
// Device enumeration
virtual WebRtc_Word16 PlayoutDevices();
virtual WebRtc_Word16 RecordingDevices();
virtual WebRtc_Word32 PlayoutDeviceName(
WebRtc_UWord16 index,
virtual int16_t PlayoutDevices();
virtual int16_t RecordingDevices();
virtual int32_t PlayoutDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]);
virtual WebRtc_Word32 RecordingDeviceName(
WebRtc_UWord16 index,
virtual int32_t RecordingDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]);
// Device selection
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
virtual WebRtc_Word32 SetPlayoutDevice(
virtual int32_t SetPlayoutDevice(uint16_t index);
virtual int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device);
virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
virtual WebRtc_Word32 SetRecordingDevice(
virtual int32_t SetRecordingDevice(uint16_t index);
virtual int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device);
// Audio transport initialization
virtual WebRtc_Word32 PlayoutIsAvailable(bool& available);
virtual WebRtc_Word32 InitPlayout();
virtual int32_t PlayoutIsAvailable(bool& available);
virtual int32_t InitPlayout();
virtual bool PlayoutIsInitialized() const;
virtual WebRtc_Word32 RecordingIsAvailable(bool& available);
virtual WebRtc_Word32 InitRecording();
virtual int32_t RecordingIsAvailable(bool& available);
virtual int32_t InitRecording();
virtual bool RecordingIsInitialized() const;
// Audio transport control
virtual WebRtc_Word32 StartPlayout();
virtual WebRtc_Word32 StopPlayout();
virtual int32_t StartPlayout();
virtual int32_t StopPlayout();
virtual bool Playing() const;
virtual WebRtc_Word32 StartRecording();
virtual WebRtc_Word32 StopRecording();
virtual int32_t StartRecording();
virtual int32_t StopRecording();
virtual bool Recording() const;
// Microphone Automatic Gain Control (AGC)
virtual WebRtc_Word32 SetAGC(bool enable);
virtual int32_t SetAGC(bool enable);
virtual bool AGC() const;
// Volume control based on the Windows Wave API (Windows only)
virtual WebRtc_Word32 SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
WebRtc_UWord16 volumeRight);
virtual WebRtc_Word32 WaveOutVolume(WebRtc_UWord16& volumeLeft,
WebRtc_UWord16& volumeRight) const;
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight);
virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const;
// Audio mixer initialization
virtual WebRtc_Word32 SpeakerIsAvailable(bool& available);
virtual WebRtc_Word32 InitSpeaker();
virtual int32_t SpeakerIsAvailable(bool& available);
virtual int32_t InitSpeaker();
virtual bool SpeakerIsInitialized() const;
virtual WebRtc_Word32 MicrophoneIsAvailable(bool& available);
virtual WebRtc_Word32 InitMicrophone();
virtual int32_t MicrophoneIsAvailable(bool& available);
virtual int32_t InitMicrophone();
virtual bool MicrophoneIsInitialized() const;
// Speaker volume controls
virtual WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available);
virtual WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume);
virtual WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const;
virtual WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const;
virtual WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const;
virtual WebRtc_Word32 SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const;
virtual int32_t SpeakerVolumeIsAvailable(bool& available);
virtual int32_t SetSpeakerVolume(uint32_t volume);
virtual int32_t SpeakerVolume(uint32_t& volume) const;
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const;
virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
// Microphone volume controls
virtual WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume);
virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
virtual WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
virtual WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
virtual WebRtc_Word32 MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const;
virtual int32_t MicrophoneVolumeIsAvailable(bool& available);
virtual int32_t SetMicrophoneVolume(uint32_t volume);
virtual int32_t MicrophoneVolume(uint32_t& volume) const;
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
virtual int32_t MicrophoneVolumeStepSize(
uint16_t& stepSize) const;
// Speaker mute control
virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
virtual WebRtc_Word32 SetSpeakerMute(bool enable);
virtual WebRtc_Word32 SpeakerMute(bool& enabled) const;
virtual int32_t SpeakerMuteIsAvailable(bool& available);
virtual int32_t SetSpeakerMute(bool enable);
virtual int32_t SpeakerMute(bool& enabled) const;
// Microphone mute control
virtual WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneMute(bool enable);
virtual WebRtc_Word32 MicrophoneMute(bool& enabled) const;
virtual int32_t MicrophoneMuteIsAvailable(bool& available);
virtual int32_t SetMicrophoneMute(bool enable);
virtual int32_t MicrophoneMute(bool& enabled) const;
// Microphone boost control
virtual WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneBoost(bool enable);
virtual WebRtc_Word32 MicrophoneBoost(bool& enabled) const;
virtual int32_t MicrophoneBoostIsAvailable(bool& available);
virtual int32_t SetMicrophoneBoost(bool enable);
virtual int32_t MicrophoneBoost(bool& enabled) const;
// Stereo support
virtual WebRtc_Word32 StereoPlayoutIsAvailable(bool& available);
virtual WebRtc_Word32 SetStereoPlayout(bool enable);
virtual WebRtc_Word32 StereoPlayout(bool& enabled) const;
virtual WebRtc_Word32 StereoRecordingIsAvailable(bool& available);
virtual WebRtc_Word32 SetStereoRecording(bool enable);
virtual WebRtc_Word32 StereoRecording(bool& enabled) const;
virtual int32_t StereoPlayoutIsAvailable(bool& available);
virtual int32_t SetStereoPlayout(bool enable);
virtual int32_t StereoPlayout(bool& enabled) const;
virtual int32_t StereoRecordingIsAvailable(bool& available);
virtual int32_t SetStereoRecording(bool enable);
virtual int32_t StereoRecording(bool& enabled) const;
// Delay information and control
virtual WebRtc_Word32 SetPlayoutBuffer(
virtual int32_t SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
WebRtc_UWord16 sizeMS);
virtual WebRtc_Word32 PlayoutBuffer(
uint16_t sizeMS);
virtual int32_t PlayoutBuffer(
AudioDeviceModule::BufferType& type,
WebRtc_UWord16& sizeMS) const;
virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const;
virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const;
uint16_t& sizeMS) const;
virtual int32_t PlayoutDelay(uint16_t& delayMS) const;
virtual int32_t RecordingDelay(uint16_t& delayMS) const;
// CPU load
virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const;
virtual int32_t CPULoad(uint16_t& load) const;
public:
virtual bool PlayoutWarning() const;
@ -161,19 +160,19 @@ public:
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer);
private:
WebRtc_Word32 GetDevicesInfo(const WebRtc_Word32 function,
const bool playback,
const WebRtc_Word32 enumDeviceNo = 0,
char* enumDeviceName = NULL,
const WebRtc_Word32 ednLen = 0) const;
WebRtc_Word32 ErrorRecovery(WebRtc_Word32 error, snd_pcm_t* deviceHandle);
int32_t GetDevicesInfo(const int32_t function,
const bool playback,
const int32_t enumDeviceNo = 0,
char* enumDeviceName = NULL,
const int32_t ednLen = 0) const;
int32_t ErrorRecovery(int32_t error, snd_pcm_t* deviceHandle);
private:
void Lock() { _critSect.Enter(); };
void UnLock() { _critSect.Leave(); };
private:
inline WebRtc_Word32 InputSanityCheckAfterUnlockedPeriod() const;
inline WebRtc_Word32 OutputSanityCheckAfterUnlockedPeriod() const;
inline int32_t InputSanityCheckAfterUnlockedPeriod() const;
inline int32_t OutputSanityCheckAfterUnlockedPeriod() const;
private:
static bool RecThreadFunc(void*);
@ -188,15 +187,15 @@ private:
ThreadWrapper* _ptrThreadRec;
ThreadWrapper* _ptrThreadPlay;
WebRtc_UWord32 _recThreadID;
WebRtc_UWord32 _playThreadID;
uint32_t _recThreadID;
uint32_t _playThreadID;
WebRtc_Word32 _id;
int32_t _id;
AudioMixerManagerLinuxALSA _mixerManager;
WebRtc_UWord16 _inputDeviceIndex;
WebRtc_UWord16 _outputDeviceIndex;
uint16_t _inputDeviceIndex;
uint16_t _outputDeviceIndex;
bool _inputDeviceIsSpecified;
bool _outputDeviceIsSpecified;
@ -210,18 +209,18 @@ private:
ssize_t _recordingBufferSizeIn10MS;
ssize_t _playoutBufferSizeIn10MS;
WebRtc_UWord32 _recordingFramesIn10MS;
WebRtc_UWord32 _playoutFramesIn10MS;
uint32_t _recordingFramesIn10MS;
uint32_t _playoutFramesIn10MS;
WebRtc_UWord32 _recordingFreq;
WebRtc_UWord32 _playoutFreq;
WebRtc_UWord8 _recChannels;
WebRtc_UWord8 _playChannels;
uint32_t _recordingFreq;
uint32_t _playoutFreq;
uint8_t _recChannels;
uint8_t _playChannels;
WebRtc_Word8* _recordingBuffer; // in byte
WebRtc_Word8* _playoutBuffer; // in byte
WebRtc_UWord32 _recordingFramesLeft;
WebRtc_UWord32 _playoutFramesLeft;
int8_t* _recordingBuffer; // in byte
int8_t* _playoutBuffer; // in byte
uint32_t _recordingFramesLeft;
uint32_t _playoutFramesLeft;
AudioDeviceModule::BufferType _playBufType;
@ -236,13 +235,13 @@ private:
snd_pcm_sframes_t _recordingDelay;
snd_pcm_sframes_t _playoutDelay;
WebRtc_UWord16 _playWarning;
WebRtc_UWord16 _playError;
WebRtc_UWord16 _recWarning;
WebRtc_UWord16 _recError;
uint16_t _playWarning;
uint16_t _playError;
uint16_t _recWarning;
uint16_t _recError;
WebRtc_UWord16 _playBufDelay; // playback delay
WebRtc_UWord16 _playBufDelayFixed; // fixed playback delay
uint16_t _playBufDelay; // playback delay
uint16_t _playBufDelayFixed; // fixed playback delay
};
}

View File

@ -62,7 +62,7 @@ bool AudioDeviceLinuxPulse::PulseAudioIsSupported()
return (pulseAudioIsSupported);
}
AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const WebRtc_Word32 id) :
AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_timeEventRec(*EventWrapper::Create()),
@ -193,14 +193,14 @@ void AudioDeviceLinuxPulse::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer)
// ActiveAudioLayer
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioDeviceLinuxPulse::ActiveAudioLayer(
int32_t AudioDeviceLinuxPulse::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const
{
audioLayer = AudioDeviceModule::kLinuxPulseAudio;
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::Init()
int32_t AudioDeviceLinuxPulse::Init()
{
CriticalSectionScoped lock(&_critSect);
@ -281,7 +281,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::Init()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::Terminate()
int32_t AudioDeviceLinuxPulse::Terminate()
{
if (!_initialized)
@ -355,7 +355,7 @@ bool AudioDeviceLinuxPulse::Initialized() const
return (_initialized);
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::SpeakerIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@ -383,7 +383,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitSpeaker()
int32_t AudioDeviceLinuxPulse::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@ -401,7 +401,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitSpeaker()
// check if default device
if (_outputDeviceIndex == 0)
{
WebRtc_UWord16 deviceIndex = 0;
uint16_t deviceIndex = 0;
GetDefaultDeviceInfo(false, NULL, deviceIndex);
_paDeviceIndex = deviceIndex;
} else
@ -428,7 +428,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitSpeaker()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::MicrophoneIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@ -456,7 +456,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitMicrophone()
int32_t AudioDeviceLinuxPulse::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@ -474,7 +474,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitMicrophone()
// Check if default device
if (_inputDeviceIndex == 0)
{
WebRtc_UWord16 deviceIndex = 0;
uint16_t deviceIndex = 0;
GetDefaultDeviceInfo(true, NULL, deviceIndex);
_paDeviceIndex = deviceIndex;
} else
@ -511,7 +511,7 @@ bool AudioDeviceLinuxPulse::MicrophoneIsInitialized() const
return (_mixerManager.MicrophoneIsInitialized());
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@ -538,7 +538,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetSpeakerVolume(WebRtc_UWord32 volume)
int32_t AudioDeviceLinuxPulse::SetSpeakerVolume(uint32_t volume)
{
if (!_playing) {
// Only update the volume if it's been set while we weren't playing.
@ -547,10 +547,10 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetSpeakerVolume(WebRtc_UWord32 volume)
return (_mixerManager.SetSpeakerVolume(volume));
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolume(WebRtc_UWord32& volume) const
int32_t AudioDeviceLinuxPulse::SpeakerVolume(uint32_t& volume) const
{
WebRtc_UWord32 level(0);
uint32_t level(0);
if (_mixerManager.SpeakerVolume(level) == -1)
{
@ -562,9 +562,9 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolume(WebRtc_UWord32& volume) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetWaveOutVolume(
WebRtc_UWord16 volumeLeft,
WebRtc_UWord16 volumeRight)
int32_t AudioDeviceLinuxPulse::SetWaveOutVolume(
uint16_t volumeLeft,
uint16_t volumeRight)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -572,9 +572,9 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetWaveOutVolume(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxPulse::WaveOutVolume(
WebRtc_UWord16& /*volumeLeft*/,
WebRtc_UWord16& /*volumeRight*/) const
int32_t AudioDeviceLinuxPulse::WaveOutVolume(
uint16_t& /*volumeLeft*/,
uint16_t& /*volumeRight*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -582,11 +582,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::WaveOutVolume(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MaxSpeakerVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioDeviceLinuxPulse::MaxSpeakerVolume(
uint32_t& maxVolume) const
{
WebRtc_UWord32 maxVol(0);
uint32_t maxVol(0);
if (_mixerManager.MaxSpeakerVolume(maxVol) == -1)
{
@ -598,11 +598,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MaxSpeakerVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MinSpeakerVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioDeviceLinuxPulse::MinSpeakerVolume(
uint32_t& minVolume) const
{
WebRtc_UWord32 minVol(0);
uint32_t minVol(0);
if (_mixerManager.MinSpeakerVolume(minVol) == -1)
{
@ -614,11 +614,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MinSpeakerVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioDeviceLinuxPulse::SpeakerVolumeStepSize(
uint16_t& stepSize) const
{
WebRtc_UWord16 delta(0);
uint16_t delta(0);
if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
{
@ -630,7 +630,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolumeStepSize(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@ -662,13 +662,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetSpeakerMute(bool enable)
int32_t AudioDeviceLinuxPulse::SetSpeakerMute(bool enable)
{
return (_mixerManager.SetSpeakerMute(enable));
}
WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerMute(bool& enabled) const
int32_t AudioDeviceLinuxPulse::SpeakerMute(bool& enabled) const
{
bool muted(0);
@ -681,7 +681,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@ -714,13 +714,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetMicrophoneMute(bool enable)
int32_t AudioDeviceLinuxPulse::SetMicrophoneMute(bool enable)
{
return (_mixerManager.SetMicrophoneMute(enable));
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneMute(bool& enabled) const
int32_t AudioDeviceLinuxPulse::MicrophoneMute(bool& enabled) const
{
bool muted(0);
@ -733,7 +733,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@ -764,13 +764,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetMicrophoneBoost(bool enable)
int32_t AudioDeviceLinuxPulse::SetMicrophoneBoost(bool enable)
{
return (_mixerManager.SetMicrophoneBoost(enable));
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const
int32_t AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const
{
bool onOff(0);
@ -785,7 +785,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
{
if (_recChannels == 2 && _recording) {
@ -821,7 +821,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
return error;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
int32_t AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
{
#ifndef WEBRTC_PA_GTALK
@ -834,7 +834,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
int32_t AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@ -845,7 +845,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
{
if (_playChannels == 2 && _playing) {
@ -880,7 +880,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
return error;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
int32_t AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
{
#ifndef WEBRTC_PA_GTALK
@ -893,7 +893,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
int32_t AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@ -904,7 +904,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetAGC(bool enable)
int32_t AudioDeviceLinuxPulse::SetAGC(bool enable)
{
_AGC = enable;
@ -918,7 +918,7 @@ bool AudioDeviceLinuxPulse::AGC() const
return _AGC;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
int32_t AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
bool& available)
{
@ -947,17 +947,17 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetMicrophoneVolume(WebRtc_UWord32 volume)
int32_t AudioDeviceLinuxPulse::SetMicrophoneVolume(uint32_t volume)
{
return (_mixerManager.SetMicrophoneVolume(volume));
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolume(
WebRtc_UWord32& volume) const
int32_t AudioDeviceLinuxPulse::MicrophoneVolume(
uint32_t& volume) const
{
WebRtc_UWord32 level(0);
uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1)
{
@ -971,11 +971,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MaxMicrophoneVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioDeviceLinuxPulse::MaxMicrophoneVolume(
uint32_t& maxVolume) const
{
WebRtc_UWord32 maxVol(0);
uint32_t maxVol(0);
if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1)
{
@ -987,11 +987,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MaxMicrophoneVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MinMicrophoneVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioDeviceLinuxPulse::MinMicrophoneVolume(
uint32_t& minVolume) const
{
WebRtc_UWord32 minVol(0);
uint32_t minVol(0);
if (_mixerManager.MinMicrophoneVolume(minVol) == -1)
{
@ -1003,11 +1003,11 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MinMicrophoneVolume(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioDeviceLinuxPulse::MicrophoneVolumeStepSize(
uint16_t& stepSize) const
{
WebRtc_UWord16 delta(0);
uint16_t delta(0);
if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
{
@ -1019,7 +1019,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolumeStepSize(
return 0;
}
WebRtc_Word16 AudioDeviceLinuxPulse::PlayoutDevices()
int16_t AudioDeviceLinuxPulse::PlayoutDevices()
{
PaLock();
@ -1039,7 +1039,7 @@ WebRtc_Word16 AudioDeviceLinuxPulse::PlayoutDevices()
return _numPlayDevices;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(WebRtc_UWord16 index)
int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@ -1047,7 +1047,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(WebRtc_UWord16 index)
return -1;
}
const WebRtc_UWord16 nDevices = PlayoutDevices();
const uint16_t nDevices = PlayoutDevices();
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable output devices is %u", nDevices);
@ -1065,7 +1065,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(WebRtc_UWord16 index)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(
int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@ -1073,13 +1073,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
WebRtc_UWord16 index,
int32_t AudioDeviceLinuxPulse::PlayoutDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
const WebRtc_UWord16 nDevices = PlayoutDevices();
const uint16_t nDevices = PlayoutDevices();
if ((index > (nDevices - 1)) || (name == NULL))
{
@ -1096,7 +1096,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
// Check if default device
if (index == 0)
{
WebRtc_UWord16 deviceIndex = 0;
uint16_t deviceIndex = 0;
return GetDefaultDeviceInfo(false, name, deviceIndex);
}
@ -1115,13 +1115,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDeviceName(
WebRtc_UWord16 index,
int32_t AudioDeviceLinuxPulse::RecordingDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
const WebRtc_UWord16 nDevices(RecordingDevices());
const uint16_t nDevices(RecordingDevices());
if ((index > (nDevices - 1)) || (name == NULL))
{
@ -1138,7 +1138,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDeviceName(
// Check if default device
if (index == 0)
{
WebRtc_UWord16 deviceIndex = 0;
uint16_t deviceIndex = 0;
return GetDefaultDeviceInfo(true, name, deviceIndex);
}
@ -1157,7 +1157,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDeviceName(
return 0;
}
WebRtc_Word16 AudioDeviceLinuxPulse::RecordingDevices()
int16_t AudioDeviceLinuxPulse::RecordingDevices()
{
PaLock();
@ -1177,7 +1177,7 @@ WebRtc_Word16 AudioDeviceLinuxPulse::RecordingDevices()
return _numRecDevices;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(WebRtc_UWord16 index)
int32_t AudioDeviceLinuxPulse::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@ -1185,7 +1185,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(WebRtc_UWord16 index)
return -1;
}
const WebRtc_UWord16 nDevices(RecordingDevices());
const uint16_t nDevices(RecordingDevices());
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable input devices is %u", nDevices);
@ -1203,7 +1203,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(WebRtc_UWord16 index)
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(
int32_t AudioDeviceLinuxPulse::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@ -1211,13 +1211,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(
return -1;
}
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::PlayoutIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
WebRtc_Word32 res = InitPlayout();
int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@ -1230,13 +1230,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutIsAvailable(bool& available)
return res;
}
WebRtc_Word32 AudioDeviceLinuxPulse::RecordingIsAvailable(bool& available)
int32_t AudioDeviceLinuxPulse::RecordingIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
WebRtc_Word32 res = InitRecording();
int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@ -1249,7 +1249,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::RecordingIsAvailable(bool& available)
return res;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
int32_t AudioDeviceLinuxPulse::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@ -1277,7 +1277,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
}
// Set sampling rate to use
WebRtc_UWord32 samplingRate = _samplingFreq * 1000;
uint32_t samplingRate = _samplingFreq * 1000;
if (samplingRate == 44000)
{
samplingRate = 44100;
@ -1308,7 +1308,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetPlayoutSampleRate(_samplingFreq * 1000);
_ptrAudioBuffer->SetPlayoutChannels((WebRtc_UWord8) _playChannels);
_ptrAudioBuffer->SetPlayoutChannels((uint8_t) _playChannels);
}
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
@ -1341,7 +1341,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
}
size_t bytesPerSec = LATE(pa_bytes_per_second)(spec);
WebRtc_UWord32 latency = bytesPerSec
uint32_t latency = bytesPerSec
* WEBRTC_PA_PLAYBACK_LATENCY_MINIMUM_MSECS / WEBRTC_PA_MSECS_PER_SEC;
// Set the play buffer attributes
@ -1358,7 +1358,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
// num samples in bytes * num channels
_playbackBufferSize = _samplingFreq * 10 * 2 * _playChannels;
_playbackBufferUnused = _playbackBufferSize;
_playBuffer = new WebRtc_Word8[_playbackBufferSize];
_playBuffer = new int8_t[_playbackBufferSize];
// Enable underflow callback
LATE(pa_stream_set_underflow_callback)(_playStream,
@ -1375,7 +1375,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
int32_t AudioDeviceLinuxPulse::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@ -1403,7 +1403,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
}
// Set sampling rate to use
WebRtc_UWord32 samplingRate = _samplingFreq * 1000;
uint32_t samplingRate = _samplingFreq * 1000;
if (samplingRate == 44000)
{
samplingRate = 44100;
@ -1433,7 +1433,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetRecordingSampleRate(_samplingFreq * 1000);
_ptrAudioBuffer->SetRecordingChannels((WebRtc_UWord8) _recChannels);
_ptrAudioBuffer->SetRecordingChannels((uint8_t) _recChannels);
}
if (_configuredLatencyRec != WEBRTC_PA_NO_LATENCY_REQUIREMENTS)
@ -1462,7 +1462,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
}
size_t bytesPerSec = LATE(pa_bytes_per_second)(spec);
WebRtc_UWord32 latency = bytesPerSec
uint32_t latency = bytesPerSec
* WEBRTC_PA_LOW_CAPTURE_LATENCY_MSECS / WEBRTC_PA_MSECS_PER_SEC;
// Set the rec buffer attributes
@ -1477,7 +1477,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
_recordBufferSize = _samplingFreq * 10 * 2 * _recChannels;
_recordBufferUsed = 0;
_recBuffer = new WebRtc_Word8[_recordBufferSize];
_recBuffer = new int8_t[_recordBufferSize];
// Enable overflow callback
LATE(pa_stream_set_overflow_callback)(_recStream, PaStreamOverflowCallback,
@ -1492,7 +1492,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StartRecording()
int32_t AudioDeviceLinuxPulse::StartRecording()
{
if (!_recIsInitialized)
@ -1538,7 +1538,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StartRecording()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StopRecording()
int32_t AudioDeviceLinuxPulse::StopRecording()
{
CriticalSectionScoped lock(&_critSect);
@ -1617,7 +1617,7 @@ bool AudioDeviceLinuxPulse::PlayoutIsInitialized() const
return (_playIsInitialized);
}
WebRtc_Word32 AudioDeviceLinuxPulse::StartPlayout()
int32_t AudioDeviceLinuxPulse::StartPlayout()
{
if (!_playIsInitialized)
{
@ -1665,7 +1665,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StartPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::StopPlayout()
int32_t AudioDeviceLinuxPulse::StopPlayout()
{
CriticalSectionScoped lock(&_critSect);
@ -1730,17 +1730,17 @@ WebRtc_Word32 AudioDeviceLinuxPulse::StopPlayout()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDelay(WebRtc_UWord16& delayMS) const
int32_t AudioDeviceLinuxPulse::PlayoutDelay(uint16_t& delayMS) const
{
CriticalSectionScoped lock(&_critSect);
delayMS = (WebRtc_UWord16) _sndCardPlayDelay;
delayMS = (uint16_t) _sndCardPlayDelay;
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDelay(WebRtc_UWord16& delayMS) const
int32_t AudioDeviceLinuxPulse::RecordingDelay(uint16_t& delayMS) const
{
CriticalSectionScoped lock(&_critSect);
delayMS = (WebRtc_UWord16) _sndCardRecDelay;
delayMS = (uint16_t) _sndCardRecDelay;
return 0;
}
@ -1750,9 +1750,9 @@ bool AudioDeviceLinuxPulse::Playing() const
return (_playing);
}
WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutBuffer(
int32_t AudioDeviceLinuxPulse::SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
WebRtc_UWord16 sizeMS)
uint16_t sizeMS)
{
if (type != AudioDeviceModule::kFixedBufferSize)
@ -1768,9 +1768,9 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutBuffer(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutBuffer(
int32_t AudioDeviceLinuxPulse::PlayoutBuffer(
AudioDeviceModule::BufferType& type,
WebRtc_UWord16& sizeMS) const
uint16_t& sizeMS) const
{
type = _playBufType;
@ -1779,7 +1779,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutBuffer(
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::CPULoad(WebRtc_UWord16& /*load*/) const
int32_t AudioDeviceLinuxPulse::CPULoad(uint16_t& /*load*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@ -1985,7 +1985,7 @@ void AudioDeviceLinuxPulse::PaSourceInfoCallbackHandler(
void AudioDeviceLinuxPulse::PaServerInfoCallbackHandler(const pa_server_info *i)
{
// Use PA native sampling rate
WebRtc_UWord32 paSampleRate = i->sample_spec.rate;
uint32_t paSampleRate = i->sample_spec.rate;
if (paSampleRate == 44100)
{
#ifdef WEBRTC_PA_GTALK
@ -2050,12 +2050,12 @@ void AudioDeviceLinuxPulse::PaStreamStateCallbackHandler(pa_stream *p)
LATE(pa_threaded_mainloop_signal)(_paMainloop, 0);
}
WebRtc_Word32 AudioDeviceLinuxPulse::CheckPulseAudioVersion()
int32_t AudioDeviceLinuxPulse::CheckPulseAudioVersion()
{
/*WebRtc_Word32 index = 0;
WebRtc_Word32 partIndex = 0;
WebRtc_Word32 partNum = 1;
WebRtc_Word32 minVersion[3] = {0, 9, 15};
/*int32_t index = 0;
int32_t partIndex = 0;
int32_t partNum = 1;
int32_t minVersion[3] = {0, 9, 15};
bool versionOk = false;
char str[8] = {0};*/
@ -2125,7 +2125,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::CheckPulseAudioVersion()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitSamplingFrequency()
int32_t AudioDeviceLinuxPulse::InitSamplingFrequency()
{
PaLock();
@ -2142,13 +2142,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitSamplingFrequency()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::GetDefaultDeviceInfo(bool recDevice,
char* name,
WebRtc_UWord16& index)
int32_t AudioDeviceLinuxPulse::GetDefaultDeviceInfo(bool recDevice,
char* name,
uint16_t& index)
{
char tmpName[kAdmMaxDeviceNameSize] = {0};
// subtract length of "default: "
WebRtc_UWord16 nameLen = kAdmMaxDeviceNameSize - 9;
uint16_t nameLen = kAdmMaxDeviceNameSize - 9;
char* pName = NULL;
if (name)
@ -2224,7 +2224,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::GetDefaultDeviceInfo(bool recDevice,
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::InitPulseAudio()
int32_t AudioDeviceLinuxPulse::InitPulseAudio()
{
int retVal = 0;
@ -2365,7 +2365,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitPulseAudio()
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::TerminatePulseAudio()
int32_t AudioDeviceLinuxPulse::TerminatePulseAudio()
{
// Do nothing if the instance doesn't exist
// likely PaSymbolTable.Load() fails
@ -2515,7 +2515,7 @@ void AudioDeviceLinuxPulse::PaStreamUnderflowCallbackHandler()
}
size_t bytesPerSec = LATE(pa_bytes_per_second)(spec);
WebRtc_UWord32 newLatency = _configuredLatencyPlay + bytesPerSec
uint32_t newLatency = _configuredLatencyPlay + bytesPerSec
* WEBRTC_PA_PLAYBACK_LATENCY_INCREMENT_MSECS / WEBRTC_PA_MSECS_PER_SEC;
// Set the play buffer attributes
@ -2589,7 +2589,7 @@ void AudioDeviceLinuxPulse::PaStreamOverflowCallbackHandler()
" Recording overflow");
}
WebRtc_Word32 AudioDeviceLinuxPulse::LatencyUsecs(pa_stream *stream)
int32_t AudioDeviceLinuxPulse::LatencyUsecs(pa_stream *stream)
{
if (!WEBRTC_PA_REPORT_LATENCY)
{
@ -2620,7 +2620,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::LatencyUsecs(pa_stream *stream)
// The delay can be negative for monitoring streams if the captured
// samples haven't been played yet. In such a case, "latency" contains the
// magnitude, so we must negate it to get the real value.
WebRtc_Word32 tmpLatency = (WebRtc_Word32) -latency;
int32_t tmpLatency = (int32_t) -latency;
if (tmpLatency < 0)
{
// Make sure that we don't use a negative delay
@ -2630,18 +2630,18 @@ WebRtc_Word32 AudioDeviceLinuxPulse::LatencyUsecs(pa_stream *stream)
return tmpLatency;
} else
{
return (WebRtc_Word32) latency;
return (int32_t) latency;
}
}
WebRtc_Word32 AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
size_t bufferSize)
int32_t AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
size_t bufferSize)
{
size_t size = bufferSize;
WebRtc_UWord32 numRecSamples = _recordBufferSize / (2 * _recChannels);
uint32_t numRecSamples = _recordBufferSize / (2 * _recChannels);
// Account for the peeked data and the used data
WebRtc_UWord32 recDelay = (WebRtc_UWord32) ((LatencyUsecs(_recStream)
uint32_t recDelay = (uint32_t) ((LatencyUsecs(_recStream)
/ 1000) + 10 * ((size + _recordBufferUsed) / _recordBufferSize));
_sndCardRecDelay = recDelay;
@ -2649,7 +2649,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
if (_playStream)
{
// Get the playout delay
_sndCardPlayDelay = (WebRtc_UWord32) (LatencyUsecs(_playStream) / 1000);
_sndCardPlayDelay = (uint32_t) (LatencyUsecs(_playStream) / 1000);
}
if (_recordBufferUsed > 0)
@ -2687,7 +2687,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
{
// Provide data to VoiceEngine
if (ProcessRecordedData(
static_cast<WebRtc_Word8 *> (const_cast<void *> (bufferData)),
static_cast<int8_t *> (const_cast<void *> (bufferData)),
numRecSamples, recDelay) == -1)
{
// We have stopped recording
@ -2711,13 +2711,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::ReadRecordedData(const void* bufferData,
return 0;
}
WebRtc_Word32 AudioDeviceLinuxPulse::ProcessRecordedData(
WebRtc_Word8 *bufferData,
WebRtc_UWord32 bufferSizeInSamples,
WebRtc_UWord32 recDelay)
int32_t AudioDeviceLinuxPulse::ProcessRecordedData(
int8_t *bufferData,
uint32_t bufferSizeInSamples,
uint32_t recDelay)
{
WebRtc_UWord32 currentMicLevel(0);
WebRtc_UWord32 newMicLevel(0);
uint32_t currentMicLevel(0);
uint32_t newMicLevel(0);
_ptrAudioBuffer->SetRecordedBuffer(bufferData, bufferSizeInSamples);
@ -2731,7 +2731,7 @@ WebRtc_Word32 AudioDeviceLinuxPulse::ProcessRecordedData(
}
}
const WebRtc_UWord32 clockDrift(0);
const uint32_t clockDrift(0);
// TODO(andrew): this is a temporary hack, to avoid non-causal far- and
// near-end signals at the AEC for PulseAudio. I think the system delay is
// being correctly calculated here, but for legacy reasons we add +10 ms to
@ -2839,7 +2839,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
}
// Get the currently saved speaker volume
WebRtc_UWord32 volume = 0;
uint32_t volume = 0;
if (update_speaker_volume_at_startup_)
_mixerManager.SpeakerVolume(volume);
@ -2907,7 +2907,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
if (!_recording)
{
// Update the playout delay
_sndCardPlayDelay = (WebRtc_UWord32) (LatencyUsecs(_playStream)
_sndCardPlayDelay = (uint32_t) (LatencyUsecs(_playStream)
/ 1000);
}
@ -2954,8 +2954,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
_tempBufferSpace -= write;
}
WebRtc_UWord32 numPlaySamples = _playbackBufferSize / (2
* _playChannels);
uint32_t numPlaySamples = _playbackBufferSize / (2 * _playChannels);
if (_tempBufferSpace > 0) // Might have been reduced to zero by the above
{
// Ask for new PCM data to be played out using the AudioDeviceBuffer
@ -2964,7 +2963,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
UnLock();
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
" requesting data");
WebRtc_UWord32 nSamples =
uint32_t nSamples =
_ptrAudioBuffer->RequestPlayoutData(numPlaySamples);
Lock();
@ -3157,7 +3156,7 @@ bool AudioDeviceLinuxPulse::RecThreadProcess()
break;
}
_sndCardRecDelay = (WebRtc_UWord32) (LatencyUsecs(_recStream)
_sndCardRecDelay = (uint32_t) (LatencyUsecs(_recStream)
/ 1000);
// Drop lock for sigslot dispatch, which could take a while.

View File

@ -31,12 +31,12 @@
#endif
// Set this constant to 0 to disable latency reading
const WebRtc_UWord32 WEBRTC_PA_REPORT_LATENCY = 1;
const uint32_t WEBRTC_PA_REPORT_LATENCY = 1;
// Constants from implementation by Tristan Schmelcher [tschmelcher@google.com]
// First PulseAudio protocol version that supports PA_STREAM_ADJUST_LATENCY.
const WebRtc_UWord32 WEBRTC_PA_ADJUST_LATENCY_PROTOCOL_VERSION = 13;
const uint32_t WEBRTC_PA_ADJUST_LATENCY_PROTOCOL_VERSION = 13;
// Some timing constants for optimal operation. See
// https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-January/001170.html
@ -50,17 +50,17 @@ const WebRtc_UWord32 WEBRTC_PA_ADJUST_LATENCY_PROTOCOL_VERSION = 13;
// also enforce a sane minimum at start-up time. Anything lower would be
// virtually guaranteed to underflow at least once, so there's no point in
// allowing lower latencies.
const WebRtc_UWord32 WEBRTC_PA_PLAYBACK_LATENCY_MINIMUM_MSECS = 20;
const uint32_t WEBRTC_PA_PLAYBACK_LATENCY_MINIMUM_MSECS = 20;
// Every time a playback stream underflows, we will reconfigure it with target
// latency that is greater by this amount.
const WebRtc_UWord32 WEBRTC_PA_PLAYBACK_LATENCY_INCREMENT_MSECS = 20;
const uint32_t WEBRTC_PA_PLAYBACK_LATENCY_INCREMENT_MSECS = 20;
// We also need to configure a suitable request size. Too small and we'd burn
// CPU from the overhead of transfering small amounts of data at once. Too large
// and the amount of data remaining in the buffer right before refilling it
// would be a buffer underflow risk. We set it to half of the buffer size.
const WebRtc_UWord32 WEBRTC_PA_PLAYBACK_REQUEST_FACTOR = 2;
const uint32_t WEBRTC_PA_PLAYBACK_REQUEST_FACTOR = 2;
// Capture.
@ -69,22 +69,22 @@ const WebRtc_UWord32 WEBRTC_PA_PLAYBACK_REQUEST_FACTOR = 2;
// a recommended value that we use for the kLowLatency constant (but if the user
// explicitly requests something lower then we will honour it).
// 1ms takes about 6-7% CPU. 5ms takes about 5%. 10ms takes about 4.x%.
const WebRtc_UWord32 WEBRTC_PA_LOW_CAPTURE_LATENCY_MSECS = 10;
const uint32_t WEBRTC_PA_LOW_CAPTURE_LATENCY_MSECS = 10;
// There is a round-trip delay to ack the data to the server, so the
// server-side buffer needs extra space to prevent buffer overflow. 20ms is
// sufficient, but there is no penalty to making it bigger, so we make it huge.
// (750ms is libpulse's default value for the _total_ buffer size in the
// kNoLatencyRequirements case.)
const WebRtc_UWord32 WEBRTC_PA_CAPTURE_BUFFER_EXTRA_MSECS = 750;
const uint32_t WEBRTC_PA_CAPTURE_BUFFER_EXTRA_MSECS = 750;
const WebRtc_UWord32 WEBRTC_PA_MSECS_PER_SEC = 1000;
const uint32_t WEBRTC_PA_MSECS_PER_SEC = 1000;
// Init _configuredLatencyRec/Play to this value to disable latency requirements
const WebRtc_Word32 WEBRTC_PA_NO_LATENCY_REQUIREMENTS = -1;
const int32_t WEBRTC_PA_NO_LATENCY_REQUIREMENTS = -1;
// Set this const to 1 to account for peeked and used data in latency calculation
const WebRtc_UWord32 WEBRTC_PA_CAPTURE_BUFFER_LATENCY_ADJUSTMENT = 0;
const uint32_t WEBRTC_PA_CAPTURE_BUFFER_LATENCY_ADJUSTMENT = 0;
namespace webrtc
{
@ -94,125 +94,124 @@ class ThreadWrapper;
class AudioDeviceLinuxPulse: public AudioDeviceGeneric
{
public:
AudioDeviceLinuxPulse(const WebRtc_Word32 id);
AudioDeviceLinuxPulse(const int32_t id);
~AudioDeviceLinuxPulse();
static bool PulseAudioIsSupported();
// Retrieve the currently utilized audio layer
virtual WebRtc_Word32
virtual int32_t
ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const;
// Main initializaton and termination
virtual WebRtc_Word32 Init();
virtual WebRtc_Word32 Terminate();
virtual int32_t Init();
virtual int32_t Terminate();
virtual bool Initialized() const;
// Device enumeration
virtual WebRtc_Word16 PlayoutDevices();
virtual WebRtc_Word16 RecordingDevices();
virtual WebRtc_Word32 PlayoutDeviceName(
WebRtc_UWord16 index,
virtual int16_t PlayoutDevices();
virtual int16_t RecordingDevices();
virtual int32_t PlayoutDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]);
virtual WebRtc_Word32 RecordingDeviceName(
WebRtc_UWord16 index,
virtual int32_t RecordingDeviceName(
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]);
// Device selection
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
virtual WebRtc_Word32 SetPlayoutDevice(
virtual int32_t SetPlayoutDevice(uint16_t index);
virtual int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device);
virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
virtual WebRtc_Word32 SetRecordingDevice(
virtual int32_t SetRecordingDevice(uint16_t index);
virtual int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device);
// Audio transport initialization
virtual WebRtc_Word32 PlayoutIsAvailable(bool& available);
virtual WebRtc_Word32 InitPlayout();
virtual int32_t PlayoutIsAvailable(bool& available);
virtual int32_t InitPlayout();
virtual bool PlayoutIsInitialized() const;
virtual WebRtc_Word32 RecordingIsAvailable(bool& available);
virtual WebRtc_Word32 InitRecording();
virtual int32_t RecordingIsAvailable(bool& available);
virtual int32_t InitRecording();
virtual bool RecordingIsInitialized() const;
// Audio transport control
virtual WebRtc_Word32 StartPlayout();
virtual WebRtc_Word32 StopPlayout();
virtual int32_t StartPlayout();
virtual int32_t StopPlayout();
virtual bool Playing() const;
virtual WebRtc_Word32 StartRecording();
virtual WebRtc_Word32 StopRecording();
virtual int32_t StartRecording();
virtual int32_t StopRecording();
virtual bool Recording() const;
// Microphone Automatic Gain Control (AGC)
virtual WebRtc_Word32 SetAGC(bool enable);
virtual int32_t SetAGC(bool enable);
virtual bool AGC() const;
// Volume control based on the Windows Wave API (Windows only)
virtual WebRtc_Word32 SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
WebRtc_UWord16 volumeRight);
virtual WebRtc_Word32 WaveOutVolume(WebRtc_UWord16& volumeLeft,
WebRtc_UWord16& volumeRight) const;
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight);
virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const;
// Audio mixer initialization
virtual WebRtc_Word32 SpeakerIsAvailable(bool& available);
virtual WebRtc_Word32 InitSpeaker();
virtual int32_t SpeakerIsAvailable(bool& available);
virtual int32_t InitSpeaker();
virtual bool SpeakerIsInitialized() const;
virtual WebRtc_Word32 MicrophoneIsAvailable(bool& available);
virtual WebRtc_Word32 InitMicrophone();
virtual int32_t MicrophoneIsAvailable(bool& available);
virtual int32_t InitMicrophone();
virtual bool MicrophoneIsInitialized() const;
// Speaker volume controls
virtual WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available);
virtual WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume);
virtual WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const;
virtual WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const;
virtual WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const;
virtual WebRtc_Word32 SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const;
virtual int32_t SpeakerVolumeIsAvailable(bool& available);
virtual int32_t SetSpeakerVolume(uint32_t volume);
virtual int32_t SpeakerVolume(uint32_t& volume) const;
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const;
virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
// Microphone volume controls
virtual WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume);
virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
virtual WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
virtual WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
virtual WebRtc_Word32 MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const;
virtual int32_t MicrophoneVolumeIsAvailable(bool& available);
virtual int32_t SetMicrophoneVolume(uint32_t volume);
virtual int32_t MicrophoneVolume(uint32_t& volume) const;
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
virtual int32_t MicrophoneVolumeStepSize(
uint16_t& stepSize) const;
// Speaker mute control
virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
virtual WebRtc_Word32 SetSpeakerMute(bool enable);
virtual WebRtc_Word32 SpeakerMute(bool& enabled) const;
virtual int32_t SpeakerMuteIsAvailable(bool& available);
virtual int32_t SetSpeakerMute(bool enable);
virtual int32_t SpeakerMute(bool& enabled) const;
// Microphone mute control
virtual WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneMute(bool enable);
virtual WebRtc_Word32 MicrophoneMute(bool& enabled) const;
virtual int32_t MicrophoneMuteIsAvailable(bool& available);
virtual int32_t SetMicrophoneMute(bool enable);
virtual int32_t MicrophoneMute(bool& enabled) const;
// Microphone boost control
virtual WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available);
virtual WebRtc_Word32 SetMicrophoneBoost(bool enable);
virtual WebRtc_Word32 MicrophoneBoost(bool& enabled) const;
virtual int32_t MicrophoneBoostIsAvailable(bool& available);
virtual int32_t SetMicrophoneBoost(bool enable);
virtual int32_t MicrophoneBoost(bool& enabled) const;
// Stereo support
virtual WebRtc_Word32 StereoPlayoutIsAvailable(bool& available);
virtual WebRtc_Word32 SetStereoPlayout(bool enable);
virtual WebRtc_Word32 StereoPlayout(bool& enabled) const;
virtual WebRtc_Word32 StereoRecordingIsAvailable(bool& available);
virtual WebRtc_Word32 SetStereoRecording(bool enable);
virtual WebRtc_Word32 StereoRecording(bool& enabled) const;
virtual int32_t StereoPlayoutIsAvailable(bool& available);
virtual int32_t SetStereoPlayout(bool enable);
virtual int32_t StereoPlayout(bool& enabled) const;
virtual int32_t StereoRecordingIsAvailable(bool& available);
virtual int32_t SetStereoRecording(bool enable);
virtual int32_t StereoRecording(bool& enabled) const;
// Delay information and control
virtual WebRtc_Word32
virtual int32_t
SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
WebRtc_UWord16 sizeMS);
virtual WebRtc_Word32 PlayoutBuffer(AudioDeviceModule::BufferType& type,
WebRtc_UWord16& sizeMS) const;
virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const;
virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const;
uint16_t sizeMS);
virtual int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
uint16_t& sizeMS) const;
virtual int32_t PlayoutDelay(uint16_t& delayMS) const;
virtual int32_t RecordingDelay(uint16_t& delayMS) const;
// CPU load
virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const;
virtual int32_t CPULoad(uint16_t& load) const;
public:
virtual bool PlayoutWarning() const;
@ -270,18 +269,17 @@ private:
void PaStreamReadCallbackHandler();
static void PaStreamOverflowCallback(pa_stream *unused, void *pThis);
void PaStreamOverflowCallbackHandler();
WebRtc_Word32 LatencyUsecs(pa_stream *stream);
WebRtc_Word32 ReadRecordedData(const void* bufferData, size_t bufferSize);
WebRtc_Word32 ProcessRecordedData(WebRtc_Word8 *bufferData,
WebRtc_UWord32 bufferSizeInSamples,
WebRtc_UWord32 recDelay);
int32_t LatencyUsecs(pa_stream *stream);
int32_t ReadRecordedData(const void* bufferData, size_t bufferSize);
int32_t ProcessRecordedData(int8_t *bufferData,
uint32_t bufferSizeInSamples,
uint32_t recDelay);
WebRtc_Word32 CheckPulseAudioVersion();
WebRtc_Word32 InitSamplingFrequency();
WebRtc_Word32 GetDefaultDeviceInfo(bool recDevice, char* name,
WebRtc_UWord16& index);
WebRtc_Word32 InitPulseAudio();
WebRtc_Word32 TerminatePulseAudio();
int32_t CheckPulseAudioVersion();
int32_t InitSamplingFrequency();
int32_t GetDefaultDeviceInfo(bool recDevice, char* name, uint16_t& index);
int32_t InitPulseAudio();
int32_t TerminatePulseAudio();
void PaLock();
void PaUnLock();
@ -302,20 +300,20 @@ private:
ThreadWrapper* _ptrThreadPlay;
ThreadWrapper* _ptrThreadRec;
WebRtc_UWord32 _recThreadID;
WebRtc_UWord32 _playThreadID;
WebRtc_Word32 _id;
uint32_t _recThreadID;
uint32_t _playThreadID;
int32_t _id;
AudioMixerManagerLinuxPulse _mixerManager;
WebRtc_UWord16 _inputDeviceIndex;
WebRtc_UWord16 _outputDeviceIndex;
uint16_t _inputDeviceIndex;
uint16_t _outputDeviceIndex;
bool _inputDeviceIsSpecified;
bool _outputDeviceIsSpecified;
WebRtc_UWord32 _samplingFreq;
WebRtc_UWord8 _recChannels;
WebRtc_UWord8 _playChannels;
uint32_t _samplingFreq;
uint8_t _recChannels;
uint8_t _playChannels;
AudioDeviceModule::BufferType _playBufType;
@ -333,40 +331,40 @@ private:
bool update_speaker_volume_at_startup_;
private:
WebRtc_UWord16 _playBufDelayFixed; // fixed playback delay
uint16_t _playBufDelayFixed; // fixed playback delay
WebRtc_UWord32 _sndCardPlayDelay;
WebRtc_UWord32 _sndCardRecDelay;
uint32_t _sndCardPlayDelay;
uint32_t _sndCardRecDelay;
WebRtc_Word32 _writeErrors;
WebRtc_UWord16 _playWarning;
WebRtc_UWord16 _playError;
WebRtc_UWord16 _recWarning;
WebRtc_UWord16 _recError;
int32_t _writeErrors;
uint16_t _playWarning;
uint16_t _playError;
uint16_t _recWarning;
uint16_t _recError;
WebRtc_UWord16 _deviceIndex;
WebRtc_Word16 _numPlayDevices;
WebRtc_Word16 _numRecDevices;
uint16_t _deviceIndex;
int16_t _numPlayDevices;
int16_t _numRecDevices;
char* _playDeviceName;
char* _recDeviceName;
char* _playDisplayDeviceName;
char* _recDisplayDeviceName;
char _paServerVersion[32];
WebRtc_Word8* _playBuffer;
int8_t* _playBuffer;
size_t _playbackBufferSize;
size_t _playbackBufferUnused;
size_t _tempBufferSpace;
WebRtc_Word8* _recBuffer;
int8_t* _recBuffer;
size_t _recordBufferSize;
size_t _recordBufferUsed;
const void* _tempSampleData;
size_t _tempSampleDataSize;
WebRtc_Word32 _configuredLatencyPlay;
WebRtc_Word32 _configuredLatencyRec;
int32_t _configuredLatencyPlay;
int32_t _configuredLatencyRec;
// PulseAudio
WebRtc_UWord16 _paDeviceIndex;
uint16_t _paDeviceIndex;
bool _paStateChanged;
pa_threaded_mainloop* _paMainloop;
@ -375,8 +373,8 @@ private:
pa_stream* _recStream;
pa_stream* _playStream;
WebRtc_UWord32 _recStreamFlags;
WebRtc_UWord32 _playStreamFlags;
uint32_t _recStreamFlags;
uint32_t _playStreamFlags;
pa_buffer_attr _playBufferAttr;
pa_buffer_attr _recBufferAttr;
};

View File

@ -16,7 +16,7 @@
namespace webrtc
{
AudioDeviceUtilityLinux::AudioDeviceUtilityLinux(const WebRtc_Word32 id) :
AudioDeviceUtilityLinux::AudioDeviceUtilityLinux(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id,
@ -41,7 +41,7 @@ AudioDeviceUtilityLinux::~AudioDeviceUtilityLinux()
// ============================================================================
WebRtc_Word32 AudioDeviceUtilityLinux::Init()
int32_t AudioDeviceUtilityLinux::Init()
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,

View File

@ -21,14 +21,14 @@ class CriticalSectionWrapper;
class AudioDeviceUtilityLinux: public AudioDeviceUtility
{
public:
AudioDeviceUtilityLinux(const WebRtc_Word32 id);
AudioDeviceUtilityLinux(const int32_t id);
~AudioDeviceUtilityLinux();
virtual WebRtc_Word32 Init();
virtual int32_t Init();
private:
CriticalSectionWrapper& _critSect;
WebRtc_Word32 _id;
int32_t _id;
};
} // namespace webrtc

View File

@ -24,7 +24,7 @@ extern webrtc_adm_linux_alsa::AlsaSymbolTable AlsaSymbolTable;
namespace webrtc
{
AudioMixerManagerLinuxALSA::AudioMixerManagerLinuxALSA(const WebRtc_Word32 id) :
AudioMixerManagerLinuxALSA::AudioMixerManagerLinuxALSA(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
_outputMixerHandle(NULL),
@ -53,7 +53,7 @@ AudioMixerManagerLinuxALSA::~AudioMixerManagerLinuxALSA()
// PUBLIC METHODS
// ============================================================================
WebRtc_Word32 AudioMixerManagerLinuxALSA::Close()
int32_t AudioMixerManagerLinuxALSA::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@ -67,7 +67,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::Close()
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseSpeaker()
int32_t AudioMixerManagerLinuxALSA::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@ -109,7 +109,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseSpeaker()
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseMicrophone()
int32_t AudioMixerManagerLinuxALSA::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@ -160,7 +160,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseMicrophone()
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::OpenSpeaker(char* deviceName)
int32_t AudioMixerManagerLinuxALSA::OpenSpeaker(char* deviceName)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::OpenSpeaker(name=%s)", deviceName);
@ -253,7 +253,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::OpenSpeaker(char* deviceName)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::OpenMicrophone(char *deviceName)
int32_t AudioMixerManagerLinuxALSA::OpenMicrophone(char *deviceName)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::OpenMicrophone(name=%s)",
@ -371,8 +371,8 @@ bool AudioMixerManagerLinuxALSA::MicrophoneIsInitialized() const
return (_inputMixerHandle != NULL);
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetSpeakerVolume(
WebRtc_UWord32 volume)
int32_t AudioMixerManagerLinuxALSA::SetSpeakerVolume(
uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::SetSpeakerVolume(volume=%u)",
@ -401,8 +401,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetSpeakerVolume(
return (0);
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolume(
WebRtc_UWord32& volume) const
int32_t AudioMixerManagerLinuxALSA::SpeakerVolume(
uint32_t& volume) const
{
if (_outputMixerElement == NULL)
@ -430,13 +430,13 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolume(
" AudioMixerManagerLinuxALSA::SpeakerVolume() => vol=%i",
vol);
volume = static_cast<WebRtc_UWord32> (vol);
volume = static_cast<uint32_t> (vol);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MaxSpeakerVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioMixerManagerLinuxALSA::MaxSpeakerVolume(
uint32_t& maxVolume) const
{
if (_outputMixerElement == NULL)
@ -464,13 +464,13 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MaxSpeakerVolume(
LATE(snd_strerror)(errVal));
}
maxVolume = static_cast<WebRtc_UWord32> (maxVol);
maxVolume = static_cast<uint32_t> (maxVol);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MinSpeakerVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioMixerManagerLinuxALSA::MinSpeakerVolume(
uint32_t& minVolume) const
{
if (_outputMixerElement == NULL)
@ -498,7 +498,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MinSpeakerVolume(
LATE(snd_strerror)(errVal));
}
minVolume = static_cast<WebRtc_UWord32> (minVol);
minVolume = static_cast<uint32_t> (minVol);
return 0;
}
@ -510,8 +510,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MinSpeakerVolume(
// SetMaxSpeakerVolume
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMaxSpeakerVolume(
WebRtc_UWord32 maxVolume)
int32_t AudioMixerManagerLinuxALSA::SetMaxSpeakerVolume(
uint32_t maxVolume)
{
if (_outputMixerElement == NULL)
@ -551,8 +551,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MinSpeakerVolume(
// SetMinSpeakerVolume
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMinSpeakerVolume(
WebRtc_UWord32 minVolume)
int32_t AudioMixerManagerLinuxALSA::SetMinSpeakerVolume(
uint32_t minVolume)
{
if (_outputMixerElement == NULL)
@ -589,8 +589,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MinSpeakerVolume(
}
*/
WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeStepSize(
uint16_t& stepSize) const
{
if (_outputMixerHandle == NULL)
@ -606,7 +606,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolumeStepSize(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
bool& available)
{
if (_outputMixerElement == NULL)
@ -621,7 +621,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(
int32_t AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(
bool& available)
{
if (_outputMixerElement == NULL)
@ -636,7 +636,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetSpeakerMute(bool enable)
int32_t AudioMixerManagerLinuxALSA::SetSpeakerMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::SetSpeakerMute(enable=%u)",
@ -676,7 +676,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetSpeakerMute(bool enable)
return (0);
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const
int32_t AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const
{
if (_outputMixerElement == NULL)
@ -719,7 +719,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(
int32_t AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(
bool& available)
{
if (_inputMixerElement == NULL)
@ -733,7 +733,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneMute(bool enable)
int32_t AudioMixerManagerLinuxALSA::SetMicrophoneMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::SetMicrophoneMute(enable=%u)",
@ -773,7 +773,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneMute(bool enable)
return (0);
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const
int32_t AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const
{
if (_inputMixerElement == NULL)
@ -816,7 +816,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
int32_t AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
bool& available)
{
if (_inputMixerHandle == NULL)
@ -832,7 +832,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneBoost(bool enable)
int32_t AudioMixerManagerLinuxALSA::SetMicrophoneBoost(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::SetMicrophoneBoost(enable=%u)",
@ -862,7 +862,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneBoost(bool enable)
return (0);
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
int32_t AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
{
if (_inputMixerHandle == NULL)
@ -878,7 +878,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
bool& available)
{
if (_inputMixerElement == NULL)
@ -893,8 +893,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneVolume(
WebRtc_UWord32 volume)
int32_t AudioMixerManagerLinuxALSA::SetMicrophoneVolume(
uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxALSA::SetMicrophoneVolume(volume=%u)",
@ -931,8 +931,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneVolume(
// SetMaxMicrophoneVolume
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMaxMicrophoneVolume(
WebRtc_UWord32 maxVolume)
int32_t AudioMixerManagerLinuxALSA::SetMaxMicrophoneVolume(
uint32_t maxVolume)
{
if (_inputMixerElement == NULL)
@ -972,8 +972,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneVolume(
// SetMinMicrophoneVolume
// ----------------------------------------------------------------------------
WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMinMicrophoneVolume(
WebRtc_UWord32 minVolume)
int32_t AudioMixerManagerLinuxALSA::SetMinMicrophoneVolume(
uint32_t minVolume)
{
if (_inputMixerElement == NULL)
@ -1012,8 +1012,8 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMicrophoneVolume(
}
*/
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolume(
WebRtc_UWord32& volume) const
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolume(
uint32_t& volume) const
{
if (_inputMixerElement == NULL)
@ -1042,13 +1042,13 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolume(
" AudioMixerManagerLinuxALSA::MicrophoneVolume() => vol=%i",
vol);
volume = static_cast<WebRtc_UWord32> (vol);
volume = static_cast<uint32_t> (vol);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MaxMicrophoneVolume(
WebRtc_UWord32& maxVolume) const
int32_t AudioMixerManagerLinuxALSA::MaxMicrophoneVolume(
uint32_t& maxVolume) const
{
if (_inputMixerElement == NULL)
@ -1083,13 +1083,13 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MaxMicrophoneVolume(
LATE(snd_strerror)(errVal));
}
maxVolume = static_cast<WebRtc_UWord32> (maxVol);
maxVolume = static_cast<uint32_t> (maxVol);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MinMicrophoneVolume(
WebRtc_UWord32& minVolume) const
int32_t AudioMixerManagerLinuxALSA::MinMicrophoneVolume(
uint32_t& minVolume) const
{
if (_inputMixerElement == NULL)
@ -1116,13 +1116,13 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MinMicrophoneVolume(
LATE(snd_strerror)(errVal));
}
minVolume = static_cast<WebRtc_UWord32> (minVol);
minVolume = static_cast<uint32_t> (minVol);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeStepSize(
uint16_t& stepSize) const
{
if (_inputMixerHandle == NULL)
@ -1142,7 +1142,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolumeStepSize(
// Private Methods
// ============================================================================
WebRtc_Word32 AudioMixerManagerLinuxALSA::LoadMicMixerElement() const
int32_t AudioMixerManagerLinuxALSA::LoadMicMixerElement() const
{
int errVal = LATE(snd_mixer_load)(_inputMixerHandle);
if (errVal < 0)
@ -1208,7 +1208,7 @@ WebRtc_Word32 AudioMixerManagerLinuxALSA::LoadMicMixerElement() const
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxALSA::LoadSpeakerMixerElement() const
int32_t AudioMixerManagerLinuxALSA::LoadSpeakerMixerElement() const
{
int errVal = LATE(snd_mixer_load)(_outputMixerHandle);
if (errVal < 0)

View File

@ -24,47 +24,47 @@ namespace webrtc
class AudioMixerManagerLinuxALSA
{
public:
WebRtc_Word32 OpenSpeaker(char* deviceName);
WebRtc_Word32 OpenMicrophone(char* deviceName);
WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume);
WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const;
WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const;
WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const;
WebRtc_Word32 SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const;
WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available);
WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
WebRtc_Word32 SetSpeakerMute(bool enable);
WebRtc_Word32 SpeakerMute(bool& enabled) const;
WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneMute(bool enable);
WebRtc_Word32 MicrophoneMute(bool& enabled) const;
WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneBoost(bool enable);
WebRtc_Word32 MicrophoneBoost(bool& enabled) const;
WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume);
WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
WebRtc_Word32 MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const;
WebRtc_Word32 Close();
WebRtc_Word32 CloseSpeaker();
WebRtc_Word32 CloseMicrophone();
int32_t OpenSpeaker(char* deviceName);
int32_t OpenMicrophone(char* deviceName);
int32_t SetSpeakerVolume(uint32_t volume);
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
int32_t SpeakerMute(bool& enabled) const;
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
int32_t MicrophoneBoostIsAvailable(bool& available);
int32_t SetMicrophoneBoost(bool enable);
int32_t MicrophoneBoost(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
int32_t Close();
int32_t CloseSpeaker();
int32_t CloseMicrophone();
bool SpeakerIsInitialized() const;
bool MicrophoneIsInitialized() const;
public:
AudioMixerManagerLinuxALSA(const WebRtc_Word32 id);
AudioMixerManagerLinuxALSA(const int32_t id);
~AudioMixerManagerLinuxALSA();
private:
WebRtc_Word32 LoadMicMixerElement() const;
WebRtc_Word32 LoadSpeakerMixerElement() const;
int32_t LoadMicMixerElement() const;
int32_t LoadSpeakerMixerElement() const;
void GetControlName(char *controlName, char* deviceName) const;
private:
CriticalSectionWrapper& _critSect;
WebRtc_Word32 _id;
int32_t _id;
mutable snd_mixer_t* _outputMixerHandle;
char _outputMixerStr[kAdmMaxDeviceNameSize];
mutable snd_mixer_t* _inputMixerHandle;

View File

@ -26,7 +26,7 @@ namespace webrtc
enum { kMaxRetryOnFailure = 2 };
AudioMixerManagerLinuxPulse::AudioMixerManagerLinuxPulse(const WebRtc_Word32 id) :
AudioMixerManagerLinuxPulse::AudioMixerManagerLinuxPulse(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
_paOutputDeviceIndex(-1),
@ -62,7 +62,7 @@ AudioMixerManagerLinuxPulse::~AudioMixerManagerLinuxPulse()
// PUBLIC METHODS
// ============================================================================
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
int32_t AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
pa_threaded_mainloop* mainloop,
pa_context* context)
{
@ -88,7 +88,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::Close()
int32_t AudioMixerManagerLinuxPulse::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@ -106,7 +106,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::Close()
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseSpeaker()
int32_t AudioMixerManagerLinuxPulse::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@ -120,7 +120,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseSpeaker()
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseMicrophone()
int32_t AudioMixerManagerLinuxPulse::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@ -134,7 +134,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseMicrophone()
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetPlayStream(pa_stream* playStream)
int32_t AudioMixerManagerLinuxPulse::SetPlayStream(pa_stream* playStream)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetPlayStream(playStream)");
@ -144,7 +144,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetPlayStream(pa_stream* playStream)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetRecStream(pa_stream* recStream)
int32_t AudioMixerManagerLinuxPulse::SetRecStream(pa_stream* recStream)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetRecStream(recStream)");
@ -154,8 +154,8 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetRecStream(pa_stream* recStream)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::OpenSpeaker(
WebRtc_UWord16 deviceIndex)
int32_t AudioMixerManagerLinuxPulse::OpenSpeaker(
uint16_t deviceIndex)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::OpenSpeaker(deviceIndex=%d)",
@ -182,8 +182,8 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::OpenSpeaker(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::OpenMicrophone(
WebRtc_UWord16 deviceIndex)
int32_t AudioMixerManagerLinuxPulse::OpenMicrophone(
uint16_t deviceIndex)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::OpenMicrophone(deviceIndex=%d)",
@ -226,8 +226,8 @@ bool AudioMixerManagerLinuxPulse::MicrophoneIsInitialized() const
return (_paInputDeviceIndex != -1);
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetSpeakerVolume(
WebRtc_UWord32 volume)
int32_t AudioMixerManagerLinuxPulse::SetSpeakerVolume(
uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetSpeakerVolume(volume=%u)",
@ -299,8 +299,8 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetSpeakerVolume(
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::SpeakerVolume(WebRtc_UWord32& volume) const
int32_t
AudioMixerManagerLinuxPulse::SpeakerVolume(uint32_t& volume) const
{
if (_paOutputDeviceIndex == -1)
@ -317,7 +317,7 @@ AudioMixerManagerLinuxPulse::SpeakerVolume(WebRtc_UWord32& volume) const
if (!GetSinkInputInfo())
return -1;
volume = static_cast<WebRtc_UWord32> (_paVolume);
volume = static_cast<uint32_t> (_paVolume);
ResetCallbackVariables();
} else
{
@ -331,8 +331,8 @@ AudioMixerManagerLinuxPulse::SpeakerVolume(WebRtc_UWord32& volume) const
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
int32_t
AudioMixerManagerLinuxPulse::MaxSpeakerVolume(uint32_t& maxVolume) const
{
if (_paOutputDeviceIndex == -1)
@ -344,13 +344,13 @@ AudioMixerManagerLinuxPulse::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
// PA_VOLUME_NORM corresponds to 100% (0db)
// but PA allows up to 150 db amplification
maxVolume = static_cast<WebRtc_UWord32> (PA_VOLUME_NORM);
maxVolume = static_cast<uint32_t> (PA_VOLUME_NORM);
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
int32_t
AudioMixerManagerLinuxPulse::MinSpeakerVolume(uint32_t& minVolume) const
{
if (_paOutputDeviceIndex == -1)
@ -360,13 +360,13 @@ AudioMixerManagerLinuxPulse::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
return -1;
}
minVolume = static_cast<WebRtc_UWord32> (PA_VOLUME_MUTED);
minVolume = static_cast<uint32_t> (PA_VOLUME_MUTED);
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
int32_t
AudioMixerManagerLinuxPulse::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
if (_paOutputDeviceIndex == -1)
@ -390,7 +390,7 @@ AudioMixerManagerLinuxPulse::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) con
return 0;
}
WebRtc_Word32
int32_t
AudioMixerManagerLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@ -406,7 +406,7 @@ AudioMixerManagerLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
return 0;
}
WebRtc_Word32
int32_t
AudioMixerManagerLinuxPulse::SpeakerMuteIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@ -422,7 +422,7 @@ AudioMixerManagerLinuxPulse::SpeakerMuteIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetSpeakerMute(bool enable)
int32_t AudioMixerManagerLinuxPulse::SetSpeakerMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetSpeakerMute(enable=%u)",
@ -479,7 +479,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetSpeakerMute(bool enable)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const
int32_t AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const
{
if (_paOutputDeviceIndex == -1)
@ -510,7 +510,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const
return 0;
}
WebRtc_Word32
int32_t
AudioMixerManagerLinuxPulse::StereoPlayoutIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@ -546,7 +546,7 @@ AudioMixerManagerLinuxPulse::StereoPlayoutIsAvailable(bool& available)
return 0;
}
WebRtc_Word32
int32_t
AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable(bool& available)
{
if (_paInputDeviceIndex == -1)
@ -602,7 +602,7 @@ AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMuteIsAvailable(
int32_t AudioMixerManagerLinuxPulse::MicrophoneMuteIsAvailable(
bool& available)
{
if (_paInputDeviceIndex == -1)
@ -618,7 +618,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMuteIsAvailable(
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable)
int32_t AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetMicrophoneMute(enable=%u)",
@ -680,7 +680,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const
int32_t AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const
{
if (_paInputDeviceIndex == -1)
@ -720,7 +720,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const
return 0;
}
WebRtc_Word32
int32_t
AudioMixerManagerLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
{
if (_paInputDeviceIndex == -1)
@ -738,7 +738,7 @@ AudioMixerManagerLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::SetMicrophoneBoost(bool enable)
int32_t AudioMixerManagerLinuxPulse::SetMicrophoneBoost(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetMicrophoneBoost(enable=%u)",
@ -768,7 +768,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::SetMicrophoneBoost(bool enable)
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
int32_t AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
{
if (_paInputDeviceIndex == -1)
@ -784,7 +784,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
bool& available)
{
if (_paInputDeviceIndex == -1)
@ -800,8 +800,8 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::SetMicrophoneVolume(WebRtc_UWord32 volume)
int32_t
AudioMixerManagerLinuxPulse::SetMicrophoneVolume(uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerLinuxPulse::SetMicrophoneVolume(volume=%u)",
@ -862,7 +862,7 @@ AudioMixerManagerLinuxPulse::SetMicrophoneVolume(WebRtc_UWord32 volume)
return -1;
}
WebRtc_UWord8 channels = _paChannels;
uint8_t channels = _paChannels;
ResetCallbackVariables();
pa_cvolume cVolumes;
@ -898,8 +898,8 @@ AudioMixerManagerLinuxPulse::SetMicrophoneVolume(WebRtc_UWord32 volume)
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::MicrophoneVolume(WebRtc_UWord32& volume) const
int32_t
AudioMixerManagerLinuxPulse::MicrophoneVolume(uint32_t& volume) const
{
if (_paInputDeviceIndex == -1)
@ -927,7 +927,7 @@ AudioMixerManagerLinuxPulse::MicrophoneVolume(WebRtc_UWord32& volume) const
if (!GetSourceInfoByIndex(deviceIndex))
return -1;
volume = static_cast<WebRtc_UWord32> (_paVolume);
volume = static_cast<uint32_t> (_paVolume);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" AudioMixerManagerLinuxPulse::MicrophoneVolume() => vol=%i, volume");
@ -938,8 +938,8 @@ AudioMixerManagerLinuxPulse::MicrophoneVolume(WebRtc_UWord32& volume) const
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
int32_t
AudioMixerManagerLinuxPulse::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
if (_paInputDeviceIndex == -1)
@ -952,13 +952,13 @@ AudioMixerManagerLinuxPulse::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) cons
// PA_VOLUME_NORM corresponds to 100% (0db)
// PA allows up to 150 db amplification (PA_VOLUME_MAX)
// but that doesn't work well for all sound cards
maxVolume = static_cast<WebRtc_UWord32> (PA_VOLUME_NORM);
maxVolume = static_cast<uint32_t> (PA_VOLUME_NORM);
return 0;
}
WebRtc_Word32
AudioMixerManagerLinuxPulse::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
int32_t
AudioMixerManagerLinuxPulse::MinMicrophoneVolume(uint32_t& minVolume) const
{
if (_paInputDeviceIndex == -1)
@ -968,13 +968,13 @@ AudioMixerManagerLinuxPulse::MinMicrophoneVolume(WebRtc_UWord32& minVolume) cons
return -1;
}
minVolume = static_cast<WebRtc_UWord32> (PA_VOLUME_MUTED);
minVolume = static_cast<uint32_t> (PA_VOLUME_MUTED);
return 0;
}
WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize(
WebRtc_UWord16& stepSize) const
int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize(
uint16_t& stepSize) const
{
if (_paInputDeviceIndex == -1)
@ -1018,7 +1018,7 @@ WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize(
return -1;
}
stepSize = static_cast<WebRtc_UWord16> ((PA_VOLUME_NORM + 1) / _paVolSteps);
stepSize = static_cast<uint16_t> ((PA_VOLUME_NORM + 1) / _paVolSteps);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize()"

View File

@ -29,43 +29,43 @@ namespace webrtc
class AudioMixerManagerLinuxPulse
{
public:
WebRtc_Word32 SetPlayStream(pa_stream* playStream);
WebRtc_Word32 SetRecStream(pa_stream* recStream);
WebRtc_Word32 OpenSpeaker(WebRtc_UWord16 deviceIndex);
WebRtc_Word32 OpenMicrophone(WebRtc_UWord16 deviceIndex);
WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume);
WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const;
WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const;
WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const;
WebRtc_Word32 SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const;
WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available);
WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
WebRtc_Word32 SetSpeakerMute(bool enable);
WebRtc_Word32 StereoPlayoutIsAvailable(bool& available);
WebRtc_Word32 StereoRecordingIsAvailable(bool& available);
WebRtc_Word32 SpeakerMute(bool& enabled) const;
WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneMute(bool enable);
WebRtc_Word32 MicrophoneMute(bool& enabled) const;
WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneBoost(bool enable);
WebRtc_Word32 MicrophoneBoost(bool& enabled) const;
WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available);
WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume);
WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
WebRtc_Word32 MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const;
WebRtc_Word32 SetPulseAudioObjects(pa_threaded_mainloop* mainloop,
pa_context* context);
WebRtc_Word32 Close();
WebRtc_Word32 CloseSpeaker();
WebRtc_Word32 CloseMicrophone();
int32_t SetPlayStream(pa_stream* playStream);
int32_t SetRecStream(pa_stream* recStream);
int32_t OpenSpeaker(uint16_t deviceIndex);
int32_t OpenMicrophone(uint16_t deviceIndex);
int32_t SetSpeakerVolume(uint32_t volume);
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
int32_t StereoPlayoutIsAvailable(bool& available);
int32_t StereoRecordingIsAvailable(bool& available);
int32_t SpeakerMute(bool& enabled) const;
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
int32_t MicrophoneBoostIsAvailable(bool& available);
int32_t SetMicrophoneBoost(bool enable);
int32_t MicrophoneBoost(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
int32_t SetPulseAudioObjects(pa_threaded_mainloop* mainloop,
pa_context* context);
int32_t Close();
int32_t CloseSpeaker();
int32_t CloseMicrophone();
bool SpeakerIsInitialized() const;
bool MicrophoneIsInitialized() const;
public:
AudioMixerManagerLinuxPulse(const WebRtc_Word32 id);
AudioMixerManagerLinuxPulse(const int32_t id);
~AudioMixerManagerLinuxPulse();
private:
@ -93,9 +93,9 @@ private:
private:
CriticalSectionWrapper& _critSect;
WebRtc_Word32 _id;
WebRtc_Word16 _paOutputDeviceIndex;
WebRtc_Word16 _paInputDeviceIndex;
int32_t _id;
int16_t _paOutputDeviceIndex;
int16_t _paInputDeviceIndex;
pa_stream* _paPlayStream;
pa_stream* _paRecStream;
@ -103,12 +103,12 @@ private:
pa_threaded_mainloop* _paMainloop;
pa_context* _paContext;
mutable WebRtc_UWord32 _paVolume;
mutable WebRtc_UWord32 _paMute;
mutable WebRtc_UWord32 _paVolSteps;
mutable uint32_t _paVolume;
mutable uint32_t _paMute;
mutable uint32_t _paVolSteps;
bool _paSpeakerMute;
mutable WebRtc_UWord32 _paSpeakerVolume;
mutable WebRtc_UWord8 _paChannels;
mutable uint32_t _paSpeakerVolume;
mutable uint8_t _paChannels;
bool _paObjectsSet;
mutable bool _callbackValues;
};