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/webrtc@3793 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/modules/audio_device/android/audio_device_jni_android.cc b/modules/audio_device/android/audio_device_jni_android.cc
index b248057..93932eb 100644
--- a/modules/audio_device/android/audio_device_jni_android.cc
+++ b/modules/audio_device/android/audio_device_jni_android.cc
@@ -43,7 +43,7 @@
// by the same Java application.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
+int32_t AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
void* javaVM,
void* env,
void* context) {
@@ -114,7 +114,7 @@
// AudioDeviceAndroidJni - ctor
// ----------------------------------------------------------------------------
-AudioDeviceAndroidJni::AudioDeviceAndroidJni(const WebRtc_Word32 id) :
+AudioDeviceAndroidJni::AudioDeviceAndroidJni(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
@@ -201,7 +201,7 @@
// ActiveAudioLayer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::ActiveAudioLayer(
+int32_t AudioDeviceAndroidJni::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const
{
@@ -214,7 +214,7 @@
// Init
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::Init()
+int32_t AudioDeviceAndroidJni::Init()
{
CriticalSectionScoped lock(&_critSect);
@@ -301,7 +301,7 @@
// Terminate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::Terminate()
+int32_t AudioDeviceAndroidJni::Terminate()
{
CriticalSectionScoped lock(&_critSect);
@@ -472,7 +472,7 @@
// SpeakerIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::SpeakerIsAvailable(bool& available)
{
// We always assume it's available
@@ -485,7 +485,7 @@
// InitSpeaker
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitSpeaker()
+int32_t AudioDeviceAndroidJni::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -515,7 +515,7 @@
// MicrophoneIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::MicrophoneIsAvailable(bool& available)
{
// We always assume it's available
@@ -528,7 +528,7 @@
// InitMicrophone
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitMicrophone()
+int32_t AudioDeviceAndroidJni::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -578,7 +578,7 @@
// SpeakerVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::SpeakerVolumeIsAvailable(bool& available)
{
available = true; // We assume we are always be able to set/get volume
@@ -590,7 +590,7 @@
// SetSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceAndroidJni::SetSpeakerVolume(uint32_t volume)
{
if (!_speakerIsInitialized)
@@ -655,7 +655,7 @@
// SpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceAndroidJni::SpeakerVolume(uint32_t& volume) const
{
if (!_speakerIsInitialized)
@@ -712,7 +712,7 @@
}
}
- volume = static_cast<WebRtc_UWord32> (level);
+ volume = static_cast<uint32_t> (level);
return 0;
}
@@ -721,9 +721,9 @@
// SetWaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetWaveOutVolume(
- WebRtc_UWord16 /*volumeLeft*/,
- WebRtc_UWord16 /*volumeRight*/)
+int32_t AudioDeviceAndroidJni::SetWaveOutVolume(
+ uint16_t /*volumeLeft*/,
+ uint16_t /*volumeRight*/)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -735,9 +735,9 @@
// WaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::WaveOutVolume(
- WebRtc_UWord16& /*volumeLeft*/,
- WebRtc_UWord16& /*volumeRight*/) const
+int32_t AudioDeviceAndroidJni::WaveOutVolume(
+ uint16_t& /*volumeLeft*/,
+ uint16_t& /*volumeRight*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -749,8 +749,8 @@
// MaxSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MaxSpeakerVolume(
- WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceAndroidJni::MaxSpeakerVolume(
+ uint32_t& maxVolume) const
{
if (!_speakerIsInitialized)
@@ -769,8 +769,8 @@
// MinSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MinSpeakerVolume(
- WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceAndroidJni::MinSpeakerVolume(
+ uint32_t& minVolume) const
{
if (!_speakerIsInitialized)
@@ -789,8 +789,8 @@
// SpeakerVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const
+int32_t AudioDeviceAndroidJni::SpeakerVolumeStepSize(
+ uint16_t& stepSize) const
{
if (!_speakerIsInitialized)
@@ -809,7 +809,7 @@
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::SpeakerMuteIsAvailable(bool& available)
{
available = false; // Speaker mute not supported on Android
@@ -821,7 +821,7 @@
// SetSpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetSpeakerMute(bool /*enable*/)
+int32_t AudioDeviceAndroidJni::SetSpeakerMute(bool /*enable*/)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -833,7 +833,7 @@
// SpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SpeakerMute(bool& /*enabled*/) const
+int32_t AudioDeviceAndroidJni::SpeakerMute(bool& /*enabled*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -845,7 +845,7 @@
// MicrophoneMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::MicrophoneMuteIsAvailable(bool& available)
{
available = false; // Mic mute not supported on Android
@@ -857,7 +857,7 @@
// SetMicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetMicrophoneMute(bool /*enable*/)
+int32_t AudioDeviceAndroidJni::SetMicrophoneMute(bool /*enable*/)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -869,7 +869,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneMute(bool& /*enabled*/) const
+int32_t AudioDeviceAndroidJni::MicrophoneMute(bool& /*enabled*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -881,7 +881,7 @@
// MicrophoneBoostIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::MicrophoneBoostIsAvailable(bool& available)
{
available = false; // Mic boost not supported on Android
@@ -893,7 +893,7 @@
// SetMicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetMicrophoneBoost(bool enable)
+int32_t AudioDeviceAndroidJni::SetMicrophoneBoost(bool enable)
{
if (!_micIsInitialized)
@@ -917,7 +917,7 @@
// MicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneBoost(bool& enabled) const
+int32_t AudioDeviceAndroidJni::MicrophoneBoost(bool& enabled) const
{
if (!_micIsInitialized)
@@ -936,7 +936,7 @@
// StereoRecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::StereoRecordingIsAvailable(bool& available)
{
available = false; // Stereo recording not supported on Android
@@ -950,7 +950,7 @@
// Specifies the number of input channels.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetStereoRecording(bool enable)
+int32_t AudioDeviceAndroidJni::SetStereoRecording(bool enable)
{
if (enable)
@@ -967,7 +967,7 @@
// StereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StereoRecording(bool& enabled) const
+int32_t AudioDeviceAndroidJni::StereoRecording(bool& enabled) const
{
enabled = false;
@@ -979,7 +979,7 @@
// StereoPlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::StereoPlayoutIsAvailable(bool& available)
{
available = false; // Stereo playout not supported on Android
@@ -991,7 +991,7 @@
// SetStereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetStereoPlayout(bool enable)
+int32_t AudioDeviceAndroidJni::SetStereoPlayout(bool enable)
{
if (enable)
@@ -1008,7 +1008,7 @@
// StereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceAndroidJni::StereoPlayout(bool& enabled) const
{
enabled = false;
@@ -1020,7 +1020,7 @@
// SetAGC
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetAGC(bool enable)
+int32_t AudioDeviceAndroidJni::SetAGC(bool enable)
{
_AGC = enable;
@@ -1042,7 +1042,7 @@
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneVolumeIsAvailable(
+int32_t AudioDeviceAndroidJni::MicrophoneVolumeIsAvailable(
bool& available)
{
@@ -1055,8 +1055,8 @@
// SetMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetMicrophoneVolume(
- WebRtc_UWord32 /*volume*/)
+int32_t AudioDeviceAndroidJni::SetMicrophoneVolume(
+ uint32_t /*volume*/)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1068,8 +1068,8 @@
// MicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneVolume(
- WebRtc_UWord32& /*volume*/) const
+int32_t AudioDeviceAndroidJni::MicrophoneVolume(
+ uint32_t& /*volume*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1081,8 +1081,8 @@
// MaxMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MaxMicrophoneVolume(
- WebRtc_UWord32& /*maxVolume*/) const
+int32_t AudioDeviceAndroidJni::MaxMicrophoneVolume(
+ uint32_t& /*maxVolume*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1094,8 +1094,8 @@
// MinMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MinMicrophoneVolume(
- WebRtc_UWord32& /*minVolume*/) const
+int32_t AudioDeviceAndroidJni::MinMicrophoneVolume(
+ uint32_t& /*minVolume*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1107,8 +1107,8 @@
// MicrophoneVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::MicrophoneVolumeStepSize(
- WebRtc_UWord16& /*stepSize*/) const
+int32_t AudioDeviceAndroidJni::MicrophoneVolumeStepSize(
+ uint16_t& /*stepSize*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1120,7 +1120,7 @@
// PlayoutDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceAndroidJni::PlayoutDevices()
+int16_t AudioDeviceAndroidJni::PlayoutDevices()
{
// There is one device only
@@ -1131,7 +1131,7 @@
// SetPlayoutDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceAndroidJni::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@@ -1159,7 +1159,7 @@
// SetPlayoutDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetPlayoutDevice(
+int32_t AudioDeviceAndroidJni::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
@@ -1172,8 +1172,8 @@
// PlayoutDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceAndroidJni::PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
@@ -1200,8 +1200,8 @@
// RecordingDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceAndroidJni::RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
@@ -1228,7 +1228,7 @@
// RecordingDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceAndroidJni::RecordingDevices()
+int16_t AudioDeviceAndroidJni::RecordingDevices()
{
// There is one device only
@@ -1239,7 +1239,7 @@
// SetRecordingDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceAndroidJni::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@@ -1261,7 +1261,7 @@
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetRecordingDevice(
+int32_t AudioDeviceAndroidJni::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
@@ -1274,13 +1274,13 @@
// PlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::PlayoutIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::PlayoutIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
- WebRtc_Word32 res = InitPlayout();
+ int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@@ -1297,13 +1297,13 @@
// RecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::RecordingIsAvailable(bool& available)
+int32_t AudioDeviceAndroidJni::RecordingIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
- WebRtc_Word32 res = InitRecording();
+ int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@@ -1320,7 +1320,7 @@
// InitPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitPlayout()
+int32_t AudioDeviceAndroidJni::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1428,7 +1428,7 @@
// InitRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitRecording()
+int32_t AudioDeviceAndroidJni::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1536,7 +1536,7 @@
// StartRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StartRecording()
+int32_t AudioDeviceAndroidJni::StartRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1620,7 +1620,7 @@
// StopRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StopRecording()
+int32_t AudioDeviceAndroidJni::StopRecording()
{
@@ -1720,7 +1720,7 @@
// StartPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StartPlayout()
+int32_t AudioDeviceAndroidJni::StartPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1804,7 +1804,7 @@
// StopPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::StopPlayout()
+int32_t AudioDeviceAndroidJni::StopPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1871,7 +1871,7 @@
// Remaining amount of data still in the playout buffer.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::PlayoutDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceAndroidJni::PlayoutDelay(uint16_t& delayMS) const
{
delayMS = _delayPlayout;
@@ -1884,8 +1884,8 @@
// Remaining amount of data still in the recording buffer.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::RecordingDelay(
- WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceAndroidJni::RecordingDelay(
+ uint16_t& delayMS) const
{
delayMS = _delayRecording;
@@ -1906,9 +1906,9 @@
// SetPlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetPlayoutBuffer(
+int32_t AudioDeviceAndroidJni::SetPlayoutBuffer(
const AudioDeviceModule::BufferType /*type*/,
- WebRtc_UWord16 /*sizeMS*/)
+ uint16_t /*sizeMS*/)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1920,9 +1920,9 @@
// PlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::PlayoutBuffer(
+int32_t AudioDeviceAndroidJni::PlayoutBuffer(
AudioDeviceModule::BufferType& type,
- WebRtc_UWord16& sizeMS) const
+ uint16_t& sizeMS) const
{
type = AudioDeviceModule::kAdaptiveBufferSize;
@@ -1935,7 +1935,7 @@
// CPULoad
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::CPULoad(WebRtc_UWord16& /*load*/) const
+int32_t AudioDeviceAndroidJni::CPULoad(uint16_t& /*load*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -2019,8 +2019,8 @@
// SetRecordingSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetRecordingSampleRate(
- const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceAndroidJni::SetRecordingSampleRate(
+ const uint32_t samplesPerSec)
{
if (samplesPerSec > 48000 || samplesPerSec < 8000)
@@ -2050,8 +2050,8 @@
// SetPlayoutSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetPlayoutSampleRate(
- const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceAndroidJni::SetPlayoutSampleRate(
+ const uint32_t samplesPerSec)
{
if (samplesPerSec > 48000 || samplesPerSec < 8000)
@@ -2081,7 +2081,7 @@
// SetLoudspeakerStatus
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::SetLoudspeakerStatus(bool enable)
+int32_t AudioDeviceAndroidJni::SetLoudspeakerStatus(bool enable)
{
if (!globalContext)
@@ -2144,7 +2144,7 @@
// GetLoudspeakerStatus
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::GetLoudspeakerStatus(bool& enabled) const
+int32_t AudioDeviceAndroidJni::GetLoudspeakerStatus(bool& enabled) const
{
enabled = _loudSpeakerOn;
@@ -2164,7 +2164,7 @@
// AudioDeviceAndroid.java
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitJavaResources()
+int32_t AudioDeviceAndroidJni::InitJavaResources()
{
// todo: Check if we already have created the java object
_javaVM = globalJvm;
@@ -2395,7 +2395,7 @@
// Also stores the max playout volume returned from InitPlayout.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceAndroidJni::InitSampleRate()
+int32_t AudioDeviceAndroidJni::InitSampleRate()
{
int samplingFreq = 44100;
jint res = 0;
@@ -2548,7 +2548,7 @@
}
// Store max playout volume
- _maxSpeakerVolume = static_cast<WebRtc_UWord32> (res);
+ _maxSpeakerVolume = static_cast<uint32_t> (res);
if (_maxSpeakerVolume < 1)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -2677,14 +2677,14 @@
if (_playing)
{
- WebRtc_Word8 playBuffer[2 * 480]; // Max 10 ms @ 48 kHz / 16 bit
- WebRtc_UWord32 samplesToPlay = _samplingFreqOut * 10;
+ int8_t playBuffer[2 * 480]; // Max 10 ms @ 48 kHz / 16 bit
+ uint32_t samplesToPlay = _samplingFreqOut * 10;
// ask for new PCM data to be played out using the AudioDeviceBuffer
// ensure that this callback is executed without taking the
// audio-thread lock
UnLock();
- WebRtc_UWord32 nSamples =
+ uint32_t nSamples =
_ptrAudioBuffer->RequestPlayoutData(samplesToPlay);
Lock();
@@ -2821,7 +2821,7 @@
if (_recording)
{
- WebRtc_UWord32 samplesToRec = _samplingFreqIn * 10;
+ uint32_t samplesToRec = _samplingFreqIn * 10;
// Call java sc object method to record data to direct buffer
// Will block until data has been recorded (see java sc class),
diff --git a/modules/audio_device/android/audio_device_jni_android.h b/modules/audio_device/android/audio_device_jni_android.h
index b8186be..6631867 100644
--- a/modules/audio_device/android/audio_device_jni_android.h
+++ b/modules/audio_device/android/audio_device_jni_android.h
@@ -24,121 +24,120 @@
{
class EventWrapper;
-const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default is 16 kHz
-const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default is 16 kHz
+const uint32_t N_REC_SAMPLES_PER_SEC = 16000; // Default is 16 kHz
+const uint32_t N_PLAY_SAMPLES_PER_SEC = 16000; // Default is 16 kHz
-const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording
-const WebRtc_UWord32 N_PLAY_CHANNELS = 1; // default is mono playout
+const uint32_t N_REC_CHANNELS = 1; // default is mono recording
+const uint32_t N_PLAY_CHANNELS = 1; // default is mono playout
-const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480; // Handle max 10 ms @ 48 kHz
+const uint32_t REC_BUF_SIZE_IN_SAMPLES = 480; // Handle max 10 ms @ 48 kHz
class ThreadWrapper;
class AudioDeviceAndroidJni : public AudioDeviceGeneric {
public:
- AudioDeviceAndroidJni(const WebRtc_Word32 id);
+ AudioDeviceAndroidJni(const int32_t id);
~AudioDeviceAndroidJni();
- static WebRtc_Word32 SetAndroidAudioDeviceObjects(void* javaVM,
- void* env,
- void* context);
+ static int32_t SetAndroidAudioDeviceObjects(void* javaVM,
+ void* env,
+ void* context);
- virtual WebRtc_Word32 ActiveAudioLayer(
+ virtual int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const;
- virtual WebRtc_Word32 Init();
- virtual WebRtc_Word32 Terminate();
+ virtual int32_t Init();
+ virtual int32_t Terminate();
virtual bool Initialized() const;
- virtual WebRtc_Word16 PlayoutDevices();
- virtual WebRtc_Word16 RecordingDevices();
- virtual WebRtc_Word32 PlayoutDeviceName(WebRtc_UWord16 index,
- char name[kAdmMaxDeviceNameSize],
- char guid[kAdmMaxGuidSize]);
- virtual WebRtc_Word32 RecordingDeviceName(
- 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 int32_t RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]);
- 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);
- 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;
- 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;
- virtual WebRtc_Word32 SetAGC(bool enable);
+ virtual int32_t SetAGC(bool enable);
virtual bool AGC() const;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- 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;
- virtual WebRtc_Word32 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;
+ virtual int32_t SetPlayoutBuffer(
+ const AudioDeviceModule::BufferType type, 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;
- virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const;
+ virtual int32_t CPULoad(uint16_t& load) const;
virtual bool PlayoutWarning() const;
virtual bool PlayoutError() const;
@@ -151,13 +150,13 @@
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer);
- virtual WebRtc_Word32 SetRecordingSampleRate(
- const WebRtc_UWord32 samplesPerSec);
- virtual WebRtc_Word32 SetPlayoutSampleRate(
- const WebRtc_UWord32 samplesPerSec);
+ virtual int32_t SetRecordingSampleRate(
+ const uint32_t samplesPerSec);
+ virtual int32_t SetPlayoutSampleRate(
+ const uint32_t samplesPerSec);
- virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable);
- virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enable) const;
+ virtual int32_t SetLoudspeakerStatus(bool enable);
+ virtual int32_t GetLoudspeakerStatus(bool& enable) const;
private:
// Lock
@@ -169,8 +168,8 @@
};
// Init
- WebRtc_Word32 InitJavaResources();
- WebRtc_Word32 InitSampleRate();
+ int32_t InitJavaResources();
+ int32_t InitSampleRate();
// Threads
static bool RecThreadFunc(void*);
@@ -181,7 +180,7 @@
// Misc
AudioDeviceBuffer* _ptrAudioBuffer;
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
// Events
EventWrapper& _timeEventRec;
@@ -192,15 +191,15 @@
// Threads
ThreadWrapper* _ptrThreadPlay;
ThreadWrapper* _ptrThreadRec;
- WebRtc_UWord32 _recThreadID;
- WebRtc_UWord32 _playThreadID;
+ uint32_t _recThreadID;
+ uint32_t _playThreadID;
bool _playThreadIsInitialized;
bool _recThreadIsInitialized;
bool _shutdownPlayThread;
bool _shutdownRecThread;
// Rec buffer
- WebRtc_Word8 _recBuffer[2 * REC_BUF_SIZE_IN_SAMPLES];
+ int8_t _recBuffer[2 * REC_BUF_SIZE_IN_SAMPLES];
// States
bool _recordingDeviceIsSpecified;
@@ -220,22 +219,22 @@
bool _stopPlay;
// Warnings and errors
- WebRtc_UWord16 _playWarning;
- WebRtc_UWord16 _playError;
- WebRtc_UWord16 _recWarning;
- WebRtc_UWord16 _recError;
+ uint16_t _playWarning;
+ uint16_t _playError;
+ uint16_t _recWarning;
+ uint16_t _recError;
// Delay
- WebRtc_UWord16 _delayPlayout;
- WebRtc_UWord16 _delayRecording;
+ uint16_t _delayPlayout;
+ uint16_t _delayRecording;
// AGC state
bool _AGC;
// Stored device properties
- WebRtc_UWord16 _samplingFreqIn; // Sampling frequency for Mic
- WebRtc_UWord16 _samplingFreqOut; // Sampling frequency for Speaker
- WebRtc_UWord32 _maxSpeakerVolume; // The maximum speaker volume value
+ uint16_t _samplingFreqIn; // Sampling frequency for Mic
+ uint16_t _samplingFreqOut; // Sampling frequency for Speaker
+ uint32_t _maxSpeakerVolume; // The maximum speaker volume value
bool _loudSpeakerOn;
// Stores the desired audio source to use, set in SetRecordingDevice
int _recAudioSource;
diff --git a/modules/audio_device/android/audio_device_opensles_android.cc b/modules/audio_device/android/audio_device_opensles_android.cc
index e0744d6..93271f0 100644
--- a/modules/audio_device/android/audio_device_opensles_android.cc
+++ b/modules/audio_device/android/audio_device_opensles_android.cc
@@ -32,7 +32,7 @@
namespace webrtc {
-AudioDeviceAndroidOpenSLES::AudioDeviceAndroidOpenSLES(const WebRtc_Word32 id)
+AudioDeviceAndroidOpenSLES::AudioDeviceAndroidOpenSLES(const int32_t id)
: voe_audio_buffer_(NULL),
crit_sect_(*CriticalSectionWrapper::CreateCriticalSection()),
id_(id),
@@ -100,7 +100,7 @@
voe_audio_buffer_->SetPlayoutChannels(N_PLAY_CHANNELS);
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::ActiveAudioLayer(
+int32_t AudioDeviceAndroidOpenSLES::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const {
audioLayer = AudioDeviceModule::kPlatformDefaultAudio;
@@ -108,7 +108,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::Init() {
+int32_t AudioDeviceAndroidOpenSLES::Init() {
CriticalSectionScoped lock(&crit_sect_);
if (is_initialized_)
@@ -117,8 +117,7 @@
SLEngineOption EngineOption[] = {
{ SL_ENGINEOPTION_THREADSAFE, static_cast<SLuint32>(SL_BOOLEAN_TRUE) },
};
- WebRtc_Word32 res = slCreateEngine(&sles_engine_, 1, EngineOption, 0,
- NULL, NULL);
+ int32_t res = slCreateEngine(&sles_engine_, 1, EngineOption, 0, NULL, NULL);
if (res != SL_RESULT_SUCCESS) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
@@ -168,7 +167,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::Terminate() {
+int32_t AudioDeviceAndroidOpenSLES::Terminate() {
CriticalSectionScoped lock(&crit_sect_);
if (!is_initialized_)
@@ -197,7 +196,7 @@
return (is_initialized_);
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::SpeakerIsAvailable(
bool& available) {
// We always assume it's available
available = true;
@@ -205,7 +204,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitSpeaker() {
+int32_t AudioDeviceAndroidOpenSLES::InitSpeaker() {
CriticalSectionScoped lock(&crit_sect_);
if (is_playing_) {
@@ -227,14 +226,14 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneIsAvailable(
bool& available) {
// We always assume it's available.
available = true;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitMicrophone() {
+int32_t AudioDeviceAndroidOpenSLES::InitMicrophone() {
CriticalSectionScoped lock(&crit_sect_);
if (is_recording_) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
@@ -261,14 +260,14 @@
return is_mic_initialized_;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerVolumeIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::SpeakerVolumeIsAvailable(
bool& available) {
available = true; // We assume we are always be able to set/get volume.
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetSpeakerVolume(
- WebRtc_UWord32 volume) {
+int32_t AudioDeviceAndroidOpenSLES::SetSpeakerVolume(
+ uint32_t volume) {
if (!is_speaker_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Speaker not initialized");
@@ -294,29 +293,29 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerVolume(
- WebRtc_UWord32& volume) const {
+int32_t AudioDeviceAndroidOpenSLES::SpeakerVolume(
+ uint32_t& volume) const {
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetWaveOutVolume(
- WebRtc_UWord16 volumeLeft,
- WebRtc_UWord16 volumeRight) {
+int32_t AudioDeviceAndroidOpenSLES::SetWaveOutVolume(
+ uint16_t volumeLeft,
+ uint16_t volumeRight) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::WaveOutVolume(
- WebRtc_UWord16& volumeLeft,
- WebRtc_UWord16& volumeRight) const {
+int32_t AudioDeviceAndroidOpenSLES::WaveOutVolume(
+ uint16_t& volumeLeft,
+ uint16_t& volumeRight) const {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MaxSpeakerVolume(
- WebRtc_UWord32& maxVolume) const {
+int32_t AudioDeviceAndroidOpenSLES::MaxSpeakerVolume(
+ uint32_t& maxVolume) const {
if (!is_speaker_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Speaker not initialized");
@@ -328,8 +327,8 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MinSpeakerVolume(
- WebRtc_UWord32& minVolume) const {
+int32_t AudioDeviceAndroidOpenSLES::MinSpeakerVolume(
+ uint32_t& minVolume) const {
if (!is_speaker_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Speaker not initialized");
@@ -339,8 +338,8 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const {
+int32_t AudioDeviceAndroidOpenSLES::SpeakerVolumeStepSize(
+ uint16_t& stepSize) const {
if (!is_speaker_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Speaker not initialized");
@@ -350,51 +349,51 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerMuteIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::SpeakerMuteIsAvailable(
bool& available) {
available = false; // Speaker mute not supported on Android.
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetSpeakerMute(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetSpeakerMute(bool enable) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SpeakerMute(
+int32_t AudioDeviceAndroidOpenSLES::SpeakerMute(
bool& enabled) const {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneMuteIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneMuteIsAvailable(
bool& available) {
available = false; // Mic mute not supported on Android
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetMicrophoneMute(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetMicrophoneMute(bool enable) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneMute(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneMute(
bool& enabled) const {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneBoostIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneBoostIsAvailable(
bool& available) {
available = false; // Mic boost not supported on Android.
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetMicrophoneBoost(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetMicrophoneBoost(bool enable) {
if (!is_mic_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Microphone not initialized");
@@ -408,7 +407,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneBoost(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneBoost(
bool& enabled) const {
if (!is_mic_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
@@ -419,13 +418,13 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StereoRecordingIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::StereoRecordingIsAvailable(
bool& available) {
available = false; // Stereo recording not supported on Android.
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetStereoRecording(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetStereoRecording(bool enable) {
if (enable) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Enabling not available");
@@ -434,13 +433,13 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StereoRecording(
+int32_t AudioDeviceAndroidOpenSLES::StereoRecording(
bool& enabled) const {
enabled = false;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StereoPlayoutIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::StereoPlayoutIsAvailable(
bool& available) {
// TODO(leozwang): This api is called before initplayout, we need
// to detect audio device to find out if stereo is supported or not.
@@ -448,7 +447,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetStereoPlayout(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetStereoPlayout(bool enable) {
if (enable) {
return 0;
} else {
@@ -457,14 +456,14 @@
}
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StereoPlayout(
+int32_t AudioDeviceAndroidOpenSLES::StereoPlayout(
bool& enabled) const {
enabled = (player_pcm_.numChannels == 2 ? true : false);
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetAGC(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetAGC(bool enable) {
agc_enabled_ = enable;
return 0;
}
@@ -473,14 +472,14 @@
return agc_enabled_;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneVolumeIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneVolumeIsAvailable(
bool& available) {
available = true;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetMicrophoneVolume(
- WebRtc_UWord32 volume) {
+int32_t AudioDeviceAndroidOpenSLES::SetMicrophoneVolume(
+ uint32_t volume) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" OpenSL doesn't support contolling Mic volume yet");
// TODO(leozwang): Add microphone volume control when OpenSL apis
@@ -488,34 +487,34 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneVolume(
- WebRtc_UWord32& volume) const {
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneVolume(
+ uint32_t& volume) const {
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MaxMicrophoneVolume(
- WebRtc_UWord32& maxVolume) const {
+int32_t AudioDeviceAndroidOpenSLES::MaxMicrophoneVolume(
+ uint32_t& maxVolume) const {
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MinMicrophoneVolume(
- WebRtc_UWord32& minVolume) const {
+int32_t AudioDeviceAndroidOpenSLES::MinMicrophoneVolume(
+ uint32_t& minVolume) const {
minVolume = 0;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::MicrophoneVolumeStepSize(
- WebRtc_UWord16& stepSize) const {
+int32_t AudioDeviceAndroidOpenSLES::MicrophoneVolumeStepSize(
+ uint16_t& stepSize) const {
stepSize = 1;
return 0;
}
-WebRtc_Word16 AudioDeviceAndroidOpenSLES::PlayoutDevices() {
+int16_t AudioDeviceAndroidOpenSLES::PlayoutDevices() {
return 1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetPlayoutDevice(
- WebRtc_UWord16 index) {
+int32_t AudioDeviceAndroidOpenSLES::SetPlayoutDevice(
+ uint16_t index) {
if (is_play_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Playout already initialized");
@@ -534,7 +533,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetPlayoutDevice(
+int32_t AudioDeviceAndroidOpenSLES::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
@@ -542,8 +541,8 @@
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceAndroidOpenSLES::PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
if (0 != index) {
@@ -561,8 +560,8 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceAndroidOpenSLES::RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
if (0 != index) {
@@ -580,12 +579,12 @@
return 0;
}
-WebRtc_Word16 AudioDeviceAndroidOpenSLES::RecordingDevices() {
+int16_t AudioDeviceAndroidOpenSLES::RecordingDevices() {
return 1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetRecordingDevice(
- WebRtc_UWord16 index) {
+int32_t AudioDeviceAndroidOpenSLES::SetRecordingDevice(
+ uint16_t index) {
if (is_rec_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" Recording already initialized");
@@ -604,17 +603,17 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetRecordingDevice(
+int32_t AudioDeviceAndroidOpenSLES::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::PlayoutIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::PlayoutIsAvailable(
bool& available) {
available = false;
- WebRtc_Word32 res = InitPlayout();
+ int32_t res = InitPlayout();
StopPlayout();
if (res != -1) {
available = true;
@@ -622,10 +621,10 @@
return res;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::RecordingIsAvailable(
+int32_t AudioDeviceAndroidOpenSLES::RecordingIsAvailable(
bool& available) {
available = false;
- WebRtc_Word32 res = InitRecording();
+ int32_t res = InitRecording();
StopRecording();
if (res != -1) {
available = true;
@@ -633,7 +632,7 @@
return res;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitPlayout() {
+int32_t AudioDeviceAndroidOpenSLES::InitPlayout() {
CriticalSectionScoped lock(&crit_sect_);
if (!is_initialized_) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
@@ -680,7 +679,7 @@
SLDataSink audio_sink = { &locator_outputmix, NULL };
// Create Output Mix object to be used by player.
- WebRtc_Word32 res = -1;
+ int32_t res = -1;
res = (*sles_engine_itf_)->CreateOutputMix(sles_engine_itf_,
&sles_output_mixer_,
0,
@@ -775,7 +774,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() {
+int32_t AudioDeviceAndroidOpenSLES::InitRecording() {
CriticalSectionScoped lock(&crit_sect_);
if (!is_initialized_) {
@@ -848,7 +847,7 @@
SL_IID_ANDROIDSIMPLEBUFFERQUEUE, SL_IID_ANDROIDCONFIGURATION };
const SLboolean req[2] = {
SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE };
- WebRtc_Word32 res = -1;
+ int32_t res = -1;
res = (*sles_engine_itf_)->CreateAudioRecorder(sles_engine_itf_,
&sles_recorder_,
&audio_source,
@@ -906,7 +905,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StartRecording() {
+int32_t AudioDeviceAndroidOpenSLES::StartRecording() {
CriticalSectionScoped lock(&crit_sect_);
if (!is_rec_initialized_) {
@@ -935,7 +934,7 @@
memset(rec_buf_, 0, sizeof(rec_buf_));
memset(rec_voe_buf_, 0, sizeof(rec_voe_buf_));
- WebRtc_UWord32 num_bytes =
+ uint32_t num_bytes =
N_REC_CHANNELS * sizeof(int16_t) * mic_sampling_rate_ / 100;
while (!rec_queue_.empty())
@@ -949,7 +948,7 @@
rec_voe_ready_queue_.push(rec_voe_buf_[i]);
}
- WebRtc_Word32 res = -1;
+ int32_t res = -1;
for (int i = 0; i < N_REC_QUEUE_BUFFERS; ++i) {
// We assign 10ms buffer to each queue, size given in bytes.
res = (*sles_recorder_sbq_itf_)->Enqueue(
@@ -1000,7 +999,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StopRecording() {
+int32_t AudioDeviceAndroidOpenSLES::StopRecording() {
{
CriticalSectionScoped lock(&crit_sect_);
@@ -1011,7 +1010,7 @@
}
if ((sles_recorder_itf_ != NULL) && (sles_recorder_ != NULL)) {
- WebRtc_Word32 res = (*sles_recorder_itf_)->SetRecordState(
+ int32_t res = (*sles_recorder_itf_)->SetRecordState(
sles_recorder_itf_,
SL_RECORDSTATE_STOPPED);
if (res != SL_RESULT_SUCCESS) {
@@ -1067,7 +1066,7 @@
return is_play_initialized_;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StartPlayout() {
+int32_t AudioDeviceAndroidOpenSLES::StartPlayout() {
int i;
CriticalSectionScoped lock(&crit_sect_);
@@ -1094,7 +1093,7 @@
return -1;
}
- WebRtc_UWord32 num_bytes =
+ uint32_t num_bytes =
N_PLAY_CHANNELS * sizeof(int16_t) * speaker_sampling_rate_ / 100;
memset(play_buf_, 0, sizeof(play_buf_));
@@ -1102,7 +1101,7 @@
while (!play_queue_.empty())
play_queue_.pop();
- WebRtc_Word32 res = -1;
+ int32_t res = -1;
for (i = 0; i < std::min(2, static_cast<int>(N_PLAY_QUEUE_BUFFERS)); ++i) {
res = (*sles_player_sbq_itf_)->Enqueue(
sles_player_sbq_itf_,
@@ -1133,7 +1132,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::StopPlayout() {
+int32_t AudioDeviceAndroidOpenSLES::StopPlayout() {
{
CriticalSectionScoped lock(&crit_sect_);
if (!is_play_initialized_) {
@@ -1144,7 +1143,7 @@
if (!sles_player_itf_ && !sles_output_mixer_ && !sles_player_) {
// Make sure player is stopped
- WebRtc_Word32 res =
+ int32_t res =
(*sles_player_itf_)->SetPlayState(sles_player_itf_,
SL_PLAYSTATE_STOPPED);
if (res != SL_RESULT_SUCCESS) {
@@ -1179,14 +1178,14 @@
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::PlayoutDelay(
- WebRtc_UWord16& delayMS) const {
+int32_t AudioDeviceAndroidOpenSLES::PlayoutDelay(
+ uint16_t& delayMS) const {
delayMS = playout_delay_;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::RecordingDelay(
- WebRtc_UWord16& delayMS) const {
+int32_t AudioDeviceAndroidOpenSLES::RecordingDelay(
+ uint16_t& delayMS) const {
delayMS = recording_delay_;
return 0;
}
@@ -1195,24 +1194,24 @@
return is_playing_;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetPlayoutBuffer(
+int32_t AudioDeviceAndroidOpenSLES::SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
- WebRtc_UWord16 sizeMS) {
+ uint16_t sizeMS) {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::PlayoutBuffer(
+int32_t AudioDeviceAndroidOpenSLES::PlayoutBuffer(
AudioDeviceModule::BufferType& type,
- WebRtc_UWord16& sizeMS) const {
+ uint16_t& sizeMS) const {
type = AudioDeviceModule::kAdaptiveBufferSize;
sizeMS = playout_delay_; // Set to current playout delay
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::CPULoad(
- WebRtc_UWord16& load) const {
+int32_t AudioDeviceAndroidOpenSLES::CPULoad(
+ uint16_t& load) const {
WEBRTC_OPENSL_TRACE(kTraceWarning, kTraceAudioDevice, id_,
" API call not supported on this platform");
return -1;
@@ -1250,12 +1249,12 @@
rec_error_ = 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetLoudspeakerStatus(bool enable) {
+int32_t AudioDeviceAndroidOpenSLES::SetLoudspeakerStatus(bool enable) {
loundspeaker_on_ = enable;
return 0;
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::GetLoudspeakerStatus(
+int32_t AudioDeviceAndroidOpenSLES::GetLoudspeakerStatus(
bool& enabled) const {
enabled = loundspeaker_on_;
return 0;
@@ -1275,8 +1274,8 @@
const unsigned int num_samples = speaker_sampling_rate_ / 100;
const unsigned int num_bytes =
N_PLAY_CHANNELS * num_samples * sizeof(int16_t);
- WebRtc_Word8 buf[PLAY_MAX_TEMP_BUF_SIZE_PER_10ms];
- WebRtc_Word8* audio;
+ int8_t buf[PLAY_MAX_TEMP_BUF_SIZE_PER_10ms];
+ int8_t* audio;
audio = play_queue_.front();
play_queue_.pop();
@@ -1325,7 +1324,7 @@
const unsigned int num_bytes =
N_REC_CHANNELS * num_samples * sizeof(int16_t);
const unsigned int total_bytes = num_bytes;
- WebRtc_Word8 buf[REC_MAX_TEMP_BUF_SIZE_PER_10ms];
+ int8_t buf[REC_MAX_TEMP_BUF_SIZE_PER_10ms];
{
CriticalSectionScoped lock(&crit_sect_);
@@ -1334,7 +1333,7 @@
return true;
}
- WebRtc_Word8* audio = rec_voe_audio_queue_.front();
+ int8_t* audio = rec_voe_audio_queue_.front();
rec_voe_audio_queue_.pop();
memcpy(buf, audio, total_bytes);
memset(audio, 0, total_bytes);
@@ -1357,7 +1356,7 @@
const unsigned int num_bytes =
N_REC_CHANNELS * num_samples * sizeof(int16_t);
const unsigned int total_bytes = num_bytes;
- WebRtc_Word8* audio;
+ int8_t* audio;
{
CriticalSectionScoped lock(&crit_sect_);
@@ -1376,7 +1375,7 @@
}
}
- WebRtc_Word32 res = (*queue_itf)->Enqueue(queue_itf,
+ int32_t res = (*queue_itf)->Enqueue(queue_itf,
audio,
total_bytes);
if (res != SL_RESULT_SUCCESS) {
@@ -1402,7 +1401,7 @@
}
void AudioDeviceAndroidOpenSLES::UpdatePlayoutDelay(
- WebRtc_UWord32 nSamplePlayed) {
+ uint32_t nSamplePlayed) {
// TODO(leozwang): Add accurate delay estimat.
playout_delay_ = (N_PLAY_QUEUE_BUFFERS - 0.5) * 10 +
N_PLAY_QUEUE_BUFFERS * nSamplePlayed / (speaker_sampling_rate_ / 1000);
@@ -1411,12 +1410,12 @@
void AudioDeviceAndroidOpenSLES::UpdateRecordingDelay() {
// TODO(leozwang): Add accurate delay estimat.
recording_delay_ = 10;
- const WebRtc_UWord32 noSamp10ms = mic_sampling_rate_ / 100;
+ const uint32_t noSamp10ms = mic_sampling_rate_ / 100;
recording_delay_ += (N_REC_QUEUE_BUFFERS * noSamp10ms) /
(mic_sampling_rate_ / 1000);
}
-WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitSampleRate() {
+int32_t AudioDeviceAndroidOpenSLES::InitSampleRate() {
if (sles_engine_ == NULL) {
WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
" SL Object is NULL");
diff --git a/modules/audio_device/android/audio_device_opensles_android.h b/modules/audio_device/android/audio_device_opensles_android.h
index 2b2d746..578999f 100644
--- a/modules/audio_device/android/audio_device_opensles_android.h
+++ b/modules/audio_device/android/audio_device_opensles_android.h
@@ -28,30 +28,30 @@
class EventWrapper;
-const WebRtc_UWord32 N_MAX_INTERFACES = 3;
-const WebRtc_UWord32 N_MAX_OUTPUT_DEVICES = 6;
-const WebRtc_UWord32 N_MAX_INPUT_DEVICES = 3;
+const uint32_t N_MAX_INTERFACES = 3;
+const uint32_t N_MAX_OUTPUT_DEVICES = 6;
+const uint32_t N_MAX_INPUT_DEVICES = 3;
-const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default fs
-const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default fs
+const uint32_t N_REC_SAMPLES_PER_SEC = 16000; // Default fs
+const uint32_t N_PLAY_SAMPLES_PER_SEC = 16000; // Default fs
-const WebRtc_UWord32 N_REC_CHANNELS = 1;
-const WebRtc_UWord32 N_PLAY_CHANNELS = 1;
+const uint32_t N_REC_CHANNELS = 1;
+const uint32_t N_PLAY_CHANNELS = 1;
-const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480;
-const WebRtc_UWord32 PLAY_BUF_SIZE_IN_SAMPLES = 480;
+const uint32_t REC_BUF_SIZE_IN_SAMPLES = 480;
+const uint32_t PLAY_BUF_SIZE_IN_SAMPLES = 480;
-const WebRtc_UWord32 REC_MAX_TEMP_BUF_SIZE_PER_10ms =
+const uint32_t REC_MAX_TEMP_BUF_SIZE_PER_10ms =
N_REC_CHANNELS * REC_BUF_SIZE_IN_SAMPLES * sizeof(int16_t);
-const WebRtc_UWord32 PLAY_MAX_TEMP_BUF_SIZE_PER_10ms =
+const uint32_t PLAY_MAX_TEMP_BUF_SIZE_PER_10ms =
N_PLAY_CHANNELS * PLAY_BUF_SIZE_IN_SAMPLES * sizeof(int16_t);
// Number of the buffers in playout queue
-const WebRtc_UWord16 N_PLAY_QUEUE_BUFFERS = 8;
+const uint16_t N_PLAY_QUEUE_BUFFERS = 8;
// Number of buffers in recording queue
// TODO(xian): Reduce the numbers of buffers to improve the latency.
-const WebRtc_UWord16 N_REC_QUEUE_BUFFERS = 8;
+const uint16_t N_REC_QUEUE_BUFFERS = 8;
// Some values returned from getMinBufferSize
// (Nexus S playout 72ms, recording 64ms)
// (Galaxy, 167ms, 44ms)
@@ -62,137 +62,136 @@
class AudioDeviceAndroidOpenSLES: public AudioDeviceGeneric {
public:
- explicit AudioDeviceAndroidOpenSLES(const WebRtc_Word32 id);
+ explicit AudioDeviceAndroidOpenSLES(const int32_t id);
~AudioDeviceAndroidOpenSLES();
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32
+ virtual int32_t
ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const; // NOLINT
// 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
+ virtual int32_t SetPlayoutDevice(uint16_t index);
+ virtual int32_t
SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device);
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
- virtual WebRtc_Word32
+ virtual int32_t SetRecordingDevice(uint16_t index);
+ virtual int32_t
SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device);
// Audio transport initialization
- virtual WebRtc_Word32 PlayoutIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 InitPlayout();
+ virtual int32_t PlayoutIsAvailable(bool& available); // NOLINT
+ virtual int32_t InitPlayout();
virtual bool PlayoutIsInitialized() const;
- virtual WebRtc_Word32 RecordingIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 InitRecording();
+ virtual int32_t RecordingIsAvailable(bool& available); // NOLINT
+ 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, // NOLINT
- WebRtc_UWord16& volumeRight) const; // NOLINT
+ virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight);
+ virtual int32_t WaveOutVolume(
+ uint16_t& volumeLeft, // NOLINT
+ uint16_t& volumeRight) const; // NOLINT
// Audio mixer initialization
- virtual WebRtc_Word32 SpeakerIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 InitSpeaker();
+ virtual int32_t SpeakerIsAvailable(bool& available); // NOLINT
+ virtual int32_t InitSpeaker();
virtual bool SpeakerIsInitialized() const;
- virtual WebRtc_Word32 MicrophoneIsAvailable(
+ virtual int32_t MicrophoneIsAvailable(
bool& available);
- virtual WebRtc_Word32 InitMicrophone();
+ virtual int32_t InitMicrophone();
virtual bool MicrophoneIsInitialized() const;
// Speaker volume controls
- virtual WebRtc_Word32 SpeakerVolumeIsAvailable(
+ virtual int32_t SpeakerVolumeIsAvailable(
bool& available); // NOLINT
- virtual WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume);
- virtual WebRtc_Word32 SpeakerVolume(
- WebRtc_UWord32& volume) const; // NOLINT
- virtual WebRtc_Word32 MaxSpeakerVolume(
- WebRtc_UWord32& maxVolume) const; // NOLINT
- virtual WebRtc_Word32 MinSpeakerVolume(
- WebRtc_UWord32& minVolume) const; // NOLINT
- virtual WebRtc_Word32 SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const; // NOLINT
+ virtual int32_t SetSpeakerVolume(uint32_t volume);
+ virtual int32_t SpeakerVolume(
+ uint32_t& volume) const; // NOLINT
+ virtual int32_t MaxSpeakerVolume(
+ uint32_t& maxVolume) const; // NOLINT
+ virtual int32_t MinSpeakerVolume(
+ uint32_t& minVolume) const; // NOLINT
+ virtual int32_t SpeakerVolumeStepSize(
+ uint16_t& stepSize) const; // NOLINT
// Microphone volume controls
- virtual WebRtc_Word32 MicrophoneVolumeIsAvailable(
+ virtual int32_t MicrophoneVolumeIsAvailable(
bool& available); // NOLINT
- virtual WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume);
- virtual WebRtc_Word32 MicrophoneVolume(
- WebRtc_UWord32& volume) const; // NOLINT
- virtual WebRtc_Word32 MaxMicrophoneVolume(
- WebRtc_UWord32& maxVolume) const; // NOLINT
- virtual WebRtc_Word32 MinMicrophoneVolume(
- WebRtc_UWord32& minVolume) const; // NOLINT
- virtual WebRtc_Word32
- MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const; // NOLINT
+ virtual int32_t SetMicrophoneVolume(uint32_t volume);
+ virtual int32_t MicrophoneVolume(
+ uint32_t& volume) const; // NOLINT
+ virtual int32_t MaxMicrophoneVolume(
+ uint32_t& maxVolume) const; // NOLINT
+ virtual int32_t MinMicrophoneVolume(
+ uint32_t& minVolume) const; // NOLINT
+ virtual int32_t
+ MicrophoneVolumeStepSize(uint16_t& stepSize) const; // NOLINT
// Speaker mute control
- virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 SetSpeakerMute(bool enable);
- virtual WebRtc_Word32 SpeakerMute(bool& enabled) const; // NOLINT
+ virtual int32_t SpeakerMuteIsAvailable(bool& available); // NOLINT
+ virtual int32_t SetSpeakerMute(bool enable);
+ virtual int32_t SpeakerMute(bool& enabled) const; // NOLINT
// Microphone mute control
- virtual WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 SetMicrophoneMute(bool enable);
- virtual WebRtc_Word32 MicrophoneMute(bool& enabled) const; // NOLINT
+ virtual int32_t MicrophoneMuteIsAvailable(bool& available); // NOLINT
+ virtual int32_t SetMicrophoneMute(bool enable);
+ virtual int32_t MicrophoneMute(bool& enabled) const; // NOLINT
// Microphone boost control
- virtual WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 SetMicrophoneBoost(bool enable);
- virtual WebRtc_Word32 MicrophoneBoost(bool& enabled) const; // NOLINT
+ virtual int32_t MicrophoneBoostIsAvailable(bool& available); // NOLINT
+ virtual int32_t SetMicrophoneBoost(bool enable);
+ virtual int32_t MicrophoneBoost(bool& enabled) const; // NOLINT
// Stereo support
- virtual WebRtc_Word32 StereoPlayoutIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 SetStereoPlayout(bool enable);
- virtual WebRtc_Word32 StereoPlayout(bool& enabled) const; // NOLINT
- virtual WebRtc_Word32 StereoRecordingIsAvailable(bool& available); // NOLINT
- virtual WebRtc_Word32 SetStereoRecording(bool enable);
- virtual WebRtc_Word32 StereoRecording(bool& enabled) const; // NOLINT
+ virtual int32_t StereoPlayoutIsAvailable(bool& available); // NOLINT
+ virtual int32_t SetStereoPlayout(bool enable);
+ virtual int32_t StereoPlayout(bool& enabled) const; // NOLINT
+ virtual int32_t StereoRecordingIsAvailable(bool& available); // NOLINT
+ virtual int32_t SetStereoRecording(bool enable);
+ virtual int32_t StereoRecording(bool& enabled) const; // NOLINT
// Delay information and control
- virtual WebRtc_Word32
+ 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, // NOLINT
- WebRtc_UWord16& sizeMS) const;
- virtual WebRtc_Word32 PlayoutDelay(
- WebRtc_UWord16& delayMS) const; // NOLINT
- virtual WebRtc_Word32 RecordingDelay(
- WebRtc_UWord16& delayMS) const; // NOLINT
+ uint16_t& sizeMS) const;
+ virtual int32_t PlayoutDelay(
+ uint16_t& delayMS) const; // NOLINT
+ virtual int32_t RecordingDelay(
+ uint16_t& delayMS) const; // NOLINT
// CPU load
- virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const; // NOLINT
+ virtual int32_t CPULoad(uint16_t& load) const; // NOLINT
// Error and warning information
virtual bool PlayoutWarning() const;
@@ -208,8 +207,8 @@
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer);
// Speaker audio routing
- virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable);
- virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enable) const; // NOLINT
+ virtual int32_t SetLoudspeakerStatus(bool enable);
+ virtual int32_t GetLoudspeakerStatus(bool& enable) const; // NOLINT
private:
// Lock
@@ -234,15 +233,15 @@
// Delay updates
void UpdateRecordingDelay();
- void UpdatePlayoutDelay(WebRtc_UWord32 nSamplePlayed);
+ void UpdatePlayoutDelay(uint32_t nSamplePlayed);
// Init
- WebRtc_Word32 InitSampleRate();
+ int32_t InitSampleRate();
// Misc
AudioDeviceBuffer* voe_audio_buffer_;
CriticalSectionWrapper& crit_sect_;
- WebRtc_Word32 id_;
+ int32_t id_;
// audio unit
SLObjectItf sles_engine_;
@@ -260,10 +259,10 @@
SLRecordItf sles_recorder_itf_;
SLAndroidSimpleBufferQueueItf sles_recorder_sbq_itf_;
SLDeviceVolumeItf sles_mic_volume_;
- WebRtc_UWord32 mic_dev_id_;
+ uint32_t mic_dev_id_;
- WebRtc_UWord32 play_warning_, play_error_;
- WebRtc_UWord32 rec_warning_, rec_error_;
+ uint32_t play_warning_, play_error_;
+ uint32_t rec_warning_, rec_error_;
// States
bool is_recording_dev_specified_;
@@ -277,38 +276,38 @@
bool is_speaker_initialized_;
// Delay
- WebRtc_UWord16 playout_delay_;
- WebRtc_UWord16 recording_delay_;
+ uint16_t playout_delay_;
+ uint16_t recording_delay_;
// AGC state
bool agc_enabled_;
// Threads
ThreadWrapper* rec_thread_;
- WebRtc_UWord32 rec_thread_id_;
+ uint32_t rec_thread_id_;
static bool RecThreadFunc(void* context);
bool RecThreadFuncImpl();
EventWrapper& rec_timer_;
- WebRtc_UWord32 mic_sampling_rate_;
- WebRtc_UWord32 speaker_sampling_rate_;
- WebRtc_UWord32 max_speaker_vol_;
- WebRtc_UWord32 min_speaker_vol_;
+ uint32_t mic_sampling_rate_;
+ uint32_t speaker_sampling_rate_;
+ uint32_t max_speaker_vol_;
+ uint32_t min_speaker_vol_;
bool loundspeaker_on_;
SLDataFormat_PCM player_pcm_;
SLDataFormat_PCM record_pcm_;
- std::queue<WebRtc_Word8*> rec_queue_;
- std::queue<WebRtc_Word8*> rec_voe_audio_queue_;
- std::queue<WebRtc_Word8*> rec_voe_ready_queue_;
- WebRtc_Word8 rec_buf_[N_REC_QUEUE_BUFFERS][
+ std::queue<int8_t*> rec_queue_;
+ std::queue<int8_t*> rec_voe_audio_queue_;
+ std::queue<int8_t*> rec_voe_ready_queue_;
+ int8_t rec_buf_[N_REC_QUEUE_BUFFERS][
N_REC_CHANNELS * sizeof(int16_t) * REC_BUF_SIZE_IN_SAMPLES];
- WebRtc_Word8 rec_voe_buf_[N_REC_QUEUE_BUFFERS][
+ int8_t rec_voe_buf_[N_REC_QUEUE_BUFFERS][
N_REC_CHANNELS * sizeof(int16_t) * REC_BUF_SIZE_IN_SAMPLES];
- std::queue<WebRtc_Word8*> play_queue_;
- WebRtc_Word8 play_buf_[N_PLAY_QUEUE_BUFFERS][
+ std::queue<int8_t*> play_queue_;
+ int8_t play_buf_[N_PLAY_QUEUE_BUFFERS][
N_PLAY_CHANNELS * sizeof(int16_t) * PLAY_BUF_SIZE_IN_SAMPLES];
};
diff --git a/modules/audio_device/android/audio_device_utility_android.cc b/modules/audio_device/android/audio_device_utility_android.cc
index ccb15d3..20d0290 100644
--- a/modules/audio_device/android/audio_device_utility_android.cc
+++ b/modules/audio_device/android/audio_device_utility_android.cc
@@ -20,7 +20,7 @@
namespace webrtc
{
-AudioDeviceUtilityAndroid::AudioDeviceUtilityAndroid(const WebRtc_Word32 id) :
+AudioDeviceUtilityAndroid::AudioDeviceUtilityAndroid(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id),
_lastError(AudioDeviceModule::kAdmErrNone)
{
@@ -39,7 +39,7 @@
delete &_critSect;
}
-WebRtc_Word32 AudioDeviceUtilityAndroid::Init()
+int32_t AudioDeviceUtilityAndroid::Init()
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
diff --git a/modules/audio_device/android/audio_device_utility_android.h b/modules/audio_device/android/audio_device_utility_android.h
index 81f685a..a86896d 100644
--- a/modules/audio_device/android/audio_device_utility_android.h
+++ b/modules/audio_device/android/audio_device_utility_android.h
@@ -25,14 +25,14 @@
class AudioDeviceUtilityAndroid: public AudioDeviceUtility
{
public:
- AudioDeviceUtilityAndroid(const WebRtc_Word32 id);
+ AudioDeviceUtilityAndroid(const int32_t id);
~AudioDeviceUtilityAndroid();
- virtual WebRtc_Word32 Init();
+ virtual int32_t Init();
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioDeviceModule::ErrorCode _lastError;
};
diff --git a/modules/audio_device/audio_device_buffer.cc b/modules/audio_device/audio_device_buffer.cc
index 9aa01a6..ff9fd93 100644
--- a/modules/audio_device/audio_device_buffer.cc
+++ b/modules/audio_device/audio_device_buffer.cc
@@ -88,7 +88,7 @@
// SetId
// ----------------------------------------------------------------------------
-void AudioDeviceBuffer::SetId(WebRtc_UWord32 id)
+void AudioDeviceBuffer::SetId(uint32_t id)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, "AudioDeviceBuffer::SetId(id=%d)", id);
_id = id;
@@ -98,7 +98,7 @@
// RegisterAudioCallback
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::RegisterAudioCallback(AudioTransport* audioCallback)
+int32_t AudioDeviceBuffer::RegisterAudioCallback(AudioTransport* audioCallback)
{
CriticalSectionScoped lock(&_critSectCb);
_ptrCbAudioTransport = audioCallback;
@@ -110,7 +110,7 @@
// InitPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::InitPlayout()
+int32_t AudioDeviceBuffer::InitPlayout()
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -129,7 +129,7 @@
// InitRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::InitRecording()
+int32_t AudioDeviceBuffer::InitRecording()
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -148,7 +148,7 @@
// SetRecordingSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetRecordingSampleRate(WebRtc_UWord32 fsHz)
+int32_t AudioDeviceBuffer::SetRecordingSampleRate(uint32_t fsHz)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "AudioDeviceBuffer::SetRecordingSampleRate(fsHz=%u)", fsHz);
@@ -161,7 +161,7 @@
// SetPlayoutSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetPlayoutSampleRate(WebRtc_UWord32 fsHz)
+int32_t AudioDeviceBuffer::SetPlayoutSampleRate(uint32_t fsHz)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "AudioDeviceBuffer::SetPlayoutSampleRate(fsHz=%u)", fsHz);
@@ -174,7 +174,7 @@
// RecordingSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::RecordingSampleRate() const
+int32_t AudioDeviceBuffer::RecordingSampleRate() const
{
return _recSampleRate;
}
@@ -183,7 +183,7 @@
// PlayoutSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::PlayoutSampleRate() const
+int32_t AudioDeviceBuffer::PlayoutSampleRate() const
{
return _playSampleRate;
}
@@ -192,7 +192,7 @@
// SetRecordingChannels
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetRecordingChannels(WebRtc_UWord8 channels)
+int32_t AudioDeviceBuffer::SetRecordingChannels(uint8_t channels)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "AudioDeviceBuffer::SetRecordingChannels(channels=%u)", channels);
@@ -206,7 +206,7 @@
// SetPlayoutChannels
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetPlayoutChannels(WebRtc_UWord8 channels)
+int32_t AudioDeviceBuffer::SetPlayoutChannels(uint8_t channels)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "AudioDeviceBuffer::SetPlayoutChannels(channels=%u)", channels);
@@ -228,7 +228,7 @@
// will be 2 instead of 4 four these cases.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetRecordingChannel(const AudioDeviceModule::ChannelType channel)
+int32_t AudioDeviceBuffer::SetRecordingChannel(const AudioDeviceModule::ChannelType channel)
{
CriticalSectionScoped lock(&_critSect);
@@ -256,7 +256,7 @@
// RecordingChannel
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::RecordingChannel(AudioDeviceModule::ChannelType& channel) const
+int32_t AudioDeviceBuffer::RecordingChannel(AudioDeviceModule::ChannelType& channel) const
{
channel = _recChannel;
return 0;
@@ -266,7 +266,7 @@
// RecordingChannels
// ----------------------------------------------------------------------------
-WebRtc_UWord8 AudioDeviceBuffer::RecordingChannels() const
+uint8_t AudioDeviceBuffer::RecordingChannels() const
{
return _recChannels;
}
@@ -275,7 +275,7 @@
// PlayoutChannels
// ----------------------------------------------------------------------------
-WebRtc_UWord8 AudioDeviceBuffer::PlayoutChannels() const
+uint8_t AudioDeviceBuffer::PlayoutChannels() const
{
return _playChannels;
}
@@ -284,7 +284,7 @@
// SetCurrentMicLevel
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetCurrentMicLevel(WebRtc_UWord32 level)
+int32_t AudioDeviceBuffer::SetCurrentMicLevel(uint32_t level)
{
_currentMicLevel = level;
return 0;
@@ -294,7 +294,7 @@
// NewMicLevel
// ----------------------------------------------------------------------------
-WebRtc_UWord32 AudioDeviceBuffer::NewMicLevel() const
+uint32_t AudioDeviceBuffer::NewMicLevel() const
{
return _newMicLevel;
}
@@ -303,7 +303,7 @@
// SetVQEData
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetVQEData(WebRtc_UWord32 playDelayMS, WebRtc_UWord32 recDelayMS, WebRtc_Word32 clockDrift)
+int32_t AudioDeviceBuffer::SetVQEData(uint32_t playDelayMS, uint32_t recDelayMS, int32_t clockDrift)
{
if ((playDelayMS + recDelayMS) > 300)
{
@@ -321,7 +321,7 @@
// StartInputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::StartInputFileRecording(
+int32_t AudioDeviceBuffer::StartInputFileRecording(
const char fileName[kAdmMaxFileNameSize])
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -338,7 +338,7 @@
// StopInputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::StopInputFileRecording()
+int32_t AudioDeviceBuffer::StopInputFileRecording()
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -354,7 +354,7 @@
// StartOutputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::StartOutputFileRecording(
+int32_t AudioDeviceBuffer::StartOutputFileRecording(
const char fileName[kAdmMaxFileNameSize])
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -371,7 +371,7 @@
// StopOutputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::StopOutputFileRecording()
+int32_t AudioDeviceBuffer::StopOutputFileRecording()
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -398,8 +398,8 @@
// 16-bit,48kHz stereo,10ms => nSamples=480 => _recSize=4*480=1920 bytes
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::SetRecordedBuffer(const void* audioBuffer,
- WebRtc_UWord32 nSamples)
+int32_t AudioDeviceBuffer::SetRecordedBuffer(const void* audioBuffer,
+ uint32_t nSamples)
{
CriticalSectionScoped lock(&_critSect);
@@ -430,8 +430,8 @@
}
else
{
- WebRtc_Word16* ptr16In = (WebRtc_Word16*)audioBuffer;
- WebRtc_Word16* ptr16Out = (WebRtc_Word16*)&_recBuffer[0];
+ int16_t* ptr16In = (int16_t*)audioBuffer;
+ int16_t* ptr16Out = (int16_t*)&_recBuffer[0];
if (AudioDeviceModule::kChannelRight == _recChannel)
{
@@ -439,7 +439,7 @@
}
// exctract left or right channel from input buffer to the local buffer
- for (WebRtc_UWord32 i = 0; i < _recSamples; i++)
+ for (uint32_t i = 0; i < _recSamples; i++)
{
*ptr16Out = *ptr16In;
ptr16Out++;
@@ -461,7 +461,7 @@
// DeliverRecordedData
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::DeliverRecordedData()
+int32_t AudioDeviceBuffer::DeliverRecordedData()
{
CriticalSectionScoped lock(&_critSectCb);
@@ -481,22 +481,22 @@
return 0;
}
- WebRtc_Word32 res(0);
- WebRtc_UWord32 newMicLevel(0);
- WebRtc_UWord32 totalDelayMS = _playDelayMS +_recDelayMS;
+ int32_t res(0);
+ uint32_t newMicLevel(0);
+ uint32_t totalDelayMS = _playDelayMS +_recDelayMS;
if (_measureDelay)
{
CriticalSectionScoped lock(&_critSect);
memset(&_recBuffer[0], 0, _recSize);
- WebRtc_UWord32 time = AudioDeviceUtility::GetTimeInMS();
+ uint32_t time = AudioDeviceUtility::GetTimeInMS();
if (time - _lastPulseTime > 500)
{
_pulseList.PushBack(time);
_lastPulseTime = time;
- WebRtc_Word16* ptr16 = (WebRtc_Word16*)&_recBuffer[0];
+ int16_t* ptr16 = (int16_t*)&_recBuffer[0];
*ptr16 = 30000;
}
}
@@ -522,11 +522,11 @@
// RequestPlayoutData
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::RequestPlayoutData(WebRtc_UWord32 nSamples)
+int32_t AudioDeviceBuffer::RequestPlayoutData(uint32_t nSamples)
{
- WebRtc_UWord32 playSampleRate = 0;
- WebRtc_UWord8 playBytesPerSample = 0;
- WebRtc_UWord8 playChannels = 0;
+ uint32_t playSampleRate = 0;
+ uint8_t playBytesPerSample = 0;
+ uint8_t playChannels = 0;
{
CriticalSectionScoped lock(&_critSect);
@@ -560,7 +560,7 @@
}
}
- WebRtc_UWord32 nSamplesOut(0);
+ uint32_t nSamplesOut(0);
CriticalSectionScoped lock(&_critSectCb);
@@ -572,7 +572,7 @@
if (_ptrCbAudioTransport)
{
- WebRtc_UWord32 res(0);
+ uint32_t res(0);
res = _ptrCbAudioTransport->NeedMorePlayData(_playSamples,
playBytesPerSample,
@@ -592,19 +592,19 @@
{
CriticalSectionScoped lock(&_critSect);
- WebRtc_Word16 maxAbs = WebRtcSpl_MaxAbsValueW16((const WebRtc_Word16*)&_playBuffer[0], (WebRtc_Word16)nSamplesOut*_playChannels);
+ int16_t maxAbs = WebRtcSpl_MaxAbsValueW16((const int16_t*)&_playBuffer[0], (int16_t)nSamplesOut*_playChannels);
if (maxAbs > 1000)
{
- WebRtc_UWord32 nowTime = AudioDeviceUtility::GetTimeInMS();
+ uint32_t nowTime = AudioDeviceUtility::GetTimeInMS();
if (!_pulseList.Empty())
{
ListItem* item = _pulseList.First();
if (item)
{
- WebRtc_Word16 maxIndex = WebRtcSpl_MaxAbsIndexW16((const WebRtc_Word16*)&_playBuffer[0], (WebRtc_Word16)nSamplesOut*_playChannels);
- WebRtc_UWord32 pulseTime = item->GetUnsignedItem();
- WebRtc_UWord32 diff = nowTime - pulseTime + (10*maxIndex)/(nSamplesOut*_playChannels);
+ int16_t maxIndex = WebRtcSpl_MaxAbsIndexW16((const int16_t*)&_playBuffer[0], (int16_t)nSamplesOut*_playChannels);
+ uint32_t pulseTime = item->GetUnsignedItem();
+ uint32_t diff = nowTime - pulseTime + (10*maxIndex)/(nSamplesOut*_playChannels);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "diff time in playout delay (%d)", diff);
}
_pulseList.PopFront();
@@ -620,7 +620,7 @@
// GetPlayoutData
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceBuffer::GetPlayoutData(void* audioBuffer)
+int32_t AudioDeviceBuffer::GetPlayoutData(void* audioBuffer)
{
CriticalSectionScoped lock(&_critSect);
@@ -654,7 +654,7 @@
ListItem* item = _pulseList.First();
if (item)
{
- // WebRtc_UWord32 ts = item->GetUnsignedItem();
+ // uint32_t ts = item->GetUnsignedItem();
}
_pulseList.PopFront();
}
diff --git a/modules/audio_device/audio_device_buffer.h b/modules/audio_device/audio_device_buffer.h
index b7c4fc8..25bb9bd 100644
--- a/modules/audio_device/audio_device_buffer.h
+++ b/modules/audio_device/audio_device_buffer.h
@@ -20,8 +20,8 @@
namespace webrtc {
class CriticalSectionWrapper;
-const WebRtc_UWord32 kPulsePeriodMs = 1000;
-const WebRtc_UWord32 kMaxBufferSizeBytes = 3840; // 10ms in stereo @ 96kHz
+const uint32_t kPulsePeriodMs = 1000;
+const uint32_t kMaxBufferSizeBytes = 3840; // 10ms in stereo @ 96kHz
class AudioDeviceObserver;
class MediaFile;
@@ -29,44 +29,43 @@
class AudioDeviceBuffer
{
public:
- void SetId(WebRtc_UWord32 id);
- WebRtc_Word32 RegisterAudioCallback(AudioTransport* audioCallback);
+ void SetId(uint32_t id);
+ int32_t RegisterAudioCallback(AudioTransport* audioCallback);
- WebRtc_Word32 InitPlayout();
- WebRtc_Word32 InitRecording();
+ int32_t InitPlayout();
+ int32_t InitRecording();
- WebRtc_Word32 SetRecordingSampleRate(WebRtc_UWord32 fsHz);
- WebRtc_Word32 SetPlayoutSampleRate(WebRtc_UWord32 fsHz);
- WebRtc_Word32 RecordingSampleRate() const;
- WebRtc_Word32 PlayoutSampleRate() const;
+ int32_t SetRecordingSampleRate(uint32_t fsHz);
+ int32_t SetPlayoutSampleRate(uint32_t fsHz);
+ int32_t RecordingSampleRate() const;
+ int32_t PlayoutSampleRate() const;
- WebRtc_Word32 SetRecordingChannels(WebRtc_UWord8 channels);
- WebRtc_Word32 SetPlayoutChannels(WebRtc_UWord8 channels);
- WebRtc_UWord8 RecordingChannels() const;
- WebRtc_UWord8 PlayoutChannels() const;
- WebRtc_Word32 SetRecordingChannel(
+ int32_t SetRecordingChannels(uint8_t channels);
+ int32_t SetPlayoutChannels(uint8_t channels);
+ uint8_t RecordingChannels() const;
+ uint8_t PlayoutChannels() const;
+ int32_t SetRecordingChannel(
const AudioDeviceModule::ChannelType channel);
- WebRtc_Word32 RecordingChannel(
+ int32_t RecordingChannel(
AudioDeviceModule::ChannelType& channel) const;
- WebRtc_Word32 SetRecordedBuffer(const void* audioBuffer,
- WebRtc_UWord32 nSamples);
- WebRtc_Word32 SetCurrentMicLevel(WebRtc_UWord32 level);
- WebRtc_Word32 SetVQEData(WebRtc_UWord32 playDelayMS,
- WebRtc_UWord32 recDelayMS,
- WebRtc_Word32 clockDrift);
- WebRtc_Word32 DeliverRecordedData();
- WebRtc_UWord32 NewMicLevel() const;
+ int32_t SetRecordedBuffer(const void* audioBuffer, uint32_t nSamples);
+ int32_t SetCurrentMicLevel(uint32_t level);
+ int32_t SetVQEData(uint32_t playDelayMS,
+ uint32_t recDelayMS,
+ int32_t clockDrift);
+ int32_t DeliverRecordedData();
+ uint32_t NewMicLevel() const;
- WebRtc_Word32 RequestPlayoutData(WebRtc_UWord32 nSamples);
- WebRtc_Word32 GetPlayoutData(void* audioBuffer);
+ int32_t RequestPlayoutData(uint32_t nSamples);
+ int32_t GetPlayoutData(void* audioBuffer);
- WebRtc_Word32 StartInputFileRecording(
+ int32_t StartInputFileRecording(
const char fileName[kAdmMaxFileNameSize]);
- WebRtc_Word32 StopInputFileRecording();
- WebRtc_Word32 StartOutputFileRecording(
+ int32_t StopInputFileRecording();
+ int32_t StartOutputFileRecording(
const char fileName[kAdmMaxFileNameSize]);
- WebRtc_Word32 StopOutputFileRecording();
+ int32_t StopOutputFileRecording();
AudioDeviceBuffer();
~AudioDeviceBuffer();
@@ -75,53 +74,53 @@
void _EmptyList();
private:
- WebRtc_Word32 _id;
+ int32_t _id;
CriticalSectionWrapper& _critSect;
CriticalSectionWrapper& _critSectCb;
AudioTransport* _ptrCbAudioTransport;
- WebRtc_UWord32 _recSampleRate;
- WebRtc_UWord32 _playSampleRate;
+ uint32_t _recSampleRate;
+ uint32_t _playSampleRate;
- WebRtc_UWord8 _recChannels;
- WebRtc_UWord8 _playChannels;
+ uint8_t _recChannels;
+ uint8_t _playChannels;
// selected recording channel (left/right/both)
AudioDeviceModule::ChannelType _recChannel;
// 2 or 4 depending on mono or stereo
- WebRtc_UWord8 _recBytesPerSample;
- WebRtc_UWord8 _playBytesPerSample;
+ uint8_t _recBytesPerSample;
+ uint8_t _playBytesPerSample;
// 10ms in stereo @ 96kHz
int8_t _recBuffer[kMaxBufferSizeBytes];
// one sample <=> 2 or 4 bytes
- WebRtc_UWord32 _recSamples;
- WebRtc_UWord32 _recSize; // in bytes
+ uint32_t _recSamples;
+ uint32_t _recSize; // in bytes
// 10ms in stereo @ 96kHz
int8_t _playBuffer[kMaxBufferSizeBytes];
// one sample <=> 2 or 4 bytes
- WebRtc_UWord32 _playSamples;
- WebRtc_UWord32 _playSize; // in bytes
+ uint32_t _playSamples;
+ uint32_t _playSize; // in bytes
FileWrapper& _recFile;
FileWrapper& _playFile;
- WebRtc_UWord32 _currentMicLevel;
- WebRtc_UWord32 _newMicLevel;
+ uint32_t _currentMicLevel;
+ uint32_t _newMicLevel;
- WebRtc_UWord32 _playDelayMS;
- WebRtc_UWord32 _recDelayMS;
+ uint32_t _playDelayMS;
+ uint32_t _recDelayMS;
- WebRtc_Word32 _clockDrift;
+ int32_t _clockDrift;
bool _measureDelay;
ListWrapper _pulseList;
- WebRtc_UWord32 _lastPulseTime;
+ uint32_t _lastPulseTime;
};
} // namespace webrtc
diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc
index 7093d80..27ea604 100644
--- a/modules/audio_device/audio_device_generic.cc
+++ b/modules/audio_device/audio_device_generic.cc
@@ -13,44 +13,44 @@
namespace webrtc {
-WebRtc_Word32 AudioDeviceGeneric::SetRecordingSampleRate(
- const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceGeneric::SetRecordingSampleRate(
+ const uint32_t samplesPerSec)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"Set recording sample rate not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceGeneric::SetPlayoutSampleRate(
- const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceGeneric::SetPlayoutSampleRate(
+ const uint32_t samplesPerSec)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"Set playout sample rate not supported on this platform");
return -1;
}
-
-WebRtc_Word32 AudioDeviceGeneric::SetLoudspeakerStatus(bool enable)
+
+int32_t AudioDeviceGeneric::SetLoudspeakerStatus(bool enable)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"Set loudspeaker status not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceGeneric::GetLoudspeakerStatus(bool& enable) const
+int32_t AudioDeviceGeneric::GetLoudspeakerStatus(bool& enable) const
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"Get loudspeaker status not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceGeneric::ResetAudioDevice()
+int32_t AudioDeviceGeneric::ResetAudioDevice()
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"Reset audio device not supported on this platform");
return -1;
}
-WebRtc_Word32 AudioDeviceGeneric::SoundDeviceControl(unsigned int par1,
+int32_t AudioDeviceGeneric::SoundDeviceControl(unsigned int par1,
unsigned int par2, unsigned int par3, unsigned int par4)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
diff --git a/modules/audio_device/audio_device_generic.h b/modules/audio_device/audio_device_generic.h
index 0c14448..0136790 100644
--- a/modules/audio_device/audio_device_generic.h
+++ b/modules/audio_device/audio_device_generic.h
@@ -21,141 +21,141 @@
public:
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32 ActiveAudioLayer(
+ virtual int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const = 0;
// Main initializaton and termination
- virtual WebRtc_Word32 Init() = 0;
- virtual WebRtc_Word32 Terminate() = 0;
+ virtual int32_t Init() = 0;
+ virtual int32_t Terminate() = 0;
virtual bool Initialized() const = 0;
// Device enumeration
- virtual WebRtc_Word16 PlayoutDevices() = 0;
- virtual WebRtc_Word16 RecordingDevices() = 0;
- virtual WebRtc_Word32 PlayoutDeviceName(
- WebRtc_UWord16 index,
+ virtual int16_t PlayoutDevices() = 0;
+ virtual int16_t RecordingDevices() = 0;
+ virtual int32_t PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) = 0;
- virtual WebRtc_Word32 RecordingDeviceName(
- WebRtc_UWord16 index,
+ virtual int32_t RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) = 0;
// Device selection
- virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index) = 0;
- virtual WebRtc_Word32 SetPlayoutDevice(
+ virtual int32_t SetPlayoutDevice(uint16_t index) = 0;
+ virtual int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device) = 0;
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index) = 0;
- virtual WebRtc_Word32 SetRecordingDevice(
+ virtual int32_t SetRecordingDevice(uint16_t index) = 0;
+ virtual int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) = 0;
// Audio transport initialization
- virtual WebRtc_Word32 PlayoutIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 InitPlayout() = 0;
+ virtual int32_t PlayoutIsAvailable(bool& available) = 0;
+ virtual int32_t InitPlayout() = 0;
virtual bool PlayoutIsInitialized() const = 0;
- virtual WebRtc_Word32 RecordingIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 InitRecording() = 0;
+ virtual int32_t RecordingIsAvailable(bool& available) = 0;
+ virtual int32_t InitRecording() = 0;
virtual bool RecordingIsInitialized() const = 0;
// Audio transport control
- virtual WebRtc_Word32 StartPlayout() = 0;
- virtual WebRtc_Word32 StopPlayout() = 0;
+ virtual int32_t StartPlayout() = 0;
+ virtual int32_t StopPlayout() = 0;
virtual bool Playing() const = 0;
- virtual WebRtc_Word32 StartRecording() = 0;
- virtual WebRtc_Word32 StopRecording() = 0;
+ virtual int32_t StartRecording() = 0;
+ virtual int32_t StopRecording() = 0;
virtual bool Recording() const = 0;
// Microphone Automatic Gain Control (AGC)
- virtual WebRtc_Word32 SetAGC(bool enable) = 0;
+ virtual int32_t SetAGC(bool enable) = 0;
virtual bool AGC() const = 0;
// Volume control based on the Windows Wave API (Windows only)
- virtual WebRtc_Word32 SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
- WebRtc_UWord16 volumeRight) = 0;
- virtual WebRtc_Word32 WaveOutVolume(WebRtc_UWord16& volumeLeft,
- WebRtc_UWord16& volumeRight) const = 0;
+ virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
+ uint16_t volumeRight) = 0;
+ virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
+ uint16_t& volumeRight) const = 0;
// Audio mixer initialization
- virtual WebRtc_Word32 SpeakerIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 InitSpeaker() = 0;
+ virtual int32_t SpeakerIsAvailable(bool& available) = 0;
+ virtual int32_t InitSpeaker() = 0;
virtual bool SpeakerIsInitialized() const = 0;
- virtual WebRtc_Word32 MicrophoneIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 InitMicrophone() = 0;
+ virtual int32_t MicrophoneIsAvailable(bool& available) = 0;
+ virtual int32_t InitMicrophone() = 0;
virtual bool MicrophoneIsInitialized() const = 0;
// Speaker volume controls
- virtual WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume) = 0;
- virtual WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const = 0;
- virtual WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const = 0;
- virtual WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const = 0;
- virtual WebRtc_Word32 SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const = 0;
+ virtual int32_t SpeakerVolumeIsAvailable(bool& available) = 0;
+ virtual int32_t SetSpeakerVolume(uint32_t volume) = 0;
+ virtual int32_t SpeakerVolume(uint32_t& volume) const = 0;
+ virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const = 0;
+ virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const = 0;
+ virtual int32_t SpeakerVolumeStepSize(
+ uint16_t& stepSize) const = 0;
// Microphone volume controls
- virtual WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume) = 0;
- virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const = 0;
- virtual WebRtc_Word32 MaxMicrophoneVolume(
- WebRtc_UWord32& maxVolume) const = 0;
- virtual WebRtc_Word32 MinMicrophoneVolume(
- WebRtc_UWord32& minVolume) const = 0;
- virtual WebRtc_Word32 MicrophoneVolumeStepSize(
- WebRtc_UWord16& stepSize) const = 0;
+ virtual int32_t MicrophoneVolumeIsAvailable(bool& available) = 0;
+ virtual int32_t SetMicrophoneVolume(uint32_t volume) = 0;
+ virtual int32_t MicrophoneVolume(uint32_t& volume) const = 0;
+ virtual int32_t MaxMicrophoneVolume(
+ uint32_t& maxVolume) const = 0;
+ virtual int32_t MinMicrophoneVolume(
+ uint32_t& minVolume) const = 0;
+ virtual int32_t MicrophoneVolumeStepSize(
+ uint16_t& stepSize) const = 0;
// Speaker mute control
- virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetSpeakerMute(bool enable) = 0;
- virtual WebRtc_Word32 SpeakerMute(bool& enabled) const = 0;
+ virtual int32_t SpeakerMuteIsAvailable(bool& available) = 0;
+ virtual int32_t SetSpeakerMute(bool enable) = 0;
+ virtual int32_t SpeakerMute(bool& enabled) const = 0;
// Microphone mute control
- virtual WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetMicrophoneMute(bool enable) = 0;
- virtual WebRtc_Word32 MicrophoneMute(bool& enabled) const = 0;
+ virtual int32_t MicrophoneMuteIsAvailable(bool& available) = 0;
+ virtual int32_t SetMicrophoneMute(bool enable) = 0;
+ virtual int32_t MicrophoneMute(bool& enabled) const = 0;
// Microphone boost control
- virtual WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetMicrophoneBoost(bool enable) = 0;
- virtual WebRtc_Word32 MicrophoneBoost(bool& enabled) const = 0;
+ virtual int32_t MicrophoneBoostIsAvailable(bool& available) = 0;
+ virtual int32_t SetMicrophoneBoost(bool enable) = 0;
+ virtual int32_t MicrophoneBoost(bool& enabled) const = 0;
// Stereo support
- virtual WebRtc_Word32 StereoPlayoutIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetStereoPlayout(bool enable) = 0;
- virtual WebRtc_Word32 StereoPlayout(bool& enabled) const = 0;
- virtual WebRtc_Word32 StereoRecordingIsAvailable(bool& available) = 0;
- virtual WebRtc_Word32 SetStereoRecording(bool enable) = 0;
- virtual WebRtc_Word32 StereoRecording(bool& enabled) const = 0;
+ virtual int32_t StereoPlayoutIsAvailable(bool& available) = 0;
+ virtual int32_t SetStereoPlayout(bool enable) = 0;
+ virtual int32_t StereoPlayout(bool& enabled) const = 0;
+ virtual int32_t StereoRecordingIsAvailable(bool& available) = 0;
+ virtual int32_t SetStereoRecording(bool enable) = 0;
+ virtual int32_t StereoRecording(bool& enabled) const = 0;
// Delay information and control
- virtual WebRtc_Word32 SetPlayoutBuffer(
+ virtual int32_t SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
- WebRtc_UWord16 sizeMS = 0) = 0;
- virtual WebRtc_Word32 PlayoutBuffer(
- AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const = 0;
- virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const = 0;
- virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const = 0;
+ uint16_t sizeMS = 0) = 0;
+ virtual int32_t PlayoutBuffer(
+ AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const = 0;
+ virtual int32_t PlayoutDelay(uint16_t& delayMS) const = 0;
+ virtual int32_t RecordingDelay(uint16_t& delayMS) const = 0;
// CPU load
- virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const = 0;
+ virtual int32_t CPULoad(uint16_t& load) const = 0;
// Native sample rate controls (samples/sec)
- virtual WebRtc_Word32 SetRecordingSampleRate(
- const WebRtc_UWord32 samplesPerSec);
- virtual WebRtc_Word32 SetPlayoutSampleRate(
- const WebRtc_UWord32 samplesPerSec);
+ virtual int32_t SetRecordingSampleRate(
+ const uint32_t samplesPerSec);
+ virtual int32_t SetPlayoutSampleRate(
+ const uint32_t samplesPerSec);
// Speaker audio routing (for mobile devices)
- virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable);
- virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enable) const;
+ virtual int32_t SetLoudspeakerStatus(bool enable);
+ virtual int32_t GetLoudspeakerStatus(bool& enable) const;
// Reset Audio Device (for mobile devices)
- virtual WebRtc_Word32 ResetAudioDevice();
+ virtual int32_t ResetAudioDevice();
// Sound Audio Device control (for WinCE only)
- virtual WebRtc_Word32 SoundDeviceControl(unsigned int par1 = 0,
- unsigned int par2 = 0,
- unsigned int par3 = 0,
- unsigned int par4 = 0);
+ virtual int32_t SoundDeviceControl(unsigned int par1 = 0,
+ unsigned int par2 = 0,
+ unsigned int par3 = 0,
+ unsigned int par4 = 0);
// Windows Core Audio only.
virtual int32_t EnableBuiltInAEC(bool enable);
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index c7c87e6..978a7b6 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -68,7 +68,7 @@
{
AudioDeviceModule* CreateAudioDeviceModule(
- WebRtc_Word32 id, AudioDeviceModule::AudioLayer audioLayer) {
+ int32_t id, AudioDeviceModule::AudioLayer audioLayer) {
return AudioDeviceModuleImpl::Create(id, audioLayer);
}
@@ -81,7 +81,7 @@
// AudioDeviceModule::Create()
// ----------------------------------------------------------------------------
-AudioDeviceModule* AudioDeviceModuleImpl::Create(const WebRtc_Word32 id,
+AudioDeviceModule* AudioDeviceModuleImpl::Create(const int32_t id,
const AudioLayer audioLayer)
{
@@ -124,7 +124,7 @@
// AudioDeviceModuleImpl - ctor
// ----------------------------------------------------------------------------
-AudioDeviceModuleImpl::AudioDeviceModuleImpl(const WebRtc_Word32 id, const AudioLayer audioLayer) :
+AudioDeviceModuleImpl::AudioDeviceModuleImpl(const int32_t id, const AudioLayer audioLayer) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_critSectEventCb(*CriticalSectionWrapper::CreateCriticalSection()),
_critSectAudioCb(*CriticalSectionWrapper::CreateCriticalSection()),
@@ -145,7 +145,7 @@
// CheckPlatform
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::CheckPlatform()
+int32_t AudioDeviceModuleImpl::CheckPlatform()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -188,7 +188,7 @@
// CreatePlatformSpecificObjects
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
+int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -420,7 +420,7 @@
// number of channels in this function call.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::AttachAudioBuffer()
+int32_t AudioDeviceModuleImpl::AttachAudioBuffer()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -462,7 +462,7 @@
// Module::ChangeUniqueId
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::ChangeUniqueId(const WebRtc_Word32 id)
+int32_t AudioDeviceModuleImpl::ChangeUniqueId(const int32_t id)
{
_id = id;
return 0;
@@ -475,10 +475,10 @@
// to call Process().
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::TimeUntilNextProcess()
+int32_t AudioDeviceModuleImpl::TimeUntilNextProcess()
{
- WebRtc_UWord32 now = AudioDeviceUtility::GetTimeInMS();
- WebRtc_Word32 deltaProcess = kAdmMaxIdleTimeProcess - (now - _lastProcessTime);
+ uint32_t now = AudioDeviceUtility::GetTimeInMS();
+ int32_t deltaProcess = kAdmMaxIdleTimeProcess - (now - _lastProcessTime);
return (deltaProcess);
}
@@ -489,7 +489,7 @@
// new reports exists.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::Process()
+int32_t AudioDeviceModuleImpl::Process()
{
_lastProcessTime = AudioDeviceUtility::GetTimeInMS();
@@ -553,7 +553,7 @@
// ActiveAudioLayer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const
+int32_t AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const
{
AudioLayer activeAudio;
@@ -598,7 +598,7 @@
// Init
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::Init()
+int32_t AudioDeviceModuleImpl::Init()
{
if (_initialized)
@@ -625,7 +625,7 @@
// Terminate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::Terminate()
+int32_t AudioDeviceModuleImpl::Terminate()
{
if (!_initialized)
@@ -655,7 +655,7 @@
// SpeakerIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::SpeakerIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -676,7 +676,7 @@
// InitSpeaker
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::InitSpeaker()
+int32_t AudioDeviceModuleImpl::InitSpeaker()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->InitSpeaker());
@@ -686,7 +686,7 @@
// MicrophoneIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::MicrophoneIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -707,7 +707,7 @@
// InitMicrophone
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::InitMicrophone()
+int32_t AudioDeviceModuleImpl::InitMicrophone()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->InitMicrophone());
@@ -717,7 +717,7 @@
// SpeakerVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -738,7 +738,7 @@
// SetSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetSpeakerVolume(volume));
@@ -748,11 +748,11 @@
// SpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerVolume(WebRtc_UWord32* volume) const
+int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const
{
CHECK_INITIALIZED();
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_ptrAudioDevice->SpeakerVolume(level) == -1)
{
@@ -769,7 +769,7 @@
// SetWaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetWaveOutVolume(WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight)
+int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetWaveOutVolume(volumeLeft, volumeRight));
@@ -779,12 +779,12 @@
// WaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::WaveOutVolume(WebRtc_UWord16* volumeLeft, WebRtc_UWord16* volumeRight) const
+int32_t AudioDeviceModuleImpl::WaveOutVolume(uint16_t* volumeLeft, uint16_t* volumeRight) const
{
CHECK_INITIALIZED();
- WebRtc_UWord16 volLeft(0);
- WebRtc_UWord16 volRight(0);
+ uint16_t volLeft(0);
+ uint16_t volRight(0);
if (_ptrAudioDevice->WaveOutVolume(volLeft, volRight) == -1)
{
@@ -832,11 +832,11 @@
// MaxSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MaxSpeakerVolume(WebRtc_UWord32* maxVolume) const
+int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const
{
CHECK_INITIALIZED();
- WebRtc_UWord32 maxVol(0);
+ uint32_t maxVol(0);
if (_ptrAudioDevice->MaxSpeakerVolume(maxVol) == -1)
{
@@ -853,11 +853,11 @@
// MinSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MinSpeakerVolume(WebRtc_UWord32* minVolume) const
+int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const
{
CHECK_INITIALIZED();
- WebRtc_UWord32 minVol(0);
+ uint32_t minVol(0);
if (_ptrAudioDevice->MinSpeakerVolume(minVol) == -1)
{
@@ -874,11 +874,11 @@
// SpeakerVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerVolumeStepSize(WebRtc_UWord16* stepSize) const
+int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const
{
CHECK_INITIALIZED();
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_ptrAudioDevice->SpeakerVolumeStepSize(delta) == -1)
{
@@ -896,7 +896,7 @@
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -917,7 +917,7 @@
// SetSpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetSpeakerMute(bool enable)
+int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetSpeakerMute(enable));
@@ -927,7 +927,7 @@
// SpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const
+int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const
{
CHECK_INITIALIZED();
@@ -948,7 +948,7 @@
// MicrophoneMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -969,7 +969,7 @@
// SetMicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetMicrophoneMute(bool enable)
+int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetMicrophoneMute(enable));
@@ -979,7 +979,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const
+int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const
{
CHECK_INITIALIZED();
@@ -1000,7 +1000,7 @@
// MicrophoneBoostIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -1021,7 +1021,7 @@
// SetMicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable)
+int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetMicrophoneBoost(enable));
@@ -1031,7 +1031,7 @@
// MicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const
+int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const
{
CHECK_INITIALIZED();
@@ -1052,7 +1052,7 @@
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -1073,7 +1073,7 @@
// SetMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetMicrophoneVolume(volume));
@@ -1083,12 +1083,12 @@
// MicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneVolume(WebRtc_UWord32* volume) const
+int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CHECK_INITIALIZED();
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_ptrAudioDevice->MicrophoneVolume(level) == -1)
{
@@ -1105,7 +1105,7 @@
// StereoRecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StereoRecordingIsAvailable(bool* available) const
+int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable(bool* available) const
{
CHECK_INITIALIZED();
@@ -1126,7 +1126,7 @@
// SetStereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetStereoRecording(bool enable)
+int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable)
{
CHECK_INITIALIZED();
@@ -1142,7 +1142,7 @@
return -1;
}
- WebRtc_Word8 nChannels(1);
+ int8_t nChannels(1);
if (enable)
{
nChannels = 2;
@@ -1156,7 +1156,7 @@
// StereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StereoRecording(bool* enabled) const
+int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const
{
CHECK_INITIALIZED();
@@ -1177,7 +1177,7 @@
// SetRecordingChannel
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel)
+int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel)
{
if (channel == kChannelBoth)
{
@@ -1205,7 +1205,7 @@
// RecordingChannel
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const
+int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const
{
CHECK_INITIALIZED();
@@ -1235,7 +1235,7 @@
// StereoPlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const
+int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const
{
CHECK_INITIALIZED();
@@ -1256,7 +1256,7 @@
// SetStereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetStereoPlayout(bool enable)
+int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable)
{
CHECK_INITIALIZED();
@@ -1272,7 +1272,7 @@
return -1;
}
- WebRtc_Word8 nChannels(1);
+ int8_t nChannels(1);
if (enable)
{
nChannels = 2;
@@ -1286,7 +1286,7 @@
// StereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const
+int32_t AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const
{
CHECK_INITIALIZED();
@@ -1307,7 +1307,7 @@
// SetAGC
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetAGC(bool enable)
+int32_t AudioDeviceModuleImpl::SetAGC(bool enable)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetAGC(enable));
@@ -1327,7 +1327,7 @@
// PlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -1348,7 +1348,7 @@
// RecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RecordingIsAvailable(bool* available)
+int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available)
{
CHECK_INITIALIZED();
@@ -1369,12 +1369,12 @@
// MaxMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MaxMicrophoneVolume(WebRtc_UWord32* maxVolume) const
+int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CHECK_INITIALIZED();
- WebRtc_UWord32 maxVol(0);
+ uint32_t maxVol(0);
if (_ptrAudioDevice->MaxMicrophoneVolume(maxVol) == -1)
{
@@ -1391,11 +1391,11 @@
// MinMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MinMicrophoneVolume(WebRtc_UWord32* minVolume) const
+int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const
{
CHECK_INITIALIZED();
- WebRtc_UWord32 minVol(0);
+ uint32_t minVol(0);
if (_ptrAudioDevice->MinMicrophoneVolume(minVol) == -1)
{
@@ -1412,11 +1412,11 @@
// MicrophoneVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::MicrophoneVolumeStepSize(WebRtc_UWord16* stepSize) const
+int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize(uint16_t* stepSize) const
{
CHECK_INITIALIZED();
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_ptrAudioDevice->MicrophoneVolumeStepSize(delta) == -1)
{
@@ -1433,21 +1433,21 @@
// PlayoutDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceModuleImpl::PlayoutDevices()
+int16_t AudioDeviceModuleImpl::PlayoutDevices()
{
CHECK_INITIALIZED();
- WebRtc_UWord16 nPlayoutDevices = _ptrAudioDevice->PlayoutDevices();
+ uint16_t nPlayoutDevices = _ptrAudioDevice->PlayoutDevices();
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: #playout devices=%d", nPlayoutDevices);
- return ((WebRtc_Word16)(nPlayoutDevices));
+ return ((int16_t)(nPlayoutDevices));
}
// ----------------------------------------------------------------------------
// SetPlayoutDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceModuleImpl::SetPlayoutDevice(uint16_t index)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetPlayoutDevice(index));
@@ -1457,7 +1457,7 @@
// SetPlayoutDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device)
+int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device)
{
if (device == kDefaultDevice)
{
@@ -1474,8 +1474,8 @@
// PlayoutDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceModuleImpl::PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
@@ -1508,8 +1508,8 @@
// RecordingDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceModuleImpl::RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
@@ -1542,22 +1542,22 @@
// RecordingDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceModuleImpl::RecordingDevices()
+int16_t AudioDeviceModuleImpl::RecordingDevices()
{
CHECK_INITIALIZED();
- WebRtc_UWord16 nRecordingDevices = _ptrAudioDevice->RecordingDevices();
+ uint16_t nRecordingDevices = _ptrAudioDevice->RecordingDevices();
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
"output: #recording devices=%d", nRecordingDevices);
- return ((WebRtc_Word16)nRecordingDevices);
+ return ((int16_t)nRecordingDevices);
}
// ----------------------------------------------------------------------------
// SetRecordingDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceModuleImpl::SetRecordingDevice(uint16_t index)
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetRecordingDevice(index));
@@ -1567,7 +1567,7 @@
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device)
+int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device)
{
if (device == kDefaultDevice)
{
@@ -1584,7 +1584,7 @@
// InitPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::InitPlayout()
+int32_t AudioDeviceModuleImpl::InitPlayout()
{
CHECK_INITIALIZED();
_audioDeviceBuffer.InitPlayout();
@@ -1595,7 +1595,7 @@
// InitRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::InitRecording()
+int32_t AudioDeviceModuleImpl::InitRecording()
{
CHECK_INITIALIZED();
_audioDeviceBuffer.InitRecording();
@@ -1626,7 +1626,7 @@
// StartPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StartPlayout()
+int32_t AudioDeviceModuleImpl::StartPlayout()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->StartPlayout());
@@ -1636,7 +1636,7 @@
// StopPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StopPlayout()
+int32_t AudioDeviceModuleImpl::StopPlayout()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->StopPlayout());
@@ -1656,7 +1656,7 @@
// StartRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StartRecording()
+int32_t AudioDeviceModuleImpl::StartRecording()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->StartRecording());
@@ -1665,7 +1665,7 @@
// StopRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StopRecording()
+int32_t AudioDeviceModuleImpl::StopRecording()
{
CHECK_INITIALIZED();
return (_ptrAudioDevice->StopRecording());
@@ -1685,7 +1685,7 @@
// RegisterEventObserver
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RegisterEventObserver(AudioDeviceObserver* eventCallback)
+int32_t AudioDeviceModuleImpl::RegisterEventObserver(AudioDeviceObserver* eventCallback)
{
CriticalSectionScoped lock(&_critSectEventCb);
@@ -1698,7 +1698,7 @@
// RegisterAudioCallback
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RegisterAudioCallback(AudioTransport* audioCallback)
+int32_t AudioDeviceModuleImpl::RegisterAudioCallback(AudioTransport* audioCallback)
{
CriticalSectionScoped lock(&_critSectAudioCb);
@@ -1711,7 +1711,7 @@
// StartRawInputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StartRawInputFileRecording(
+int32_t AudioDeviceModuleImpl::StartRawInputFileRecording(
const char pcmFileNameUTF8[kAdmMaxFileNameSize])
{
CHECK_INITIALIZED();
@@ -1728,7 +1728,7 @@
// StopRawInputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StopRawInputFileRecording()
+int32_t AudioDeviceModuleImpl::StopRawInputFileRecording()
{
CHECK_INITIALIZED();
@@ -1739,7 +1739,7 @@
// StartRawOutputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StartRawOutputFileRecording(
+int32_t AudioDeviceModuleImpl::StartRawOutputFileRecording(
const char pcmFileNameUTF8[kAdmMaxFileNameSize])
{
CHECK_INITIALIZED();
@@ -1756,7 +1756,7 @@
// StopRawOutputFileRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::StopRawOutputFileRecording()
+int32_t AudioDeviceModuleImpl::StopRawOutputFileRecording()
{
CHECK_INITIALIZED();
@@ -1769,7 +1769,7 @@
// SetPlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, WebRtc_UWord16 sizeMS)
+int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, uint16_t sizeMS)
{
CHECK_INITIALIZED();
@@ -1779,7 +1779,7 @@
return -1;
}
- WebRtc_Word32 ret(0);
+ int32_t ret(0);
if (kFixedBufferSize == type)
{
@@ -1802,12 +1802,12 @@
// PlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::PlayoutBuffer(BufferType* type, WebRtc_UWord16* sizeMS) const
+int32_t AudioDeviceModuleImpl::PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const
{
CHECK_INITIALIZED();
BufferType bufType;
- WebRtc_UWord16 size(0);
+ uint16_t size(0);
if (_ptrAudioDevice->PlayoutBuffer(bufType, size) == -1)
{
@@ -1826,12 +1826,12 @@
// PlayoutDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::PlayoutDelay(WebRtc_UWord16* delayMS) const
+int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CHECK_INITIALIZED();
- WebRtc_UWord16 delay(0);
+ uint16_t delay(0);
if (_ptrAudioDevice->PlayoutDelay(delay) == -1)
{
@@ -1849,12 +1849,12 @@
// RecordingDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RecordingDelay(WebRtc_UWord16* delayMS) const
+int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CHECK_INITIALIZED();
- WebRtc_UWord16 delay(0);
+ uint16_t delay(0);
if (_ptrAudioDevice->RecordingDelay(delay) == -1)
{
@@ -1872,11 +1872,11 @@
// CPULoad
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::CPULoad(WebRtc_UWord16* load) const
+int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const
{
CHECK_INITIALIZED();
- WebRtc_UWord16 cpuLoad(0);
+ uint16_t cpuLoad(0);
if (_ptrAudioDevice->CPULoad(cpuLoad) == -1)
{
@@ -1894,7 +1894,7 @@
// SetRecordingSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetRecordingSampleRate(const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceModuleImpl::SetRecordingSampleRate(const uint32_t samplesPerSec)
{
CHECK_INITIALIZED();
@@ -1910,11 +1910,11 @@
// RecordingSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::RecordingSampleRate(WebRtc_UWord32* samplesPerSec) const
+int32_t AudioDeviceModuleImpl::RecordingSampleRate(uint32_t* samplesPerSec) const
{
CHECK_INITIALIZED();
- WebRtc_Word32 sampleRate = _audioDeviceBuffer.RecordingSampleRate();
+ int32_t sampleRate = _audioDeviceBuffer.RecordingSampleRate();
if (sampleRate == -1)
{
@@ -1932,7 +1932,7 @@
// SetPlayoutSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetPlayoutSampleRate(const WebRtc_UWord32 samplesPerSec)
+int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate(const uint32_t samplesPerSec)
{
CHECK_INITIALIZED();
@@ -1948,11 +1948,11 @@
// PlayoutSampleRate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::PlayoutSampleRate(WebRtc_UWord32* samplesPerSec) const
+int32_t AudioDeviceModuleImpl::PlayoutSampleRate(uint32_t* samplesPerSec) const
{
CHECK_INITIALIZED();
- WebRtc_Word32 sampleRate = _audioDeviceBuffer.PlayoutSampleRate();
+ int32_t sampleRate = _audioDeviceBuffer.PlayoutSampleRate();
if (sampleRate == -1)
{
@@ -1970,7 +1970,7 @@
// ResetAudioDevice
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::ResetAudioDevice()
+int32_t AudioDeviceModuleImpl::ResetAudioDevice()
{
CHECK_INITIALIZED();
@@ -1987,7 +1987,7 @@
// SetLoudspeakerStatus
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable)
+int32_t AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable)
{
CHECK_INITIALIZED();
@@ -2003,7 +2003,7 @@
// GetLoudspeakerStatus
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const
+int32_t AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const
{
CHECK_INITIALIZED();
diff --git a/modules/audio_device/audio_device_impl.h b/modules/audio_device/audio_device_impl.h
index 91a8534..8cbfbf5 100644
--- a/modules/audio_device/audio_device_impl.h
+++ b/modules/audio_device/audio_device_impl.h
@@ -35,177 +35,176 @@
kPlatformIOS = 6
};
- WebRtc_Word32 CheckPlatform();
- WebRtc_Word32 CreatePlatformSpecificObjects();
- WebRtc_Word32 AttachAudioBuffer();
+ int32_t CheckPlatform();
+ int32_t CreatePlatformSpecificObjects();
+ int32_t AttachAudioBuffer();
- AudioDeviceModuleImpl(const WebRtc_Word32 id, const AudioLayer audioLayer);
+ AudioDeviceModuleImpl(const int32_t id, const AudioLayer audioLayer);
virtual ~AudioDeviceModuleImpl();
public: // RefCountedModule
- virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
- virtual WebRtc_Word32 TimeUntilNextProcess();
- virtual WebRtc_Word32 Process();
+ virtual int32_t ChangeUniqueId(const int32_t id);
+ virtual int32_t TimeUntilNextProcess();
+ virtual int32_t Process();
public:
// Factory methods (resource allocation/deallocation)
static AudioDeviceModule* Create(
- const WebRtc_Word32 id,
+ const int32_t id,
const AudioLayer audioLayer = kPlatformDefaultAudio);
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32 ActiveAudioLayer(AudioLayer* audioLayer) const;
+ virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const;
// Error handling
virtual ErrorCode LastError() const;
- virtual WebRtc_Word32 RegisterEventObserver(
+ virtual int32_t RegisterEventObserver(
AudioDeviceObserver* eventCallback);
// Full-duplex transportation of PCM audio
- virtual WebRtc_Word32 RegisterAudioCallback(
+ virtual int32_t RegisterAudioCallback(
AudioTransport* audioCallback);
// 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(WindowsDeviceType device);
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
- virtual WebRtc_Word32 SetRecordingDevice(WindowsDeviceType device);
+ virtual int32_t SetPlayoutDevice(uint16_t index);
+ virtual int32_t SetPlayoutDevice(WindowsDeviceType device);
+ virtual int32_t SetRecordingDevice(uint16_t index);
+ virtual int32_t SetRecordingDevice(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) const;
- virtual WebRtc_Word32 SetStereoPlayout(bool enable);
- virtual WebRtc_Word32 StereoPlayout(bool* enabled) const;
- virtual WebRtc_Word32 StereoRecordingIsAvailable(bool* available) const;
- virtual WebRtc_Word32 SetStereoRecording(bool enable);
- virtual WebRtc_Word32 StereoRecording(bool* enabled) const;
- virtual WebRtc_Word32 SetRecordingChannel(const ChannelType channel);
- virtual WebRtc_Word32 RecordingChannel(ChannelType* channel) const;
+ virtual int32_t StereoPlayoutIsAvailable(bool* available) const;
+ virtual int32_t SetStereoPlayout(bool enable);
+ virtual int32_t StereoPlayout(bool* enabled) const;
+ virtual int32_t StereoRecordingIsAvailable(bool* available) const;
+ virtual int32_t SetStereoRecording(bool enable);
+ virtual int32_t StereoRecording(bool* enabled) const;
+ virtual int32_t SetRecordingChannel(const ChannelType channel);
+ virtual int32_t RecordingChannel(ChannelType* channel) const;
// Delay information and control
- virtual WebRtc_Word32 SetPlayoutBuffer(const BufferType type,
- WebRtc_UWord16 sizeMS = 0);
- virtual WebRtc_Word32 PlayoutBuffer(BufferType* type,
- WebRtc_UWord16* sizeMS) const;
- virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16* delayMS) const;
- virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16* delayMS) const;
+ virtual int32_t SetPlayoutBuffer(const BufferType type,
+ uint16_t sizeMS = 0);
+ virtual int32_t PlayoutBuffer(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;
// Recording of raw PCM data
- virtual WebRtc_Word32 StartRawOutputFileRecording(
+ virtual int32_t StartRawOutputFileRecording(
const char pcmFileNameUTF8[kAdmMaxFileNameSize]);
- virtual WebRtc_Word32 StopRawOutputFileRecording();
- virtual WebRtc_Word32 StartRawInputFileRecording(
+ virtual int32_t StopRawOutputFileRecording();
+ virtual int32_t StartRawInputFileRecording(
const char pcmFileNameUTF8[kAdmMaxFileNameSize]);
- virtual WebRtc_Word32 StopRawInputFileRecording();
+ virtual int32_t StopRawInputFileRecording();
// Native sample rate controls (samples/sec)
- virtual WebRtc_Word32 SetRecordingSampleRate(
- const WebRtc_UWord32 samplesPerSec);
- virtual WebRtc_Word32 RecordingSampleRate(
- WebRtc_UWord32* samplesPerSec) const;
- virtual WebRtc_Word32 SetPlayoutSampleRate(
- const WebRtc_UWord32 samplesPerSec);
- virtual WebRtc_Word32 PlayoutSampleRate(
- WebRtc_UWord32* samplesPerSec) const;
+ virtual int32_t SetRecordingSampleRate(
+ const uint32_t samplesPerSec);
+ virtual int32_t RecordingSampleRate(
+ uint32_t* samplesPerSec) const;
+ virtual int32_t SetPlayoutSampleRate(
+ const uint32_t samplesPerSec);
+ virtual int32_t PlayoutSampleRate(
+ uint32_t* samplesPerSec) const;
// Mobile device specific functions
- virtual WebRtc_Word32 ResetAudioDevice();
- virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable);
- virtual WebRtc_Word32 GetLoudspeakerStatus(bool* enabled) const;
+ virtual int32_t ResetAudioDevice();
+ virtual int32_t SetLoudspeakerStatus(bool enable);
+ virtual int32_t GetLoudspeakerStatus(bool* enabled) const;
virtual int32_t EnableBuiltInAEC(bool enable);
virtual bool BuiltInAECIsEnabled() const;
public:
- WebRtc_Word32 Id() {return _id;}
+ int32_t Id() {return _id;}
private:
PlatformType Platform() const;
@@ -223,9 +222,9 @@
AudioDeviceBuffer _audioDeviceBuffer;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioLayer _platformAudioLayer;
- WebRtc_UWord32 _lastProcessTime;
+ uint32_t _lastProcessTime;
PlatformType _platformType;
bool _initialized;
mutable ErrorCode _lastError;
diff --git a/modules/audio_device/audio_device_utility.cc b/modules/audio_device/audio_device_utility.cc
index 203f09a..4284011 100644
--- a/modules/audio_device/audio_device_utility.cc
+++ b/modules/audio_device/audio_device_utility.cc
@@ -32,14 +32,14 @@
_getch();
}
-WebRtc_UWord32 AudioDeviceUtility::GetTimeInMS()
+uint32_t AudioDeviceUtility::GetTimeInMS()
{
return timeGetTime();
}
bool AudioDeviceUtility::StringCompare(
const char* str1 , const char* str2,
- const WebRtc_UWord32 length)
+ const uint32_t length)
{
return ((_strnicmp(str1, str2, length) == 0) ? true : false);
}
@@ -90,19 +90,19 @@
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
}
-WebRtc_UWord32 AudioDeviceUtility::GetTimeInMS()
+uint32_t AudioDeviceUtility::GetTimeInMS()
{
struct timeval tv;
struct timezone tz;
- WebRtc_UWord32 val;
+ uint32_t val;
gettimeofday(&tv, &tz);
- val = (WebRtc_UWord32)(tv.tv_sec*1000 + tv.tv_usec/1000);
+ val = (uint32_t)(tv.tv_sec*1000 + tv.tv_usec/1000);
return val;
}
bool AudioDeviceUtility::StringCompare(
- const char* str1 , const char* str2, const WebRtc_UWord32 length)
+ const char* str1 , const char* str2, const uint32_t length)
{
return (strncasecmp(str1, str2, length) == 0)?true: false;
}
diff --git a/modules/audio_device/audio_device_utility.h b/modules/audio_device/audio_device_utility.h
index 293557e..10efbbc 100644
--- a/modules/audio_device/audio_device_utility.h
+++ b/modules/audio_device/audio_device_utility.h
@@ -19,12 +19,12 @@
class AudioDeviceUtility
{
public:
- static WebRtc_UWord32 GetTimeInMS();
+ static uint32_t GetTimeInMS();
static void WaitForKey();
static bool StringCompare(const char* str1,
const char* str2,
- const WebRtc_UWord32 length);
- virtual WebRtc_Word32 Init() = 0;
+ const uint32_t length);
+ virtual int32_t Init() = 0;
virtual ~AudioDeviceUtility() {}
};
diff --git a/modules/audio_device/dummy/audio_device_dummy.h b/modules/audio_device/dummy/audio_device_dummy.h
index beef1f6..3c0ad89 100644
--- a/modules/audio_device/dummy/audio_device_dummy.h
+++ b/modules/audio_device/dummy/audio_device_dummy.h
@@ -20,158 +20,158 @@
class AudioDeviceDummy : public AudioDeviceGeneric
{
public:
- AudioDeviceDummy(const WebRtc_Word32 id) {}
+ AudioDeviceDummy(const int32_t id) {}
~AudioDeviceDummy() {}
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32 ActiveAudioLayer(
+ virtual int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const { return -1; }
// Main initializaton and termination
- virtual WebRtc_Word32 Init() { return 0; }
- virtual WebRtc_Word32 Terminate() { return 0; }
+ virtual int32_t Init() { return 0; }
+ virtual int32_t Terminate() { return 0; }
virtual bool Initialized() const { return true; }
// Device enumeration
- virtual WebRtc_Word16 PlayoutDevices() { return -1; }
- virtual WebRtc_Word16 RecordingDevices() { return -1; }
- virtual WebRtc_Word32 PlayoutDeviceName(
- WebRtc_UWord16 index,
+ virtual int16_t PlayoutDevices() { return -1; }
+ virtual int16_t RecordingDevices() { return -1; }
+ virtual int32_t PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) { return -1; }
- virtual WebRtc_Word32 RecordingDeviceName(
- WebRtc_UWord16 index,
+ virtual int32_t RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) { return -1; }
// Device selection
- virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index) { return -1; }
- virtual WebRtc_Word32 SetPlayoutDevice(
+ virtual int32_t SetPlayoutDevice(uint16_t index) { return -1; }
+ virtual int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device) { return -1; }
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index) {
+ virtual int32_t SetRecordingDevice(uint16_t index) {
return -1;
}
- virtual WebRtc_Word32 SetRecordingDevice(
+ virtual int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) { return -1; }
// Audio transport initialization
- virtual WebRtc_Word32 PlayoutIsAvailable(bool& available) {
+ virtual int32_t PlayoutIsAvailable(bool& available) {
return -1; }
- virtual WebRtc_Word32 InitPlayout() { return -1; };
+ virtual int32_t InitPlayout() { return -1; };
virtual bool PlayoutIsInitialized() const { return false; }
- virtual WebRtc_Word32 RecordingIsAvailable(bool& available) { return -1; }
- virtual WebRtc_Word32 InitRecording() { return -1; }
+ virtual int32_t RecordingIsAvailable(bool& available) { return -1; }
+ virtual int32_t InitRecording() { return -1; }
virtual bool RecordingIsInitialized() const { return false; }
// Audio transport control
- virtual WebRtc_Word32 StartPlayout() { return -1; }
- virtual WebRtc_Word32 StopPlayout() { return -1; }
+ virtual int32_t StartPlayout() { return -1; }
+ virtual int32_t StopPlayout() { return -1; }
virtual bool Playing() const { return false; }
- virtual WebRtc_Word32 StartRecording() { return -1; }
- virtual WebRtc_Word32 StopRecording() { return -1; }
+ virtual int32_t StartRecording() { return -1; }
+ virtual int32_t StopRecording() { return -1; }
virtual bool Recording() const { return false; }
// Microphone Automatic Gain Control (AGC)
- virtual WebRtc_Word32 SetAGC(bool enable) { return -1; }
+ virtual int32_t SetAGC(bool enable) { return -1; }
virtual bool AGC() const { return false; }
// Volume control based on the Windows Wave API (Windows only)
- virtual WebRtc_Word32 SetWaveOutVolume(
- WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight) { return -1; }
- virtual WebRtc_Word32 WaveOutVolume(
- WebRtc_UWord16& volumeLeft,
- WebRtc_UWord16& volumeRight) const { return -1; }
+ virtual int32_t SetWaveOutVolume(
+ uint16_t volumeLeft, uint16_t volumeRight) { return -1; }
+ virtual int32_t WaveOutVolume(
+ uint16_t& volumeLeft,
+ uint16_t& volumeRight) const { return -1; }
// Audio mixer initialization
- virtual WebRtc_Word32 SpeakerIsAvailable(bool& available) { return -1; }
- virtual WebRtc_Word32 InitSpeaker() { return -1; }
+ virtual int32_t SpeakerIsAvailable(bool& available) { return -1; }
+ virtual int32_t InitSpeaker() { return -1; }
virtual bool SpeakerIsInitialized() const { return false; }
- virtual WebRtc_Word32 MicrophoneIsAvailable(bool& available) { return -1; }
- virtual WebRtc_Word32 InitMicrophone() { return -1; }
+ virtual int32_t MicrophoneIsAvailable(bool& available) { return -1; }
+ virtual int32_t InitMicrophone() { return -1; }
virtual bool MicrophoneIsInitialized() const { return false; }
// Speaker volume controls
- virtual WebRtc_Word32 SpeakerVolumeIsAvailable(bool& available) {
+ virtual int32_t SpeakerVolumeIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetSpeakerVolume(WebRtc_UWord32 volume) { return -1; }
- virtual WebRtc_Word32 SpeakerVolume(WebRtc_UWord32& volume) const {
+ virtual int32_t SetSpeakerVolume(uint32_t volume) { return -1; }
+ virtual int32_t SpeakerVolume(uint32_t& volume) const {
return -1;
}
- virtual WebRtc_Word32 MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const {
+ virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const {
return -1;
}
- virtual WebRtc_Word32 MinSpeakerVolume(WebRtc_UWord32& minVolume) const {
+ virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const {
return -1;
}
- virtual WebRtc_Word32 SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const { return -1; }
+ virtual int32_t SpeakerVolumeStepSize(
+ uint16_t& stepSize) const { return -1; }
// Microphone volume controls
- virtual WebRtc_Word32 MicrophoneVolumeIsAvailable(bool& available) {
+ virtual int32_t MicrophoneVolumeIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetMicrophoneVolume(WebRtc_UWord32 volume) {
+ virtual int32_t SetMicrophoneVolume(uint32_t volume) {
return -1;
}
- virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const {
+ virtual int32_t MicrophoneVolume(uint32_t& volume) const {
return -1;
}
- virtual WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const {
+ virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const {
return -1;
}
- virtual WebRtc_Word32 MinMicrophoneVolume(
- WebRtc_UWord32& minVolume) const { return -1; }
- virtual WebRtc_Word32 MicrophoneVolumeStepSize(
- WebRtc_UWord16& stepSize) const { return -1; }
+ virtual int32_t MinMicrophoneVolume(
+ uint32_t& minVolume) const { return -1; }
+ virtual int32_t MicrophoneVolumeStepSize(
+ uint16_t& stepSize) const { return -1; }
// Speaker mute control
- virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available) { return -1; }
- virtual WebRtc_Word32 SetSpeakerMute(bool enable) { return -1; }
- virtual WebRtc_Word32 SpeakerMute(bool& enabled) const { return -1; }
+ virtual int32_t SpeakerMuteIsAvailable(bool& available) { return -1; }
+ virtual int32_t SetSpeakerMute(bool enable) { return -1; }
+ virtual int32_t SpeakerMute(bool& enabled) const { return -1; }
// Microphone mute control
- virtual WebRtc_Word32 MicrophoneMuteIsAvailable(bool& available) {
+ virtual int32_t MicrophoneMuteIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetMicrophoneMute(bool enable) { return -1; }
- virtual WebRtc_Word32 MicrophoneMute(bool& enabled) const { return -1; }
+ virtual int32_t SetMicrophoneMute(bool enable) { return -1; }
+ virtual int32_t MicrophoneMute(bool& enabled) const { return -1; }
// Microphone boost control
- virtual WebRtc_Word32 MicrophoneBoostIsAvailable(bool& available) {
+ virtual int32_t MicrophoneBoostIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetMicrophoneBoost(bool enable) { return -1; }
- virtual WebRtc_Word32 MicrophoneBoost(bool& enabled) const { return -1; }
+ virtual int32_t SetMicrophoneBoost(bool enable) { return -1; }
+ virtual int32_t MicrophoneBoost(bool& enabled) const { return -1; }
// Stereo support
- virtual WebRtc_Word32 StereoPlayoutIsAvailable(bool& available) {
+ virtual int32_t StereoPlayoutIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetStereoPlayout(bool enable) { return -1; }
- virtual WebRtc_Word32 StereoPlayout(bool& enabled) const { return -1; }
- virtual WebRtc_Word32 StereoRecordingIsAvailable(bool& available) {
+ virtual int32_t SetStereoPlayout(bool enable) { return -1; }
+ virtual int32_t StereoPlayout(bool& enabled) const { return -1; }
+ virtual int32_t StereoRecordingIsAvailable(bool& available) {
return -1;
}
- virtual WebRtc_Word32 SetStereoRecording(bool enable) { return -1; }
- virtual WebRtc_Word32 StereoRecording(bool& enabled) const { return -1; }
+ virtual int32_t SetStereoRecording(bool enable) { return -1; }
+ virtual int32_t StereoRecording(bool& enabled) const { return -1; }
// Delay information and control
- virtual WebRtc_Word32 SetPlayoutBuffer(
+ virtual int32_t SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
- WebRtc_UWord16 sizeMS) { return -1; }
- virtual WebRtc_Word32 PlayoutBuffer(
+ uint16_t sizeMS) { return -1; }
+ virtual int32_t PlayoutBuffer(
AudioDeviceModule::BufferType& type,
- WebRtc_UWord16& sizeMS) const { return -1; }
- virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const {
+ uint16_t& sizeMS) const { return -1; }
+ virtual int32_t PlayoutDelay(uint16_t& delayMS) const {
return -1;
}
- virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const {
+ virtual int32_t RecordingDelay(uint16_t& delayMS) const {
return -1;
}
// CPU load
- virtual WebRtc_Word32 CPULoad(WebRtc_UWord16& load) const { return -1; }
+ virtual int32_t CPULoad(uint16_t& load) const { return -1; }
virtual bool PlayoutWarning() const { return false; }
virtual bool PlayoutError() const { return false; }
diff --git a/modules/audio_device/dummy/audio_device_utility_dummy.h b/modules/audio_device/dummy/audio_device_utility_dummy.h
index 5bf7237..c8bb180 100644
--- a/modules/audio_device/dummy/audio_device_utility_dummy.h
+++ b/modules/audio_device/dummy/audio_device_utility_dummy.h
@@ -21,10 +21,10 @@
class AudioDeviceUtilityDummy: public AudioDeviceUtility
{
public:
- AudioDeviceUtilityDummy(const WebRtc_Word32 id) {}
+ AudioDeviceUtilityDummy(const int32_t id) {}
~AudioDeviceUtilityDummy() {}
- virtual WebRtc_Word32 Init() { return 0; }
+ virtual int32_t Init() { return 0; }
};
} // namespace webrtc
diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h
index 8b1ef16..7b6d5e1 100644
--- a/modules/audio_device/include/audio_device.h
+++ b/modules/audio_device/include/audio_device.h
@@ -200,7 +200,7 @@
};
AudioDeviceModule* CreateAudioDeviceModule(
- WebRtc_Word32 id, AudioDeviceModule::AudioLayer audioLayer);
+ int32_t id, AudioDeviceModule::AudioLayer audioLayer);
} // namespace webrtc
diff --git a/modules/audio_device/ios/audio_device_ios.cc b/modules/audio_device/ios/audio_device_ios.cc
index 1381859..f9691f3 100644
--- a/modules/audio_device/ios/audio_device_ios.cc
+++ b/modules/audio_device/ios/audio_device_ios.cc
@@ -16,7 +16,7 @@
#include "thread_wrapper.h"
namespace webrtc {
-AudioDeviceIPhone::AudioDeviceIPhone(const WebRtc_Word32 id)
+AudioDeviceIPhone::AudioDeviceIPhone(const int32_t id)
:
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
@@ -86,7 +86,7 @@
_ptrAudioBuffer->SetPlayoutChannels(N_PLAY_CHANNELS);
}
-WebRtc_Word32 AudioDeviceIPhone::ActiveAudioLayer(
+int32_t AudioDeviceIPhone::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -94,7 +94,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::Init() {
+int32_t AudioDeviceIPhone::Init() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -120,7 +120,7 @@
unsigned int threadID(0);
bool res = _captureWorkerThread->Start(threadID);
- _captureWorkerThreadId = static_cast<WebRtc_UWord32>(threadID);
+ _captureWorkerThreadId = static_cast<uint32_t>(threadID);
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice,
_id, "CaptureWorkerThread started (res=%d)", res);
} else {
@@ -137,7 +137,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::Terminate() {
+int32_t AudioDeviceIPhone::Terminate() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -175,7 +175,7 @@
return (_initialized);
}
-WebRtc_Word32 AudioDeviceIPhone::SpeakerIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::SpeakerIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -184,7 +184,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::InitSpeaker() {
+int32_t AudioDeviceIPhone::InitSpeaker() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -214,7 +214,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::MicrophoneIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -238,7 +238,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::InitMicrophone() {
+int32_t AudioDeviceIPhone::InitMicrophone() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -281,7 +281,7 @@
return _micIsInitialized;
}
-WebRtc_Word32 AudioDeviceIPhone::SpeakerVolumeIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::SpeakerVolumeIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -290,7 +290,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetSpeakerVolume(WebRtc_UWord32 volume) {
+int32_t AudioDeviceIPhone::SetSpeakerVolume(uint32_t volume) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetSpeakerVolume(volume=%u)", volume);
@@ -299,7 +299,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::SpeakerVolume(WebRtc_UWord32& volume) const {
+int32_t AudioDeviceIPhone::SpeakerVolume(uint32_t& volume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -308,9 +308,9 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
- WebRtc_UWord16 volumeRight) {
+int32_t
+ AudioDeviceIPhone::SetWaveOutVolume(uint16_t volumeLeft,
+ uint16_t volumeRight) {
WEBRTC_TRACE(
kTraceModuleCall,
kTraceAudioDevice,
@@ -324,9 +324,9 @@
return -1;
}
-WebRtc_Word32
-AudioDeviceIPhone::WaveOutVolume(WebRtc_UWord16& /*volumeLeft*/,
- WebRtc_UWord16& /*volumeRight*/) const {
+int32_t
+AudioDeviceIPhone::WaveOutVolume(uint16_t& /*volumeLeft*/,
+ uint16_t& /*volumeRight*/) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -335,8 +335,8 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const {
+int32_t
+ AudioDeviceIPhone::MaxSpeakerVolume(uint32_t& maxVolume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -345,8 +345,8 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::MinSpeakerVolume(
- WebRtc_UWord32& minVolume) const {
+int32_t AudioDeviceIPhone::MinSpeakerVolume(
+ uint32_t& minVolume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -355,8 +355,8 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const {
+int32_t
+ AudioDeviceIPhone::SpeakerVolumeStepSize(uint16_t& stepSize) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -365,7 +365,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::SpeakerMuteIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::SpeakerMuteIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -374,7 +374,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetSpeakerMute(bool enable) {
+int32_t AudioDeviceIPhone::SetSpeakerMute(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -383,7 +383,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::SpeakerMute(bool& enabled) const {
+int32_t AudioDeviceIPhone::SpeakerMute(bool& enabled) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -392,7 +392,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneMuteIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::MicrophoneMuteIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -401,7 +401,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetMicrophoneMute(bool enable) {
+int32_t AudioDeviceIPhone::SetMicrophoneMute(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -410,7 +410,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneMute(bool& enabled) const {
+int32_t AudioDeviceIPhone::MicrophoneMute(bool& enabled) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -419,7 +419,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneBoostIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::MicrophoneBoostIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -428,7 +428,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetMicrophoneBoost(bool enable) {
+int32_t AudioDeviceIPhone::SetMicrophoneBoost(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetMicrophoneBoost(enable=%u)", enable);
@@ -447,7 +447,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneBoost(bool& enabled) const {
+int32_t AudioDeviceIPhone::MicrophoneBoost(bool& enabled) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
if (!_micIsInitialized) {
@@ -461,7 +461,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StereoRecordingIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::StereoRecordingIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -470,7 +470,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetStereoRecording(bool enable) {
+int32_t AudioDeviceIPhone::SetStereoRecording(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetStereoRecording(enable=%u)", enable);
@@ -482,7 +482,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StereoRecording(bool& enabled) const {
+int32_t AudioDeviceIPhone::StereoRecording(bool& enabled) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -490,7 +490,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StereoPlayoutIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::StereoPlayoutIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -499,7 +499,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetStereoPlayout(bool enable) {
+int32_t AudioDeviceIPhone::SetStereoPlayout(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetStereoPlayout(enable=%u)", enable);
@@ -511,7 +511,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StereoPlayout(bool& enabled) const {
+int32_t AudioDeviceIPhone::StereoPlayout(bool& enabled) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -519,7 +519,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetAGC(bool enable) {
+int32_t AudioDeviceIPhone::SetAGC(bool enable) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetAGC(enable=%d)", enable);
@@ -535,7 +535,7 @@
return _AGC;
}
-WebRtc_Word32 AudioDeviceIPhone::MicrophoneVolumeIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::MicrophoneVolumeIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -544,7 +544,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::SetMicrophoneVolume(WebRtc_UWord32 volume) {
+int32_t AudioDeviceIPhone::SetMicrophoneVolume(uint32_t volume) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetMicrophoneVolume(volume=%u)", volume);
@@ -553,8 +553,8 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::MicrophoneVolume(WebRtc_UWord32& volume) const {
+int32_t
+ AudioDeviceIPhone::MicrophoneVolume(uint32_t& volume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -563,8 +563,8 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const {
+int32_t
+ AudioDeviceIPhone::MaxMicrophoneVolume(uint32_t& maxVolume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -573,8 +573,8 @@
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const {
+int32_t
+ AudioDeviceIPhone::MinMicrophoneVolume(uint32_t& minVolume) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -583,9 +583,9 @@
return -1;
}
-WebRtc_Word32
+int32_t
AudioDeviceIPhone::MicrophoneVolumeStepSize(
- WebRtc_UWord16& stepSize) const {
+ uint16_t& stepSize) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
@@ -594,14 +594,14 @@
return -1;
}
-WebRtc_Word16 AudioDeviceIPhone::PlayoutDevices() {
+int16_t AudioDeviceIPhone::PlayoutDevices() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
- return (WebRtc_Word16)1;
+ return (int16_t)1;
}
-WebRtc_Word32 AudioDeviceIPhone::SetPlayoutDevice(WebRtc_UWord16 index) {
+int32_t AudioDeviceIPhone::SetPlayoutDevice(uint16_t index) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetPlayoutDevice(index=%u)", index);
@@ -621,15 +621,15 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioDeviceIPhone::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType) {
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
"WindowsDeviceType not supported");
return -1;
}
-WebRtc_Word32
- AudioDeviceIPhone::PlayoutDeviceName(WebRtc_UWord16 index,
+int32_t
+ AudioDeviceIPhone::PlayoutDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
@@ -647,8 +647,8 @@
return 0;
}
-WebRtc_Word32
- AudioDeviceIPhone::RecordingDeviceName(WebRtc_UWord16 index,
+int32_t
+ AudioDeviceIPhone::RecordingDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
@@ -666,13 +666,13 @@
return 0;
}
-WebRtc_Word16 AudioDeviceIPhone::RecordingDevices() {
+int16_t AudioDeviceIPhone::RecordingDevices() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
- return (WebRtc_Word16)1;
+ return (int16_t)1;
}
-WebRtc_Word32 AudioDeviceIPhone::SetRecordingDevice(WebRtc_UWord16 index) {
+int32_t AudioDeviceIPhone::SetRecordingDevice(uint16_t index) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetRecordingDevice(index=%u)", index);
@@ -693,7 +693,7 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioDeviceIPhone::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType) {
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -709,7 +709,7 @@
// documentation.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceIPhone::SetLoudspeakerStatus(bool enable) {
+int32_t AudioDeviceIPhone::SetLoudspeakerStatus(bool enable) {
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetLoudspeakerStatus(enable=%d)", enable);
@@ -728,7 +728,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::GetLoudspeakerStatus(bool &enabled) const {
+int32_t AudioDeviceIPhone::GetLoudspeakerStatus(bool &enabled) const {
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetLoudspeakerStatus(enabled=?)");
@@ -749,13 +749,13 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::PlayoutIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::PlayoutIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
available = false;
// Try to initialize the playout side
- WebRtc_Word32 res = InitPlayout();
+ int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@@ -767,13 +767,13 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::RecordingIsAvailable(bool& available) {
+int32_t AudioDeviceIPhone::RecordingIsAvailable(bool& available) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
available = false;
// Try to initialize the recording side
- WebRtc_Word32 res = InitRecording();
+ int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@@ -785,7 +785,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::InitPlayout() {
+int32_t AudioDeviceIPhone::InitPlayout() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -841,7 +841,7 @@
return (_playIsInitialized);
}
-WebRtc_Word32 AudioDeviceIPhone::InitRecording() {
+int32_t AudioDeviceIPhone::InitRecording() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -899,7 +899,7 @@
return (_recIsInitialized);
}
-WebRtc_Word32 AudioDeviceIPhone::StartRecording() {
+int32_t AudioDeviceIPhone::StartRecording() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -946,7 +946,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StopRecording() {
+int32_t AudioDeviceIPhone::StopRecording() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -975,7 +975,7 @@
return (_recording);
}
-WebRtc_Word32 AudioDeviceIPhone::StartPlayout() {
+int32_t AudioDeviceIPhone::StartPlayout() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
// This lock is (among other things) needed to avoid concurrency issues
@@ -1021,7 +1021,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::StopPlayout() {
+int32_t AudioDeviceIPhone::StopPlayout() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -1058,7 +1058,7 @@
// and set enable states after shutdown to same as current.
// In capture thread audio device will be shutdown, then started again.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceIPhone::ResetAudioDevice() {
+int32_t AudioDeviceIPhone::ResetAudioDevice() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
CriticalSectionScoped lock(&_critSect);
@@ -1100,20 +1100,20 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::PlayoutDelay(WebRtc_UWord16& delayMS) const {
+int32_t AudioDeviceIPhone::PlayoutDelay(uint16_t& delayMS) const {
delayMS = _playoutDelay;
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::RecordingDelay(WebRtc_UWord16& delayMS) const {
+int32_t AudioDeviceIPhone::RecordingDelay(uint16_t& delayMS) const {
delayMS = _recordingDelay;
return 0;
}
-WebRtc_Word32
+int32_t
AudioDeviceIPhone::SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
- WebRtc_UWord16 sizeMS) {
+ uint16_t sizeMS) {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"AudioDeviceIPhone::SetPlayoutBuffer(type=%u, sizeMS=%u)",
type, sizeMS);
@@ -1123,9 +1123,9 @@
return -1;
}
-WebRtc_Word32
+int32_t
AudioDeviceIPhone::PlayoutBuffer(AudioDeviceModule::BufferType& type,
- WebRtc_UWord16& sizeMS) const {
+ uint16_t& sizeMS) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
type = AudioDeviceModule::kAdaptiveBufferSize;
@@ -1135,7 +1135,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::CPULoad(WebRtc_UWord16& /*load*/) const {
+int32_t AudioDeviceIPhone::CPULoad(uint16_t& /*load*/) const {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -1179,7 +1179,7 @@
// Private Methods
// ============================================================================
-WebRtc_Word32 AudioDeviceIPhone::InitPlayOrRecord() {
+int32_t AudioDeviceIPhone::InitPlayOrRecord() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, "%s", __FUNCTION__);
OSStatus result = -1;
@@ -1229,7 +1229,7 @@
"Could not set preferred sample rate (result=%d)", result);
}
- WebRtc_UWord32 voiceChat = kAudioSessionMode_VoiceChat;
+ uint32_t voiceChat = kAudioSessionMode_VoiceChat;
AudioSessionSetProperty(kAudioSessionProperty_Mode,
sizeof(voiceChat), &voiceChat);
@@ -1441,7 +1441,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceIPhone::ShutdownPlayOrRecord() {
+int32_t AudioDeviceIPhone::ShutdownPlayOrRecord() {
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
// Close and delete AU
@@ -1487,13 +1487,13 @@
AudioDeviceIPhone::RecordProcessImpl(
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
- WebRtc_UWord32 inBusNumber,
- WebRtc_UWord32 inNumberFrames) {
+ uint32_t inBusNumber,
+ uint32_t inNumberFrames) {
// Setup some basic stuff
// Use temp buffer not to lock up recording buffer more than necessary
// todo: Make dataTmp a member variable with static size that holds
// max possible frames?
- WebRtc_Word16* dataTmp = new WebRtc_Word16[inNumberFrames];
+ int16_t* dataTmp = new int16_t[inNumberFrames];
memset(dataTmp, 0, 2*inNumberFrames);
AudioBufferList abList;
@@ -1528,8 +1528,8 @@
const unsigned int noSamp10ms = _adbSampFreq / 100;
unsigned int dataPos = 0;
- WebRtc_UWord16 bufPos = 0;
- WebRtc_Word16 insertPos = -1;
+ uint16_t bufPos = 0;
+ int16_t insertPos = -1;
unsigned int nCopy = 0; // Number of samples to copy
while (dataPos < inNumberFrames) {
@@ -1544,13 +1544,13 @@
if ((_recordingLength[bufPos] > 0)
&& (_recordingLength[bufPos] < noSamp10ms)) {
// Found the partially full buffer
- insertPos = static_cast<WebRtc_Word16>(bufPos);
+ insertPos = static_cast<int16_t>(bufPos);
// Don't need to search more, quit loop
bufPos = N_REC_BUFFERS;
} else if ((-1 == insertPos)
&& (0 == _recordingLength[bufPos])) {
// Found an empty buffer
- insertPos = static_cast<WebRtc_Word16>(bufPos);
+ insertPos = static_cast<int16_t>(bufPos);
}
++bufPos;
}
@@ -1564,7 +1564,7 @@
nCopy = (dataToCopy < roomInBuffer ? dataToCopy : roomInBuffer);
memcpy(&_recordingBuffer[insertPos][currentRecLen],
- &dataTmp[dataPos], nCopy*sizeof(WebRtc_Word16));
+ &dataTmp[dataPos], nCopy*sizeof(int16_t));
if (0 == currentRecLen) {
_recordingSeqNumber[insertPos] = _recordingCurrentSeq;
++_recordingCurrentSeq;
@@ -1606,13 +1606,13 @@
}
OSStatus
- AudioDeviceIPhone::PlayoutProcessImpl(WebRtc_UWord32 inNumberFrames,
+ AudioDeviceIPhone::PlayoutProcessImpl(uint32_t inNumberFrames,
AudioBufferList *ioData) {
// Setup some basic stuff
// assert(sizeof(short) == 2); // Assumption for implementation
- WebRtc_Word16* data =
- static_cast<WebRtc_Word16*>(ioData->mBuffers[0].mData);
+ int16_t* data =
+ static_cast<int16_t*>(ioData->mBuffers[0].mData);
unsigned int dataSizeBytes = ioData->mBuffers[0].mDataByteSize;
unsigned int dataSize = dataSizeBytes/2; // Number of samples
if (dataSize != inNumberFrames) { // Should always be the same
@@ -1633,7 +1633,7 @@
if (_playing) {
unsigned int noSamp10ms = _adbSampFreq / 100;
// todo: Member variable and allocate when samp freq is determined
- WebRtc_Word16* dataTmp = new WebRtc_Word16[noSamp10ms];
+ int16_t* dataTmp = new int16_t[noSamp10ms];
memset(dataTmp, 0, 2*noSamp10ms);
unsigned int dataPos = 0;
int noSamplesOut = 0;
@@ -1673,7 +1673,7 @@
// Get data from Audio Device Buffer
noSamplesOut =
_ptrAudioBuffer->GetPlayoutData(
- reinterpret_cast<WebRtc_Word8*>(dataTmp));
+ reinterpret_cast<int8_t*>(dataTmp));
// Cast OK since only equality comparison
if (noSamp10ms != (unsigned int)noSamplesOut) {
// Should never happen
@@ -1812,7 +1812,7 @@
// ADB recording buffer size, update every time
// Don't count the one next 10 ms to be sent, then convert samples => ms
- const WebRtc_UWord32 noSamp10ms = _adbSampFreq / 100;
+ const uint32_t noSamp10ms = _adbSampFreq / 100;
if (_recordingBufferTotalSize > noSamp10ms) {
_recordingDelay +=
(_recordingBufferTotalSize - noSamp10ms) / (_adbSampFreq / 1000);
@@ -1856,7 +1856,7 @@
// Set the recorded buffer
_ptrAudioBuffer->SetRecordedBuffer(
- reinterpret_cast<WebRtc_Word8*>(
+ reinterpret_cast<int8_t*>(
_recordingBuffer[lowestSeqBufPos]),
_recordingLength[lowestSeqBufPos]);
diff --git a/modules/audio_device/ios/audio_device_ios.h b/modules/audio_device/ios/audio_device_ios.h
index dc32482..2e5cdc2 100644
--- a/modules/audio_device/ios/audio_device_ios.h
+++ b/modules/audio_device/ios/audio_device_ios.h
@@ -19,138 +19,135 @@
namespace webrtc {
class ThreadWrapper;
-const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 44000;
-const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 44000;
+const uint32_t N_REC_SAMPLES_PER_SEC = 44000;
+const uint32_t N_PLAY_SAMPLES_PER_SEC = 44000;
-const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording
-const WebRtc_UWord32 N_PLAY_CHANNELS = 1; // default is mono playout
-const WebRtc_UWord32 N_DEVICE_CHANNELS = 8;
+const uint32_t N_REC_CHANNELS = 1; // default is mono recording
+const uint32_t N_PLAY_CHANNELS = 1; // default is mono playout
+const uint32_t N_DEVICE_CHANNELS = 8;
-const WebRtc_UWord32 ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC
- / 100);
-const WebRtc_UWord32 ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC
- / 100);
+const uint32_t ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC / 100);
+const uint32_t ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC / 100);
// Number of 10 ms recording blocks in recording buffer
-const WebRtc_UWord16 N_REC_BUFFERS = 20;
+const uint16_t N_REC_BUFFERS = 20;
class AudioDeviceIPhone : public AudioDeviceGeneric {
public:
- AudioDeviceIPhone(const WebRtc_Word32 id);
+ AudioDeviceIPhone(const int32_t id);
~AudioDeviceIPhone();
// 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,
- char name[kAdmMaxDeviceNameSize],
- char guid[kAdmMaxGuidSize]);
- virtual WebRtc_Word32 RecordingDeviceName(WebRtc_UWord16 index,
- char name[kAdmMaxDeviceNameSize],
- char guid[kAdmMaxGuidSize]);
+ virtual int16_t PlayoutDevices();
+ virtual int16_t RecordingDevices();
+ virtual int32_t PlayoutDeviceName(uint16_t index,
+ char name[kAdmMaxDeviceNameSize],
+ char guid[kAdmMaxGuidSize]);
+ 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
+ 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;
// 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;
// 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 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;
@@ -166,11 +163,11 @@
virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer);
// Reset Audio Deivce (for mobile devices only)
- virtual WebRtc_Word32 ResetAudioDevice();
+ virtual int32_t ResetAudioDevice();
// enable or disable loud speaker (for iphone only)
- virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable);
- virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enabled) const;
+ virtual int32_t SetLoudspeakerStatus(bool enable);
+ virtual int32_t GetLoudspeakerStatus(bool& enabled) const;
private:
void Lock() {
@@ -181,13 +178,13 @@
_critSect.Leave();
}
- WebRtc_Word32 Id() {
+ int32_t Id() {
return _id;
}
// Init and shutdown
- WebRtc_Word32 InitPlayOrRecord();
- WebRtc_Word32 ShutdownPlayOrRecord();
+ int32_t InitPlayOrRecord();
+ int32_t ShutdownPlayOrRecord();
void UpdateRecordingDelay();
void UpdatePlayoutDelay();
@@ -208,10 +205,10 @@
OSStatus RecordProcessImpl(AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *WebRtc_Word32imeStamp,
- WebRtc_UWord32 inBusNumber,
- WebRtc_UWord32 inNumberFrames);
+ uint32_t inBusNumber,
+ uint32_t inNumberFrames);
- OSStatus PlayoutProcessImpl(WebRtc_UWord32 inNumberFrames,
+ OSStatus PlayoutProcessImpl(uint32_t inNumberFrames,
AudioBufferList *ioData);
static bool RunCapture(void* ptrThis);
@@ -223,9 +220,9 @@
CriticalSectionWrapper& _critSect;
ThreadWrapper* _captureWorkerThread;
- WebRtc_UWord32 _captureWorkerThreadId;
+ uint32_t _captureWorkerThreadId;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioUnit _auVoiceProcessing;
@@ -245,34 +242,34 @@
bool _AGC;
// The sampling rate to use with Audio Device Buffer
- WebRtc_UWord32 _adbSampFreq;
+ uint32_t _adbSampFreq;
// Delay calculation
- WebRtc_UWord32 _recordingDelay;
- WebRtc_UWord32 _playoutDelay;
- WebRtc_UWord32 _playoutDelayMeasurementCounter;
- WebRtc_UWord32 _recordingDelayHWAndOS;
- WebRtc_UWord32 _recordingDelayMeasurementCounter;
+ uint32_t _recordingDelay;
+ uint32_t _playoutDelay;
+ uint32_t _playoutDelayMeasurementCounter;
+ uint32_t _recordingDelayHWAndOS;
+ uint32_t _recordingDelayMeasurementCounter;
// Errors and warnings count
- WebRtc_UWord16 _playWarning;
- WebRtc_UWord16 _playError;
- WebRtc_UWord16 _recWarning;
- WebRtc_UWord16 _recError;
+ uint16_t _playWarning;
+ uint16_t _playError;
+ uint16_t _recWarning;
+ uint16_t _recError;
// Playout buffer, needed for 44.0 / 44.1 kHz mismatch
- WebRtc_Word16 _playoutBuffer[ENGINE_PLAY_BUF_SIZE_IN_SAMPLES];
- WebRtc_UWord32 _playoutBufferUsed; // How much is filled
+ int16_t _playoutBuffer[ENGINE_PLAY_BUF_SIZE_IN_SAMPLES];
+ uint32_t _playoutBufferUsed; // How much is filled
// Recording buffers
- WebRtc_Word16
+ int16_t
_recordingBuffer[N_REC_BUFFERS][ENGINE_REC_BUF_SIZE_IN_SAMPLES];
- WebRtc_UWord32 _recordingLength[N_REC_BUFFERS];
- WebRtc_UWord32 _recordingSeqNumber[N_REC_BUFFERS];
- WebRtc_UWord32 _recordingCurrentSeq;
+ uint32_t _recordingLength[N_REC_BUFFERS];
+ uint32_t _recordingSeqNumber[N_REC_BUFFERS];
+ uint32_t _recordingCurrentSeq;
// Current total size all data in buffers, used for delay estimate
- WebRtc_UWord32 _recordingBufferTotalSize;
+ uint32_t _recordingBufferTotalSize;
};
} // namespace webrtc
diff --git a/modules/audio_device/ios/audio_device_utility_ios.cc b/modules/audio_device/ios/audio_device_utility_ios.cc
index 965d13f..bb4a1c1 100644
--- a/modules/audio_device/ios/audio_device_utility_ios.cc
+++ b/modules/audio_device/ios/audio_device_utility_ios.cc
@@ -15,7 +15,7 @@
#include "trace.h"
namespace webrtc {
-AudioDeviceUtilityIPhone::AudioDeviceUtilityIPhone(const WebRtc_Word32 id)
+AudioDeviceUtilityIPhone::AudioDeviceUtilityIPhone(const int32_t id)
:
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
@@ -32,7 +32,7 @@
delete &_critSect;
}
-WebRtc_Word32 AudioDeviceUtilityIPhone::Init() {
+int32_t AudioDeviceUtilityIPhone::Init() {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__);
diff --git a/modules/audio_device/ios/audio_device_utility_ios.h b/modules/audio_device/ios/audio_device_utility_ios.h
index 663b1f7..2892a7d 100644
--- a/modules/audio_device/ios/audio_device_utility_ios.h
+++ b/modules/audio_device/ios/audio_device_utility_ios.h
@@ -19,15 +19,15 @@
class AudioDeviceUtilityIPhone: public AudioDeviceUtility {
public:
- AudioDeviceUtilityIPhone(const WebRtc_Word32 id);
+ AudioDeviceUtilityIPhone(const int32_t id);
AudioDeviceUtilityIPhone();
virtual ~AudioDeviceUtilityIPhone();
- virtual WebRtc_Word32 Init();
+ virtual int32_t Init();
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioDeviceModule::ErrorCode _lastError;
};
diff --git a/modules/audio_device/linux/audio_device_alsa_linux.cc b/modules/audio_device/linux/audio_device_alsa_linux.cc
index 14e1667..2b7ed2e 100644
--- a/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -63,7 +63,7 @@
#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 @@
_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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::Terminate()
+int32_t AudioDeviceLinuxALSA::Terminate()
{
if (!_initialized)
@@ -260,7 +260,7 @@
return (_initialized);
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::SpeakerIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -288,7 +288,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::InitSpeaker()
+int32_t AudioDeviceLinuxALSA::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -303,7 +303,7 @@
return _mixerManager.OpenSpeaker(devName);
}
-WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::MicrophoneIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -331,7 +331,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::InitMicrophone()
+int32_t AudioDeviceLinuxALSA::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -356,7 +356,7 @@
return (_mixerManager.MicrophoneIsInitialized());
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::SpeakerVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -384,16 +384,16 @@
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::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 @@
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 @@
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 @@
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 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -505,12 +505,12 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -558,7 +558,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneMute(bool enable)
+int32_t AudioDeviceLinuxALSA::SetMicrophoneMute(bool enable)
{
return (_mixerManager.SetMicrophoneMute(enable));
}
@@ -567,7 +567,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneMute(bool& enabled) const
+int32_t AudioDeviceLinuxALSA::MicrophoneMute(bool& enabled) const
{
bool muted(0);
@@ -581,7 +581,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -612,13 +612,13 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -682,7 +682,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoRecording(bool enable)
+int32_t AudioDeviceLinuxALSA::SetStereoRecording(bool enable)
{
if (enable)
@@ -693,7 +693,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StereoRecording(bool& enabled) const
+int32_t AudioDeviceLinuxALSA::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@@ -704,7 +704,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::StereoPlayoutIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -753,7 +753,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetStereoPlayout(bool enable)
+int32_t AudioDeviceLinuxALSA::SetStereoPlayout(bool enable)
{
if (enable)
@@ -764,7 +764,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceLinuxALSA::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@@ -775,7 +775,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetAGC(bool enable)
+int32_t AudioDeviceLinuxALSA::SetAGC(bool enable)
{
_AGC = enable;
@@ -789,7 +789,7 @@
return _AGC;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::MicrophoneVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -817,7 +817,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceLinuxALSA::SetMicrophoneVolume(uint32_t volume)
{
return (_mixerManager.SetMicrophoneVolume(volume));
@@ -825,10 +825,10 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(
+int32_t AudioDeviceLinuxALSA::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -929,13 +929,13 @@
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 @@
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 @@
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 @@
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 @@
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceLinuxALSA::SetRecordingDevice(
+int32_t AudioDeviceLinuxALSA::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -1018,7 +1018,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::PlayoutIsAvailable(bool& available)
{
available = false;
@@ -1026,7 +1026,7 @@
// 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 @@
return res;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
+int32_t AudioDeviceLinuxALSA::RecordingIsAvailable(bool& available)
{
available = false;
@@ -1057,7 +1057,7 @@
// 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 @@
return res;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::InitPlayout()
+int32_t AudioDeviceLinuxALSA::InitPlayout()
{
int errVal = 0;
@@ -1233,7 +1233,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::InitRecording()
+int32_t AudioDeviceLinuxALSA::InitRecording()
{
int errVal = 0;
@@ -1404,7 +1404,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StartRecording()
+int32_t AudioDeviceLinuxALSA::StartRecording()
{
if (!_recIsInitialized)
@@ -1424,7 +1424,7 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StopRecording()
+int32_t AudioDeviceLinuxALSA::StopRecording()
{
{
@@ -1579,7 +1579,7 @@
return (_playIsInitialized);
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StartPlayout()
+int32_t AudioDeviceLinuxALSA::StartPlayout()
{
if (!_playIsInitialized)
{
@@ -1595,7 +1595,7 @@
_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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::StopPlayout()
+int32_t AudioDeviceLinuxALSA::StopPlayout()
{
{
@@ -1708,16 +1708,16 @@
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 @@
// 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 @@
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 @@
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 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const
+int32_t AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const
{
if (_handleRecord == NULL)
{
@@ -1984,7 +1984,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const
+int32_t AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const
{
if (_handlePlayout == NULL)
{
@@ -1995,8 +1995,8 @@
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 @@
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 @@
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 @@
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 @@
_ptrAudioBuffer->SetRecordedBuffer(_recordingBuffer,
_recordingFramesIn10MS);
- WebRtc_UWord32 currentMicLevel = 0;
- WebRtc_UWord32 newMicLevel = 0;
+ uint32_t currentMicLevel = 0;
+ uint32_t newMicLevel = 0;
if (AGC())
{
diff --git a/modules/audio_device/linux/audio_device_alsa_linux.h b/modules/audio_device/linux/audio_device_alsa_linux.h
index 20e555c..dd94e34 100644
--- a/modules/audio_device/linux/audio_device_alsa_linux.h
+++ b/modules/audio_device/linux/audio_device_alsa_linux.h
@@ -28,124 +28,123 @@
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 @@
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 @@
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 @@
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 @@
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
};
}
diff --git a/modules/audio_device/linux/audio_device_pulse_linux.cc b/modules/audio_device/linux/audio_device_pulse_linux.cc
index 7e143de..17751bf 100644
--- a/modules/audio_device/linux/audio_device_pulse_linux.cc
+++ b/modules/audio_device/linux/audio_device_pulse_linux.cc
@@ -62,7 +62,7 @@
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 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::Terminate()
+int32_t AudioDeviceLinuxPulse::Terminate()
{
if (!_initialized)
@@ -355,7 +355,7 @@
return (_initialized);
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::SpeakerIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -383,7 +383,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitSpeaker()
+int32_t AudioDeviceLinuxPulse::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -401,7 +401,7 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::MicrophoneIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -456,7 +456,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitMicrophone()
+int32_t AudioDeviceLinuxPulse::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -474,7 +474,7 @@
// 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 @@
return (_mixerManager.MicrophoneIsInitialized());
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -538,7 +538,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -662,13 +662,13 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -714,13 +714,13 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -764,13 +764,13 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available)
{
if (_recChannels == 2 && _recording) {
@@ -821,7 +821,7 @@
return error;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
+int32_t AudioDeviceLinuxPulse::SetStereoRecording(bool enable)
{
#ifndef WEBRTC_PA_GTALK
@@ -834,7 +834,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
+int32_t AudioDeviceLinuxPulse::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@@ -845,7 +845,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceLinuxPulse::StereoPlayoutIsAvailable(bool& available)
{
if (_playChannels == 2 && _playing) {
@@ -880,7 +880,7 @@
return error;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
+int32_t AudioDeviceLinuxPulse::SetStereoPlayout(bool enable)
{
#ifndef WEBRTC_PA_GTALK
@@ -893,7 +893,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceLinuxPulse::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@@ -904,7 +904,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetAGC(bool enable)
+int32_t AudioDeviceLinuxPulse::SetAGC(bool enable)
{
_AGC = enable;
@@ -918,7 +918,7 @@
return _AGC;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
+int32_t AudioDeviceLinuxPulse::MicrophoneVolumeIsAvailable(
bool& available)
{
@@ -947,17 +947,17 @@
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 @@
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 @@
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 @@
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 @@
return 0;
}
-WebRtc_Word16 AudioDeviceLinuxPulse::PlayoutDevices()
+int16_t AudioDeviceLinuxPulse::PlayoutDevices()
{
PaLock();
@@ -1039,7 +1039,7 @@
return _numPlayDevices;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@@ -1047,7 +1047,7 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(
+int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -1073,13 +1073,13 @@
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 @@
// Check if default device
if (index == 0)
{
- WebRtc_UWord16 deviceIndex = 0;
+ uint16_t deviceIndex = 0;
return GetDefaultDeviceInfo(false, name, deviceIndex);
}
@@ -1115,13 +1115,13 @@
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 @@
// Check if default device
if (index == 0)
{
- WebRtc_UWord16 deviceIndex = 0;
+ uint16_t deviceIndex = 0;
return GetDefaultDeviceInfo(true, name, deviceIndex);
}
@@ -1157,7 +1157,7 @@
return 0;
}
-WebRtc_Word16 AudioDeviceLinuxPulse::RecordingDevices()
+int16_t AudioDeviceLinuxPulse::RecordingDevices()
{
PaLock();
@@ -1177,7 +1177,7 @@
return _numRecDevices;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceLinuxPulse::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@@ -1185,7 +1185,7 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::SetRecordingDevice(
+int32_t AudioDeviceLinuxPulse::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -1211,13 +1211,13 @@
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 @@
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 @@
return res;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitPlayout()
+int32_t AudioDeviceLinuxPulse::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1277,7 +1277,7 @@
}
// Set sampling rate to use
- WebRtc_UWord32 samplingRate = _samplingFreq * 1000;
+ uint32_t samplingRate = _samplingFreq * 1000;
if (samplingRate == 44000)
{
samplingRate = 44100;
@@ -1308,7 +1308,7 @@
{
// 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 @@
}
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 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitRecording()
+int32_t AudioDeviceLinuxPulse::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1403,7 +1403,7 @@
}
// Set sampling rate to use
- WebRtc_UWord32 samplingRate = _samplingFreq * 1000;
+ uint32_t samplingRate = _samplingFreq * 1000;
if (samplingRate == 44000)
{
samplingRate = 44100;
@@ -1433,7 +1433,7 @@
{
// 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 @@
}
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 @@
_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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StartRecording()
+int32_t AudioDeviceLinuxPulse::StartRecording()
{
if (!_recIsInitialized)
@@ -1538,7 +1538,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StopRecording()
+int32_t AudioDeviceLinuxPulse::StopRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1617,7 +1617,7 @@
return (_playIsInitialized);
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StartPlayout()
+int32_t AudioDeviceLinuxPulse::StartPlayout()
{
if (!_playIsInitialized)
{
@@ -1665,7 +1665,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::StopPlayout()
+int32_t AudioDeviceLinuxPulse::StopPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1730,17 +1730,17 @@
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 @@
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 @@
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 @@
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::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 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitSamplingFrequency()
+int32_t AudioDeviceLinuxPulse::InitSamplingFrequency()
{
PaLock();
@@ -2142,13 +2142,13 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioDeviceLinuxPulse::InitPulseAudio()
+int32_t AudioDeviceLinuxPulse::InitPulseAudio()
{
int retVal = 0;
@@ -2365,7 +2365,7 @@
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 @@
}
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 @@
" 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 @@
// 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 @@
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 @@
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 @@
{
// 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 @@
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 @@
}
}
- 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 @@
}
// 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 @@
if (!_recording)
{
// Update the playout delay
- _sndCardPlayDelay = (WebRtc_UWord32) (LatencyUsecs(_playStream)
+ _sndCardPlayDelay = (uint32_t) (LatencyUsecs(_playStream)
/ 1000);
}
@@ -2954,8 +2954,7 @@
_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 @@
UnLock();
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
" requesting data");
- WebRtc_UWord32 nSamples =
+ uint32_t nSamples =
_ptrAudioBuffer->RequestPlayoutData(numPlaySamples);
Lock();
@@ -3157,7 +3156,7 @@
break;
}
- _sndCardRecDelay = (WebRtc_UWord32) (LatencyUsecs(_recStream)
+ _sndCardRecDelay = (uint32_t) (LatencyUsecs(_recStream)
/ 1000);
// Drop lock for sigslot dispatch, which could take a while.
diff --git a/modules/audio_device/linux/audio_device_pulse_linux.h b/modules/audio_device/linux/audio_device_pulse_linux.h
index 1a71fe5..ab079ef 100644
--- a/modules/audio_device/linux/audio_device_pulse_linux.h
+++ b/modules/audio_device/linux/audio_device_pulse_linux.h
@@ -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 @@
// 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 @@
// 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 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 @@
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 @@
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 @@
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 @@
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;
};
diff --git a/modules/audio_device/linux/audio_device_utility_linux.cc b/modules/audio_device/linux/audio_device_utility_linux.cc
index 25abcc9..2de4bac 100644
--- a/modules/audio_device/linux/audio_device_utility_linux.cc
+++ b/modules/audio_device/linux/audio_device_utility_linux.cc
@@ -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 @@
// ============================================================================
-WebRtc_Word32 AudioDeviceUtilityLinux::Init()
+int32_t AudioDeviceUtilityLinux::Init()
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
diff --git a/modules/audio_device/linux/audio_device_utility_linux.h b/modules/audio_device/linux/audio_device_utility_linux.h
index 0e3c410..22549c6 100644
--- a/modules/audio_device/linux/audio_device_utility_linux.h
+++ b/modules/audio_device/linux/audio_device_utility_linux.h
@@ -21,14 +21,14 @@
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
diff --git a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
index 2e12f0a..e3acebd 100644
--- a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
+++ b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
@@ -24,7 +24,7 @@
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 @@
// PUBLIC METHODS
// ============================================================================
-WebRtc_Word32 AudioMixerManagerLinuxALSA::Close()
+int32_t AudioMixerManagerLinuxALSA::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -67,7 +67,7 @@
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseSpeaker()
+int32_t AudioMixerManagerLinuxALSA::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -109,7 +109,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::CloseMicrophone()
+int32_t AudioMixerManagerLinuxALSA::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -160,7 +160,7 @@
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 @@
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 @@
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 @@
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 @@
" 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 @@
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 @@
LATE(snd_strerror)(errVal));
}
- minVolume = static_cast<WebRtc_UWord32> (minVol);
+ minVolume = static_cast<uint32_t> (minVol);
return 0;
}
@@ -510,8 +510,8 @@
// SetMaxSpeakerVolume
// ----------------------------------------------------------------------------
- WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMaxSpeakerVolume(
- WebRtc_UWord32 maxVolume)
+ int32_t AudioMixerManagerLinuxALSA::SetMaxSpeakerVolume(
+ uint32_t maxVolume)
{
if (_outputMixerElement == NULL)
@@ -551,8 +551,8 @@
// 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::SpeakerVolumeStepSize(
- WebRtc_UWord16& stepSize) const
+int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeStepSize(
+ uint16_t& stepSize) const
{
if (_outputMixerHandle == NULL)
@@ -606,7 +606,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
+int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
bool& available)
{
if (_outputMixerElement == NULL)
@@ -621,7 +621,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(
+int32_t AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(
bool& available)
{
if (_outputMixerElement == NULL)
@@ -636,7 +636,7 @@
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 @@
return (0);
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const
+int32_t AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const
{
if (_outputMixerElement == NULL)
@@ -719,7 +719,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(
+int32_t AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(
bool& available)
{
if (_inputMixerElement == NULL)
@@ -733,7 +733,7 @@
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 @@
return (0);
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const
+int32_t AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const
{
if (_inputMixerElement == NULL)
@@ -816,7 +816,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
+int32_t AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
bool& available)
{
if (_inputMixerHandle == NULL)
@@ -832,7 +832,7 @@
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 @@
return (0);
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
+int32_t AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
{
if (_inputMixerHandle == NULL)
@@ -878,7 +878,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
+int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
bool& available)
{
if (_inputMixerElement == NULL)
@@ -893,8 +893,8 @@
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 @@
// SetMaxMicrophoneVolume
// ----------------------------------------------------------------------------
- WebRtc_Word32 AudioMixerManagerLinuxALSA::SetMaxMicrophoneVolume(
- WebRtc_UWord32 maxVolume)
+ int32_t AudioMixerManagerLinuxALSA::SetMaxMicrophoneVolume(
+ uint32_t maxVolume)
{
if (_inputMixerElement == NULL)
@@ -972,8 +972,8 @@
// 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::MicrophoneVolume(
- WebRtc_UWord32& volume) const
+int32_t AudioMixerManagerLinuxALSA::MicrophoneVolume(
+ uint32_t& volume) const
{
if (_inputMixerElement == NULL)
@@ -1042,13 +1042,13 @@
" 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 @@
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 @@
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 @@
// 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 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxALSA::LoadSpeakerMixerElement() const
+int32_t AudioMixerManagerLinuxALSA::LoadSpeakerMixerElement() const
{
int errVal = LATE(snd_mixer_load)(_outputMixerHandle);
if (errVal < 0)
diff --git a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
index 94ea982..99ca296 100644
--- a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
+++ b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
@@ -24,47 +24,47 @@
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;
diff --git a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
index a0b6852..b32718c 100644
--- a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
+++ b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
@@ -26,7 +26,7 @@
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 @@
// PUBLIC METHODS
// ============================================================================
-WebRtc_Word32 AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
+int32_t AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
pa_threaded_mainloop* mainloop,
pa_context* context)
{
@@ -88,7 +88,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::Close()
+int32_t AudioMixerManagerLinuxPulse::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -106,7 +106,7 @@
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseSpeaker()
+int32_t AudioMixerManagerLinuxPulse::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -120,7 +120,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::CloseMicrophone()
+int32_t AudioMixerManagerLinuxPulse::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -134,7 +134,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
if (!GetSinkInputInfo())
return -1;
- volume = static_cast<WebRtc_UWord32> (_paVolume);
+ volume = static_cast<uint32_t> (_paVolume);
ResetCallbackVariables();
} else
{
@@ -331,8 +331,8 @@
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 @@
// 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 @@
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 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioMixerManagerLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@@ -406,7 +406,7 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioMixerManagerLinuxPulse::SpeakerMuteIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@@ -422,7 +422,7 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const
+int32_t AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const
{
if (_paOutputDeviceIndex == -1)
@@ -510,7 +510,7 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioMixerManagerLinuxPulse::StereoPlayoutIsAvailable(bool& available)
{
if (_paOutputDeviceIndex == -1)
@@ -546,7 +546,7 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable(bool& available)
{
if (_paInputDeviceIndex == -1)
@@ -602,7 +602,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMuteIsAvailable(
+int32_t AudioMixerManagerLinuxPulse::MicrophoneMuteIsAvailable(
bool& available)
{
if (_paInputDeviceIndex == -1)
@@ -618,7 +618,7 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const
+int32_t AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const
{
if (_paInputDeviceIndex == -1)
@@ -720,7 +720,7 @@
return 0;
}
-WebRtc_Word32
+int32_t
AudioMixerManagerLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
{
if (_paInputDeviceIndex == -1)
@@ -738,7 +738,7 @@
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 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
+int32_t AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
{
if (_paInputDeviceIndex == -1)
@@ -784,7 +784,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
+int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
bool& available)
{
if (_paInputDeviceIndex == -1)
@@ -800,8 +800,8 @@
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 @@
return -1;
}
- WebRtc_UWord8 channels = _paChannels;
+ uint8_t channels = _paChannels;
ResetCallbackVariables();
pa_cvolume cVolumes;
@@ -898,8 +898,8 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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()"
diff --git a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
index db0a559..3d91395 100644
--- a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
+++ b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
@@ -29,43 +29,43 @@
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:
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 @@
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;
};
diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc
index ecc95d7..25514c4 100644
--- a/modules/audio_device/mac/audio_device_mac.cc
+++ b/modules/audio_device/mac/audio_device_mac.cc
@@ -76,7 +76,7 @@
{
while (1)
{
- WebRtc_Word32 value = *theValue;
+ int32_t value = *theValue;
if (OSAtomicCompareAndSwap32Barrier(value, value, theValue) == true)
{
return value;
@@ -87,7 +87,7 @@
// CoreAudio errors are best interpreted as four character strings.
void AudioDeviceMac::logCAMsg(const TraceLevel level,
const TraceModule module,
- const WebRtc_Word32 id, const char *msg,
+ const int32_t id, const char *msg,
const char *err)
{
assert(msg != NULL);
@@ -102,7 +102,7 @@
#endif
}
-AudioDeviceMac::AudioDeviceMac(const WebRtc_Word32 id) :
+AudioDeviceMac::AudioDeviceMac(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_stopEventRec(*EventWrapper::Create()),
@@ -251,14 +251,14 @@
_ptrAudioBuffer->SetPlayoutChannels(N_PLAY_CHANNELS);
}
-WebRtc_Word32 AudioDeviceMac::ActiveAudioLayer(
+int32_t AudioDeviceMac::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const
{
audioLayer = AudioDeviceModule::kPlatformDefaultAudio;
return 0;
}
-WebRtc_Word32 AudioDeviceMac::Init()
+int32_t AudioDeviceMac::Init()
{
CriticalSectionScoped lock(&_critSect);
@@ -421,7 +421,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::Terminate()
+int32_t AudioDeviceMac::Terminate()
{
if (!_initialized)
@@ -479,7 +479,7 @@
return (_initialized);
}
-WebRtc_Word32 AudioDeviceMac::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceMac::SpeakerIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -507,7 +507,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::InitSpeaker()
+int32_t AudioDeviceMac::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -538,7 +538,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceMac::MicrophoneIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -567,7 +567,7 @@
}
-WebRtc_Word32 AudioDeviceMac::InitMicrophone()
+int32_t AudioDeviceMac::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -608,7 +608,7 @@
return (_mixerManager.MicrophoneIsInitialized());
}
-WebRtc_Word32 AudioDeviceMac::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceMac::SpeakerVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -638,16 +638,16 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceMac::SetSpeakerVolume(uint32_t volume)
{
return (_mixerManager.SetSpeakerVolume(volume));
}
-WebRtc_Word32 AudioDeviceMac::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceMac::SpeakerVolume(uint32_t& volume) const
{
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_mixerManager.SpeakerVolume(level) == -1)
{
@@ -658,8 +658,8 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetWaveOutVolume(WebRtc_UWord16 volumeLeft,
- WebRtc_UWord16 volumeRight)
+int32_t AudioDeviceMac::SetWaveOutVolume(uint16_t volumeLeft,
+ uint16_t volumeRight)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -667,9 +667,9 @@
return -1;
}
-WebRtc_Word32
-AudioDeviceMac::WaveOutVolume(WebRtc_UWord16& /*volumeLeft*/,
- WebRtc_UWord16& /*volumeRight*/) const
+int32_t
+AudioDeviceMac::WaveOutVolume(uint16_t& /*volumeLeft*/,
+ uint16_t& /*volumeRight*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -677,10 +677,10 @@
return -1;
}
-WebRtc_Word32 AudioDeviceMac::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceMac::MaxSpeakerVolume(uint32_t& maxVolume) const
{
- WebRtc_UWord32 maxVol(0);
+ uint32_t maxVol(0);
if (_mixerManager.MaxSpeakerVolume(maxVol) == -1)
{
@@ -691,10 +691,10 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceMac::MinSpeakerVolume(uint32_t& minVolume) const
{
- WebRtc_UWord32 minVol(0);
+ uint32_t minVol(0);
if (_mixerManager.MinSpeakerVolume(minVol) == -1)
{
@@ -705,11 +705,11 @@
return 0;
}
-WebRtc_Word32
-AudioDeviceMac::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t
+AudioDeviceMac::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
{
@@ -720,7 +720,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceMac::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -754,12 +754,12 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetSpeakerMute(bool enable)
+int32_t AudioDeviceMac::SetSpeakerMute(bool enable)
{
return (_mixerManager.SetSpeakerMute(enable));
}
-WebRtc_Word32 AudioDeviceMac::SpeakerMute(bool& enabled) const
+int32_t AudioDeviceMac::SpeakerMute(bool& enabled) const
{
bool muted(0);
@@ -773,7 +773,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceMac::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -806,12 +806,12 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetMicrophoneMute(bool enable)
+int32_t AudioDeviceMac::SetMicrophoneMute(bool enable)
{
return (_mixerManager.SetMicrophoneMute(enable));
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneMute(bool& enabled) const
+int32_t AudioDeviceMac::MicrophoneMute(bool& enabled) const
{
bool muted(0);
@@ -825,7 +825,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceMac::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -858,13 +858,13 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetMicrophoneBoost(bool enable)
+int32_t AudioDeviceMac::SetMicrophoneBoost(bool enable)
{
return (_mixerManager.SetMicrophoneBoost(enable));
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneBoost(bool& enabled) const
+int32_t AudioDeviceMac::MicrophoneBoost(bool& enabled) const
{
bool onOff(0);
@@ -878,7 +878,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceMac::StereoRecordingIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -906,7 +906,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetStereoRecording(bool enable)
+int32_t AudioDeviceMac::SetStereoRecording(bool enable)
{
if (enable)
@@ -917,7 +917,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StereoRecording(bool& enabled) const
+int32_t AudioDeviceMac::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@@ -928,7 +928,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceMac::StereoPlayoutIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -956,7 +956,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetStereoPlayout(bool enable)
+int32_t AudioDeviceMac::SetStereoPlayout(bool enable)
{
if (enable)
@@ -967,7 +967,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceMac::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@@ -978,7 +978,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetAGC(bool enable)
+int32_t AudioDeviceMac::SetAGC(bool enable)
{
_AGC = enable;
@@ -992,7 +992,7 @@
return _AGC;
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioDeviceMac::MicrophoneVolumeIsAvailable(bool& available)
{
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -1023,16 +1023,16 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceMac::SetMicrophoneVolume(uint32_t volume)
{
return (_mixerManager.SetMicrophoneVolume(volume));
}
-WebRtc_Word32 AudioDeviceMac::MicrophoneVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceMac::MicrophoneVolume(uint32_t& volume) const
{
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1)
{
@@ -1045,11 +1045,11 @@
return 0;
}
-WebRtc_Word32
-AudioDeviceMac::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
+int32_t
+AudioDeviceMac::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
- WebRtc_UWord32 maxVol(0);
+ uint32_t maxVol(0);
if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1)
{
@@ -1060,11 +1060,11 @@
return 0;
}
-WebRtc_Word32
-AudioDeviceMac::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
+int32_t
+AudioDeviceMac::MinMicrophoneVolume(uint32_t& minVolume) const
{
- WebRtc_UWord32 minVol(0);
+ uint32_t minVol(0);
if (_mixerManager.MinMicrophoneVolume(minVol) == -1)
{
@@ -1075,11 +1075,11 @@
return 0;
}
-WebRtc_Word32
-AudioDeviceMac::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t
+AudioDeviceMac::MicrophoneVolumeStepSize(uint16_t& stepSize) const
{
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
{
@@ -1090,7 +1090,7 @@
return 0;
}
-WebRtc_Word16 AudioDeviceMac::PlayoutDevices()
+int16_t AudioDeviceMac::PlayoutDevices()
{
AudioDeviceID playDevices[MaxNumberDevices];
@@ -1098,7 +1098,7 @@
MaxNumberDevices);
}
-WebRtc_Word32 AudioDeviceMac::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceMac::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@@ -1107,8 +1107,8 @@
}
AudioDeviceID playDevices[MaxNumberDevices];
- WebRtc_UWord32 nDevices = GetNumberDevices(kAudioDevicePropertyScopeOutput,
- playDevices, MaxNumberDevices);
+ uint32_t nDevices = GetNumberDevices(kAudioDevicePropertyScopeOutput,
+ playDevices, MaxNumberDevices);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable waveform-audio output devices is %u",
nDevices);
@@ -1126,7 +1126,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::SetPlayoutDevice(
+int32_t AudioDeviceMac::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -1134,13 +1134,13 @@
return -1;
}
-WebRtc_Word32 AudioDeviceMac::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceMac::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))
{
@@ -1157,13 +1157,13 @@
return GetDeviceName(kAudioDevicePropertyScopeOutput, index, name);
}
-WebRtc_Word32 AudioDeviceMac::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceMac::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))
{
@@ -1180,7 +1180,7 @@
return GetDeviceName(kAudioDevicePropertyScopeInput, index, name);
}
-WebRtc_Word16 AudioDeviceMac::RecordingDevices()
+int16_t AudioDeviceMac::RecordingDevices()
{
AudioDeviceID recDevices[MaxNumberDevices];
@@ -1188,7 +1188,7 @@
MaxNumberDevices);
}
-WebRtc_Word32 AudioDeviceMac::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceMac::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@@ -1197,8 +1197,8 @@
}
AudioDeviceID recDevices[MaxNumberDevices];
- WebRtc_UWord32 nDevices = GetNumberDevices(kAudioDevicePropertyScopeInput,
- recDevices, MaxNumberDevices);
+ uint32_t nDevices = GetNumberDevices(kAudioDevicePropertyScopeInput,
+ recDevices, MaxNumberDevices);
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" number of availiable waveform-audio input devices is %u",
nDevices);
@@ -1217,7 +1217,7 @@
}
-WebRtc_Word32
+int32_t
AudioDeviceMac::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType /*device*/)
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
@@ -1225,7 +1225,7 @@
return -1;
}
-WebRtc_Word32 AudioDeviceMac::PlayoutIsAvailable(bool& available)
+int32_t AudioDeviceMac::PlayoutIsAvailable(bool& available)
{
available = true;
@@ -1253,7 +1253,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::RecordingIsAvailable(bool& available)
+int32_t AudioDeviceMac::RecordingIsAvailable(bool& available)
{
available = true;
@@ -1281,7 +1281,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::InitPlayout()
+int32_t AudioDeviceMac::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1437,7 +1437,7 @@
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetPlayoutSampleRate(N_PLAY_SAMPLES_PER_SEC);
- _ptrAudioBuffer->SetPlayoutChannels((WebRtc_UWord8) _playChannels);
+ _ptrAudioBuffer->SetPlayoutChannels((uint8_t) _playChannels);
}
_renderDelayOffsetSamples = _renderBufSizeSamples - N_BUFFERS_OUT
@@ -1500,7 +1500,7 @@
size = sizeof(UInt32);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(_outputDeviceID,
&propertyAddress, 0, NULL, &size, &latency));
- _renderLatencyUs = (WebRtc_UWord32) ((1.0e6 * latency)
+ _renderLatencyUs = (uint32_t) ((1.0e6 * latency)
/ _outStreamFormat.mSampleRate);
// Get render stream latency
@@ -1514,7 +1514,7 @@
latency = 0;
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(_outputDeviceID,
&propertyAddress, 0, NULL, &size, &latency));
- _renderLatencyUs += (WebRtc_UWord32) ((1.0e6 * latency)
+ _renderLatencyUs += (uint32_t) ((1.0e6 * latency)
/ _outStreamFormat.mSampleRate);
// Listen for format changes
@@ -1544,7 +1544,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::InitRecording()
+int32_t AudioDeviceMac::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1655,7 +1655,7 @@
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetRecordingSampleRate(N_REC_SAMPLES_PER_SEC);
- _ptrAudioBuffer->SetRecordingChannels((WebRtc_UWord8) _recChannels);
+ _ptrAudioBuffer->SetRecordingChannels((uint8_t) _recChannels);
}
_inDesiredFormat.mSampleRate = N_REC_SAMPLES_PER_SEC;
@@ -1760,7 +1760,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StartRecording()
+int32_t AudioDeviceMac::StartRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1804,7 +1804,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StopRecording()
+int32_t AudioDeviceMac::StopRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -1927,7 +1927,7 @@
return (_playIsInitialized);
}
-WebRtc_Word32 AudioDeviceMac::StartPlayout()
+int32_t AudioDeviceMac::StartPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1960,7 +1960,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::StopPlayout()
+int32_t AudioDeviceMac::StopPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -2050,19 +2050,19 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::PlayoutDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceMac::PlayoutDelay(uint16_t& delayMS) const
{
int32_t renderDelayUs = AtomicGet32(&_renderDelayUs);
- delayMS = static_cast<WebRtc_UWord16> (1e-3 * (renderDelayUs
- + _renderLatencyUs) + 0.5);
+ delayMS = static_cast<uint16_t> (1e-3 * (renderDelayUs + _renderLatencyUs) +
+ 0.5);
return 0;
}
-WebRtc_Word32 AudioDeviceMac::RecordingDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceMac::RecordingDelay(uint16_t& delayMS) const
{
int32_t captureDelayUs = AtomicGet32(&_captureDelayUs);
- delayMS = static_cast<WebRtc_UWord16> (1e-3 * (captureDelayUs
- + _captureLatencyUs) + 0.5);
+ delayMS = static_cast<uint16_t> (1e-3 * (captureDelayUs +
+ _captureLatencyUs) + 0.5);
return 0;
}
@@ -2071,9 +2071,9 @@
return (_playing);
}
-WebRtc_Word32 AudioDeviceMac::SetPlayoutBuffer(
+int32_t AudioDeviceMac::SetPlayoutBuffer(
const AudioDeviceModule::BufferType type,
- WebRtc_UWord16 sizeMS)
+ uint16_t sizeMS)
{
if (type != AudioDeviceModule::kFixedBufferSize)
@@ -2088,9 +2088,9 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::PlayoutBuffer(
+int32_t AudioDeviceMac::PlayoutBuffer(
AudioDeviceModule::BufferType& type,
- WebRtc_UWord16& sizeMS) const
+ uint16_t& sizeMS) const
{
type = _playBufType;
@@ -2100,7 +2100,7 @@
}
// Not implemented for Mac.
-WebRtc_Word32 AudioDeviceMac::CPULoad(WebRtc_UWord16& /*load*/) const
+int32_t AudioDeviceMac::CPULoad(uint16_t& /*load*/) const
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -2153,10 +2153,10 @@
// Private Methods
// ============================================================================
-WebRtc_Word32
+int32_t
AudioDeviceMac::GetNumberDevices(const AudioObjectPropertyScope scope,
AudioDeviceID scopedDeviceIds[],
- const WebRtc_UWord32 deviceListLength)
+ const uint32_t deviceListLength)
{
OSStatus err = noErr;
@@ -2291,9 +2291,9 @@
return numberScopedDevices;
}
-WebRtc_Word32
+int32_t
AudioDeviceMac::GetDeviceName(const AudioObjectPropertyScope scope,
- const WebRtc_UWord16 index,
+ const uint16_t index,
char* name)
{
OSStatus err = noErr;
@@ -2371,9 +2371,9 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::InitDevice(const WebRtc_UWord16 userDeviceIndex,
- AudioDeviceID& deviceId,
- const bool isInput)
+int32_t AudioDeviceMac::InitDevice(const uint16_t userDeviceIndex,
+ AudioDeviceID& deviceId,
+ const bool isInput)
{
OSStatus err = noErr;
UInt32 size = 0;
@@ -2507,7 +2507,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::HandleDeviceChange()
+int32_t AudioDeviceMac::HandleDeviceChange()
{
OSStatus err = noErr;
@@ -2579,7 +2579,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::HandleStreamFormatChange(
+int32_t AudioDeviceMac::HandleStreamFormatChange(
const AudioObjectID objectId,
const AudioObjectPropertyAddress propertyAddress)
{
@@ -2652,7 +2652,7 @@
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetRecordingSampleRate(N_REC_SAMPLES_PER_SEC);
- _ptrAudioBuffer->SetRecordingChannels((WebRtc_UWord8) _recChannels);
+ _ptrAudioBuffer->SetRecordingChannels((uint8_t) _recChannels);
}
// Recreate the converter with the new format
@@ -2681,7 +2681,7 @@
{
// Update audio buffer with the selected parameters
_ptrAudioBuffer->SetPlayoutSampleRate(N_PLAY_SAMPLES_PER_SEC);
- _ptrAudioBuffer->SetPlayoutChannels((WebRtc_UWord8) _playChannels);
+ _ptrAudioBuffer->SetPlayoutChannels((uint8_t) _playChannels);
}
_renderDelayOffsetSamples = _renderBufSizeSamples - N_BUFFERS_OUT
@@ -2699,7 +2699,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::HandleDataSourceChange(
+int32_t AudioDeviceMac::HandleDataSourceChange(
const AudioObjectID objectId,
const AudioObjectPropertyAddress propertyAddress)
{
@@ -2730,7 +2730,7 @@
return 0;
}
-WebRtc_Word32 AudioDeviceMac::HandleProcessorOverload(
+int32_t AudioDeviceMac::HandleProcessorOverload(
const AudioObjectPropertyAddress propertyAddress)
{
// TODO(xians): we probably want to notify the user in some way of the
@@ -3077,7 +3077,7 @@
}
}
- WebRtc_Word8 playBuffer[4 * ENGINE_PLAY_BUF_SIZE_IN_SAMPLES];
+ int8_t playBuffer[4 * ENGINE_PLAY_BUF_SIZE_IN_SAMPLES];
if (!_ptrAudioBuffer)
{
@@ -3087,7 +3087,7 @@
}
// Ask for new PCM data to be played out using the AudioDeviceBuffer.
- WebRtc_UWord32 nSamples =
+ uint32_t nSamples =
_ptrAudioBuffer->RequestPlayoutData(ENGINE_PLAY_BUF_SIZE_IN_SAMPLES);
nSamples = _ptrAudioBuffer->GetPlayoutData(playBuffer);
@@ -3097,14 +3097,14 @@
" invalid number of output samples(%d)", nSamples);
}
- WebRtc_UWord32 nOutSamples = nSamples * _outDesiredFormat.mChannelsPerFrame;
+ uint32_t nOutSamples = nSamples * _outDesiredFormat.mChannelsPerFrame;
SInt16 *pPlayBuffer = (SInt16 *) &playBuffer;
if (_macBookProPanRight && (_playChannels == 2))
{
// Mix entirely into the right channel and zero the left channel.
SInt32 sampleInt32 = 0;
- for (WebRtc_UWord32 sampleIdx = 0; sampleIdx < nOutSamples; sampleIdx
+ for (uint32_t sampleIdx = 0; sampleIdx < nOutSamples; sampleIdx
+= 2)
{
sampleInt32 = pPlayBuffer[sampleIdx];
@@ -3169,18 +3169,19 @@
// TODO(xians): what if the returned size is incorrect?
if (size == ENGINE_REC_BUF_SIZE_IN_SAMPLES)
{
- WebRtc_UWord32 currentMicLevel(0);
- WebRtc_UWord32 newMicLevel(0);
- WebRtc_Word32 msecOnPlaySide;
- WebRtc_Word32 msecOnRecordSide;
+ uint32_t currentMicLevel(0);
+ uint32_t newMicLevel(0);
+ int32_t msecOnPlaySide;
+ int32_t msecOnRecordSide;
int32_t captureDelayUs = AtomicGet32(&_captureDelayUs);
int32_t renderDelayUs = AtomicGet32(&_renderDelayUs);
- msecOnPlaySide = static_cast<WebRtc_Word32> (1e-3 * (renderDelayUs
- + _renderLatencyUs) + 0.5);
- msecOnRecordSide = static_cast<WebRtc_Word32> (1e-3 * (captureDelayUs
- + _captureLatencyUs) + 0.5);
+ msecOnPlaySide = static_cast<int32_t> (1e-3 * (renderDelayUs +
+ _renderLatencyUs) + 0.5);
+ msecOnRecordSide = static_cast<int32_t> (1e-3 * (captureDelayUs +
+ _captureLatencyUs) +
+ 0.5);
if (!_ptrAudioBuffer)
{
@@ -3191,8 +3192,8 @@
// store the recorded buffer (no action will be taken if the
// #recorded samples is not a full buffer)
- _ptrAudioBuffer->SetRecordedBuffer((WebRtc_Word8*) &recordBuffer,
- (WebRtc_UWord32) size);
+ _ptrAudioBuffer->SetRecordedBuffer((int8_t*) &recordBuffer,
+ (uint32_t) size);
if (AGC())
{
diff --git a/modules/audio_device/mac/audio_device_mac.h b/modules/audio_device/mac/audio_device_mac.h
index 5106153..9a05e8d 100644
--- a/modules/audio_device/mac/audio_device_mac.h
+++ b/modules/audio_device/mac/audio_device_mac.h
@@ -26,17 +26,15 @@
class EventWrapper;
class ThreadWrapper;
-const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 48000;
-const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 48000;
+const uint32_t N_REC_SAMPLES_PER_SEC = 48000;
+const uint32_t N_PLAY_SAMPLES_PER_SEC = 48000;
-const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording
-const WebRtc_UWord32 N_PLAY_CHANNELS = 2; // default is stereo playout
-const WebRtc_UWord32 N_DEVICE_CHANNELS = 8;
+const uint32_t N_REC_CHANNELS = 1; // default is mono recording
+const uint32_t N_PLAY_CHANNELS = 2; // default is stereo playout
+const uint32_t N_DEVICE_CHANNELS = 8;
-const WebRtc_UWord32 ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC
- / 100);
-const WebRtc_UWord32 ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC
- / 100);
+const uint32_t ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC / 100);
+const uint32_t ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC / 100);
enum
{
@@ -51,133 +49,132 @@
N_BUFFERS_OUT = 3
}; // Must be at least N_BLOCKS_IO
-const WebRtc_UWord32 TIMER_PERIOD_MS = (2 * 10 * N_BLOCKS_IO * 1000000);
+const uint32_t TIMER_PERIOD_MS = (2 * 10 * N_BLOCKS_IO * 1000000);
-const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = (ENGINE_REC_BUF_SIZE_IN_SAMPLES
+const uint32_t REC_BUF_SIZE_IN_SAMPLES = (ENGINE_REC_BUF_SIZE_IN_SAMPLES
* N_DEVICE_CHANNELS * N_BUFFERS_IN);
-const WebRtc_UWord32 PLAY_BUF_SIZE_IN_SAMPLES =
+const uint32_t PLAY_BUF_SIZE_IN_SAMPLES =
(ENGINE_PLAY_BUF_SIZE_IN_SAMPLES * N_PLAY_CHANNELS * N_BUFFERS_OUT);
class AudioDeviceMac: public AudioDeviceGeneric
{
public:
- AudioDeviceMac(const WebRtc_Word32 id);
+ AudioDeviceMac(const int32_t id);
~AudioDeviceMac();
// 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;
// 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;
// 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 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;
@@ -203,7 +200,7 @@
_critSect.Leave();
}
;
- WebRtc_Word32 Id()
+ int32_t Id()
{
return _id;
}
@@ -213,18 +210,18 @@
static void logCAMsg(const TraceLevel level,
const TraceModule module,
- const WebRtc_Word32 id, const char *msg,
+ const int32_t id, const char *msg,
const char *err);
- WebRtc_Word32 GetNumberDevices(const AudioObjectPropertyScope scope,
- AudioDeviceID scopedDeviceIds[],
- const WebRtc_UWord32 deviceListLength);
+ int32_t GetNumberDevices(const AudioObjectPropertyScope scope,
+ AudioDeviceID scopedDeviceIds[],
+ const uint32_t deviceListLength);
- WebRtc_Word32 GetDeviceName(const AudioObjectPropertyScope scope,
- const WebRtc_UWord16 index, char* name);
+ int32_t GetDeviceName(const AudioObjectPropertyScope scope,
+ const uint16_t index, char* name);
- WebRtc_Word32 InitDevice(WebRtc_UWord16 userDeviceIndex,
- AudioDeviceID& deviceId, bool isInput);
+ int32_t InitDevice(uint16_t userDeviceIndex,
+ AudioDeviceID& deviceId, bool isInput);
static OSStatus
objectListenerProc(AudioObjectID objectId, UInt32 numberAddresses,
@@ -235,17 +232,17 @@
implObjectListenerProc(AudioObjectID objectId, UInt32 numberAddresses,
const AudioObjectPropertyAddress addresses[]);
- WebRtc_Word32 HandleDeviceChange();
+ int32_t HandleDeviceChange();
- WebRtc_Word32
+ int32_t
HandleStreamFormatChange(AudioObjectID objectId,
AudioObjectPropertyAddress propertyAddress);
- WebRtc_Word32
+ int32_t
HandleDataSourceChange(AudioObjectID objectId,
AudioObjectPropertyAddress propertyAddress);
- WebRtc_Word32
+ int32_t
HandleProcessorOverload(AudioObjectPropertyAddress propertyAddress);
private:
@@ -306,15 +303,15 @@
ThreadWrapper* _captureWorkerThread;
ThreadWrapper* _renderWorkerThread;
- WebRtc_UWord32 _captureWorkerThreadId;
- WebRtc_UWord32 _renderWorkerThreadId;
+ uint32_t _captureWorkerThreadId;
+ uint32_t _renderWorkerThreadId;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioMixerManagerMac _mixerManager;
- WebRtc_UWord16 _inputDeviceIndex;
- WebRtc_UWord16 _outputDeviceIndex;
+ uint16_t _inputDeviceIndex;
+ uint16_t _outputDeviceIndex;
AudioDeviceID _inputDeviceID;
AudioDeviceID _outputDeviceID;
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
@@ -324,8 +321,8 @@
bool _inputDeviceIsSpecified;
bool _outputDeviceIsSpecified;
- WebRtc_UWord8 _recChannels;
- WebRtc_UWord8 _playChannels;
+ uint8_t _recChannels;
+ uint8_t _playChannels;
Float32* _captureBufData;
SInt16* _renderBufData;
@@ -361,22 +358,22 @@
AudioStreamBasicDescription _inStreamFormat;
AudioStreamBasicDescription _inDesiredFormat;
- WebRtc_UWord32 _captureLatencyUs;
- WebRtc_UWord32 _renderLatencyUs;
+ uint32_t _captureLatencyUs;
+ uint32_t _renderLatencyUs;
// Atomically set variables
mutable int32_t _captureDelayUs;
mutable int32_t _renderDelayUs;
- WebRtc_Word32 _renderDelayOffsetSamples;
+ int32_t _renderDelayOffsetSamples;
private:
- WebRtc_UWord16 _playBufDelayFixed; // fixed playback delay
+ uint16_t _playBufDelayFixed; // fixed playback delay
- WebRtc_UWord16 _playWarning;
- WebRtc_UWord16 _playError;
- WebRtc_UWord16 _recWarning;
- WebRtc_UWord16 _recError;
+ uint16_t _playWarning;
+ uint16_t _playError;
+ uint16_t _recWarning;
+ uint16_t _recError;
PaUtilRingBuffer* _paCaptureBuffer;
PaUtilRingBuffer* _paRenderBuffer;
@@ -384,8 +381,8 @@
semaphore_t _renderSemaphore;
semaphore_t _captureSemaphore;
- WebRtc_UWord32 _captureBufSizeSamples;
- WebRtc_UWord32 _renderBufSizeSamples;
+ uint32_t _captureBufSizeSamples;
+ uint32_t _renderBufSizeSamples;
};
} // namespace webrtc
diff --git a/modules/audio_device/mac/audio_device_utility_mac.cc b/modules/audio_device/mac/audio_device_utility_mac.cc
index f59fd5b..ac8e118 100644
--- a/modules/audio_device/mac/audio_device_utility_mac.cc
+++ b/modules/audio_device/mac/audio_device_utility_mac.cc
@@ -16,7 +16,7 @@
namespace webrtc
{
-AudioDeviceUtilityMac::AudioDeviceUtilityMac(const WebRtc_Word32 id) :
+AudioDeviceUtilityMac::AudioDeviceUtilityMac(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id)
{
@@ -41,7 +41,7 @@
delete &_critSect;
}
-WebRtc_Word32 AudioDeviceUtilityMac::Init()
+int32_t AudioDeviceUtilityMac::Init()
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
diff --git a/modules/audio_device/mac/audio_device_utility_mac.h b/modules/audio_device/mac/audio_device_utility_mac.h
index 4743e22..6c48b38 100644
--- a/modules/audio_device/mac/audio_device_utility_mac.h
+++ b/modules/audio_device/mac/audio_device_utility_mac.h
@@ -21,14 +21,14 @@
class AudioDeviceUtilityMac: public AudioDeviceUtility
{
public:
- AudioDeviceUtilityMac(const WebRtc_Word32 id);
+ AudioDeviceUtilityMac(const int32_t id);
~AudioDeviceUtilityMac();
- virtual WebRtc_Word32 Init();
+ virtual int32_t Init();
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
};
} // namespace webrtc
diff --git a/modules/audio_device/mac/audio_mixer_manager_mac.cc b/modules/audio_device/mac/audio_mixer_manager_mac.cc
index bd53c57..db4cfab 100644
--- a/modules/audio_device/mac/audio_mixer_manager_mac.cc
+++ b/modules/audio_device/mac/audio_mixer_manager_mac.cc
@@ -43,7 +43,7 @@
} \
} while(0)
-AudioMixerManagerMac::AudioMixerManagerMac(const WebRtc_Word32 id) :
+AudioMixerManagerMac::AudioMixerManagerMac(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
_inputDeviceID(kAudioObjectUnknown),
@@ -69,7 +69,7 @@
// PUBLIC METHODS
// ============================================================================
-WebRtc_Word32 AudioMixerManagerMac::Close()
+int32_t AudioMixerManagerMac::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -83,7 +83,7 @@
}
-WebRtc_Word32 AudioMixerManagerMac::CloseSpeaker()
+int32_t AudioMixerManagerMac::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -96,7 +96,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::CloseMicrophone()
+int32_t AudioMixerManagerMac::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s",
__FUNCTION__);
@@ -109,7 +109,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::OpenSpeaker(AudioDeviceID deviceID)
+int32_t AudioMixerManagerMac::OpenSpeaker(AudioDeviceID deviceID)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::OpenSpeaker(id=%d)", deviceID);
@@ -164,7 +164,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID)
+int32_t AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::OpenMicrophone(id=%d)", deviceID);
@@ -233,7 +233,7 @@
return (_inputDeviceID != kAudioObjectUnknown);
}
-WebRtc_Word32 AudioMixerManagerMac::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioMixerManagerMac::SetSpeakerVolume(uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::SetSpeakerVolume(volume=%u)", volume);
@@ -299,7 +299,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioMixerManagerMac::SpeakerVolume(uint32_t& volume) const
{
if (_outputDeviceID == kAudioObjectUnknown)
@@ -329,7 +329,7 @@
&propertyAddress, 0, NULL, &size, &vol));
// vol 0.0 to 1.0 -> convert to 0 - 255
- volume = static_cast<WebRtc_UWord32> (vol * 255 + 0.5);
+ volume = static_cast<uint32_t> (vol * 255 + 0.5);
} else
{
// Otherwise get the average volume across channels.
@@ -360,7 +360,7 @@
assert(channels > 0);
// vol 0.0 to 1.0 -> convert to 0 - 255
- volume = static_cast<WebRtc_UWord32> (255 * vol / channels + 0.5);
+ volume = static_cast<uint32_t> (255 * vol / channels + 0.5);
}
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
@@ -369,8 +369,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
+int32_t
+AudioMixerManagerMac::MaxSpeakerVolume(uint32_t& maxVolume) const
{
if (_outputDeviceID == kAudioObjectUnknown)
@@ -387,8 +387,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
+int32_t
+AudioMixerManagerMac::MinSpeakerVolume(uint32_t& minVolume) const
{
if (_outputDeviceID == kAudioObjectUnknown)
@@ -405,8 +405,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t
+AudioMixerManagerMac::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
if (_outputDeviceID == kAudioObjectUnknown)
@@ -423,7 +423,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::SpeakerVolumeIsAvailable(bool& available)
{
if (_outputDeviceID == kAudioObjectUnknown)
{
@@ -469,7 +469,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::SpeakerMuteIsAvailable(bool& available)
{
if (_outputDeviceID == kAudioObjectUnknown)
{
@@ -514,7 +514,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SetSpeakerMute(bool enable)
+int32_t AudioMixerManagerMac::SetSpeakerMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::SetSpeakerMute(enable=%u)", enable);
@@ -575,7 +575,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SpeakerMute(bool& enabled) const
+int32_t AudioMixerManagerMac::SpeakerMute(bool& enabled) const
{
if (_outputDeviceID == kAudioObjectUnknown)
@@ -643,7 +643,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::StereoPlayoutIsAvailable(bool& available)
{
if (_outputDeviceID == kAudioObjectUnknown)
{
@@ -656,7 +656,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::StereoRecordingIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::StereoRecordingIsAvailable(bool& available)
{
if (_inputDeviceID == kAudioObjectUnknown)
{
@@ -669,7 +669,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::MicrophoneMuteIsAvailable(bool& available)
{
if (_inputDeviceID == kAudioObjectUnknown)
{
@@ -714,7 +714,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SetMicrophoneMute(bool enable)
+int32_t AudioMixerManagerMac::SetMicrophoneMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::SetMicrophoneMute(enable=%u)", enable);
@@ -775,7 +775,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::MicrophoneMute(bool& enabled) const
+int32_t AudioMixerManagerMac::MicrophoneMute(bool& enabled) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -844,7 +844,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::MicrophoneBoostIsAvailable(bool& available)
{
if (_inputDeviceID == kAudioObjectUnknown)
{
@@ -858,7 +858,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SetMicrophoneBoost(bool enable)
+int32_t AudioMixerManagerMac::SetMicrophoneBoost(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::SetMicrophoneBoost(enable=%u)", enable);
@@ -886,7 +886,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::MicrophoneBoost(bool& enabled) const
+int32_t AudioMixerManagerMac::MicrophoneBoost(bool& enabled) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -902,7 +902,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioMixerManagerMac::MicrophoneVolumeIsAvailable(bool& available)
{
if (_inputDeviceID == kAudioObjectUnknown)
{
@@ -948,7 +948,7 @@
return 0;
}
-WebRtc_Word32 AudioMixerManagerMac::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioMixerManagerMac::SetMicrophoneVolume(uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
"AudioMixerManagerMac::SetMicrophoneVolume(volume=%u)", volume);
@@ -1014,8 +1014,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MicrophoneVolume(WebRtc_UWord32& volume) const
+int32_t
+AudioMixerManagerMac::MicrophoneVolume(uint32_t& volume) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -1045,7 +1045,7 @@
&propertyAddress, 0, NULL, &size, &volFloat32));
// vol 0.0 to 1.0 -> convert to 0 - 255
- volume = static_cast<WebRtc_UWord32> (volFloat32 * 255 + 0.5);
+ volume = static_cast<uint32_t> (volFloat32 * 255 + 0.5);
} else
{
// Otherwise get the average volume across channels.
@@ -1076,7 +1076,7 @@
assert(channels > 0);
// vol 0.0 to 1.0 -> convert to 0 - 255
- volume = static_cast<WebRtc_UWord32>
+ volume = static_cast<uint32_t>
(255 * volFloat32 / channels + 0.5);
}
@@ -1087,8 +1087,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
+int32_t
+AudioMixerManagerMac::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -1105,8 +1105,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
+int32_t
+AudioMixerManagerMac::MinMicrophoneVolume(uint32_t& minVolume) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -1123,8 +1123,8 @@
return 0;
}
-WebRtc_Word32
-AudioMixerManagerMac::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t
+AudioMixerManagerMac::MicrophoneVolumeStepSize(uint16_t& stepSize) const
{
if (_inputDeviceID == kAudioObjectUnknown)
@@ -1148,7 +1148,7 @@
// CoreAudio errors are best interpreted as four character strings.
void AudioMixerManagerMac::logCAMsg(const TraceLevel level,
const TraceModule module,
- const WebRtc_Word32 id, const char *msg,
+ const int32_t id, const char *msg,
const char *err)
{
assert(msg != NULL);
diff --git a/modules/audio_device/mac/audio_mixer_manager_mac.h b/modules/audio_device/mac/audio_mixer_manager_mac.h
index 7209f91..8c89e71 100644
--- a/modules/audio_device/mac/audio_mixer_manager_mac.h
+++ b/modules/audio_device/mac/audio_mixer_manager_mac.h
@@ -22,56 +22,56 @@
class AudioMixerManagerMac
{
public:
- WebRtc_Word32 OpenSpeaker(AudioDeviceID deviceID);
- WebRtc_Word32 OpenMicrophone(AudioDeviceID deviceID);
- 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 StereoPlayoutIsAvailable(bool& available);
- WebRtc_Word32 StereoRecordingIsAvailable(bool& available);
- 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(AudioDeviceID deviceID);
+ int32_t OpenMicrophone(AudioDeviceID deviceID);
+ 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 StereoPlayoutIsAvailable(bool& available);
+ int32_t StereoRecordingIsAvailable(bool& available);
+ 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:
- AudioMixerManagerMac(const WebRtc_Word32 id);
+ AudioMixerManagerMac(const int32_t id);
~AudioMixerManagerMac();
private:
static void logCAMsg(const TraceLevel level,
const TraceModule module,
- const WebRtc_Word32 id, const char *msg,
+ const int32_t id, const char *msg,
const char *err);
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioDeviceID _inputDeviceID;
AudioDeviceID _outputDeviceID;
- WebRtc_UWord16 _noInputChannels;
- WebRtc_UWord16 _noOutputChannels;
+ uint16_t _noInputChannels;
+ uint16_t _noOutputChannels;
};
diff --git a/modules/audio_device/test/audio_device_test_api.cc b/modules/audio_device/test/audio_device_test_api.cc
index b232878..a1b841d 100644
--- a/modules/audio_device/test/audio_device_test_api.cc
+++ b/modules/audio_device/test/audio_device_test_api.cc
@@ -83,16 +83,16 @@
~AudioTransportAPI() {}
- virtual WebRtc_Word32 RecordedDataIsAvailable(
+ virtual int32_t RecordedDataIsAvailable(
const void* audioSamples,
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 sampleRate,
- const WebRtc_UWord32 totalDelay,
- const WebRtc_Word32 clockSkew,
- const WebRtc_UWord32 currentMicLevel,
- WebRtc_UWord32& newMicLevel) {
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t sampleRate,
+ const uint32_t totalDelay,
+ const int32_t clockSkew,
+ const uint32_t currentMicLevel,
+ uint32_t& newMicLevel) {
rec_count_++;
if (rec_count_ % 100 == 0) {
if (nChannels == 1) {
@@ -109,13 +109,13 @@
return 0;
}
- virtual WebRtc_Word32 NeedMorePlayData(
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 sampleRate,
+ virtual int32_t NeedMorePlayData(
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t sampleRate,
void* audioSamples,
- WebRtc_UWord32& nSamplesOut) {
+ uint32_t& nSamplesOut) {
play_count_++;
if (play_count_ % 100 == 0) {
if (nChannels == 1) {
@@ -129,8 +129,8 @@
}
private:
- WebRtc_UWord32 rec_count_;
- WebRtc_UWord32 play_count_;
+ uint32_t rec_count_;
+ uint32_t play_count_;
};
class AudioDeviceAPITest: public testing::Test {
@@ -148,7 +148,7 @@
// user can select between default (Core) or Wave
// else
// user can select between default (Wave) or Wave
- const WebRtc_Word32 kId = 444;
+ const int32_t kId = 444;
#if defined(_WIN32)
EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
@@ -276,7 +276,7 @@
EXPECT_EQ(0, audio_device_->Terminate());
}
- void CheckVolume(WebRtc_UWord32 expected, WebRtc_UWord32 actual) {
+ void CheckVolume(uint32_t expected, uint32_t actual) {
// Mac and Windows have lower resolution on the volume settings.
#if defined(WEBRTC_MAC) || defined(_WIN32)
int diff = abs(static_cast<int>(expected - actual));
@@ -363,7 +363,7 @@
TEST_F(AudioDeviceAPITest, PlayoutDeviceName) {
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
// fail tests
EXPECT_EQ(-1, audio_device_->PlayoutDeviceName(-2, name, guid));
@@ -387,7 +387,7 @@
TEST_F(AudioDeviceAPITest, RecordingDeviceName) {
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
// fail tests
EXPECT_EQ(-1, audio_device_->RecordingDeviceName(-2, name, guid));
@@ -409,7 +409,7 @@
}
TEST_F(AudioDeviceAPITest, SetPlayoutDevice) {
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
// fail tests
EXPECT_EQ(-1, audio_device_->SetPlayoutDevice(-1));
@@ -434,7 +434,7 @@
TEST_F(AudioDeviceAPITest, SetRecordingDevice) {
EXPECT_EQ(0, audio_device_->Init());
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
// fail tests
EXPECT_EQ(-1, audio_device_->SetRecordingDevice(-1));
@@ -472,7 +472,7 @@
EXPECT_FALSE(audio_device_->PlayoutIsInitialized());
#endif
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->PlayoutIsAvailable(&available));
@@ -494,7 +494,7 @@
EXPECT_FALSE(audio_device_->RecordingIsInitialized());
#endif
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->RecordingIsAvailable(&available));
@@ -536,7 +536,7 @@
EXPECT_TRUE(audio_device_->PlayoutIsInitialized());
}
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->PlayoutIsAvailable(&available));
if (available) {
@@ -585,7 +585,7 @@
EXPECT_TRUE(audio_device_->RecordingIsInitialized());
}
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->RecordingIsAvailable(&available));
if (available) {
@@ -643,7 +643,7 @@
}
// repeat test for all devices
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->PlayoutIsAvailable(&available));
@@ -700,7 +700,7 @@
}
// repeat test for all devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->RecordingIsAvailable(&available));
@@ -718,17 +718,17 @@
#if defined(_WIN32) && !defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
TEST_F(AudioDeviceAPITest, SetAndGetWaveOutVolume) {
- WebRtc_UWord32 vol(0);
+ uint32_t vol(0);
// NOTE 1: Windows Wave only!
// NOTE 2: It seems like the waveOutSetVolume API returns
// MMSYSERR_NOTSUPPORTED on some Vista machines!
- const WebRtc_UWord16 maxVol(0xFFFF);
- WebRtc_UWord16 volL, volR;
+ const uint16_t maxVol(0xFFFF);
+ uint16_t volL, volR;
CheckInitialPlayoutStates();
// make dummy test to see if this API is supported
- WebRtc_Word32 works = audio_device_->SetWaveOutVolume(vol, vol);
+ int32_t works = audio_device_->SetWaveOutVolume(vol, vol);
WARNING(works == 0);
if (works == 0)
@@ -788,7 +788,7 @@
EXPECT_FALSE(audio_device_->SpeakerIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->SpeakerIsAvailable(&available));
@@ -829,7 +829,7 @@
}
// repeat test for all devices
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->SpeakerIsAvailable(&available));
@@ -857,7 +857,7 @@
EXPECT_FALSE(audio_device_->MicrophoneIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneIsAvailable(&available));
@@ -898,7 +898,7 @@
}
// repeat test for all devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneIsAvailable(&available));
@@ -927,7 +927,7 @@
EXPECT_FALSE(audio_device_->SpeakerIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available));
@@ -943,11 +943,11 @@
// NOTE: Disabled on mac due to issue 257.
#ifndef WEBRTC_MAC
TEST_F(AudioDeviceAPITest, SpeakerVolumeTests) {
- WebRtc_UWord32 vol(0);
- WebRtc_UWord32 volume(0);
- WebRtc_UWord32 maxVolume(0);
- WebRtc_UWord32 minVolume(0);
- WebRtc_UWord16 stepSize(0);
+ uint32_t vol(0);
+ uint32_t volume(0);
+ uint32_t maxVolume(0);
+ uint32_t minVolume(0);
+ uint16_t stepSize(0);
bool available;
CheckInitialPlayoutStates();
@@ -998,7 +998,7 @@
EXPECT_EQ(0, audio_device_->MaxSpeakerVolume(&maxVolume));
EXPECT_EQ(0, audio_device_->MinSpeakerVolume(&minVolume));
EXPECT_EQ(0, audio_device_->SpeakerVolumeStepSize(&stepSize));
- WebRtc_UWord32 step = (maxVolume - minVolume) / 10;
+ uint32_t step = (maxVolume - minVolume) / 10;
step = (step < stepSize ? stepSize : step);
for (vol = minVolume; vol <= maxVolume; vol += step) {
EXPECT_EQ(0, audio_device_->SetSpeakerVolume(vol));
@@ -1008,7 +1008,7 @@
}
// use all (indexed) devices and modify/retrieve the volume
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->SpeakerVolumeIsAvailable(&available));
@@ -1017,7 +1017,7 @@
EXPECT_EQ(0, audio_device_->MaxSpeakerVolume(&maxVolume));
EXPECT_EQ(0, audio_device_->MinSpeakerVolume(&minVolume));
EXPECT_EQ(0, audio_device_->SpeakerVolumeStepSize(&stepSize));
- WebRtc_UWord32 step = (maxVolume - minVolume) / 10;
+ uint32_t step = (maxVolume - minVolume) / 10;
step = (step < stepSize ? stepSize : step);
for (vol = minVolume; vol <= maxVolume; vol += step) {
EXPECT_EQ(0, audio_device_->SetSpeakerVolume(vol));
@@ -1071,7 +1071,7 @@
EXPECT_FALSE(audio_device_->MicrophoneIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available));
@@ -1087,11 +1087,11 @@
// NOTE: Disabled on mac due to issue 257.
#ifndef WEBRTC_MAC
TEST_F(AudioDeviceAPITest, MicrophoneVolumeTests) {
- WebRtc_UWord32 vol(0);
- WebRtc_UWord32 volume(0);
- WebRtc_UWord32 maxVolume(0);
- WebRtc_UWord32 minVolume(0);
- WebRtc_UWord16 stepSize(0);
+ uint32_t vol(0);
+ uint32_t volume(0);
+ uint32_t maxVolume(0);
+ uint32_t minVolume(0);
+ uint16_t stepSize(0);
bool available;
CheckInitialRecordingStates();
@@ -1153,7 +1153,7 @@
}
// use all (indexed) devices and modify/retrieve the volume
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneVolumeIsAvailable(&available));
@@ -1199,7 +1199,7 @@
EXPECT_FALSE(audio_device_->SpeakerIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->PlayoutDevices();
+ int16_t no_devices = audio_device_->PlayoutDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetPlayoutDevice(i));
EXPECT_EQ(0, audio_device_->SpeakerMuteIsAvailable(&available));
@@ -1225,7 +1225,7 @@
EXPECT_FALSE(audio_device_->MicrophoneIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneMuteIsAvailable(&available));
@@ -1251,7 +1251,7 @@
EXPECT_FALSE(audio_device_->MicrophoneIsInitialized());
// check all availiable devices
- WebRtc_Word16 no_devices = audio_device_->RecordingDevices();
+ int16_t no_devices = audio_device_->RecordingDevices();
for (int i = 0; i < no_devices; i++) {
EXPECT_EQ(0, audio_device_->SetRecordingDevice(i));
EXPECT_EQ(0, audio_device_->MicrophoneBoostIsAvailable(&available));
@@ -1584,7 +1584,7 @@
TEST_F(AudioDeviceAPITest, PlayoutBufferTests) {
AudioDeviceModule::BufferType bufferType;
- WebRtc_UWord16 sizeMS(0);
+ uint16_t sizeMS(0);
CheckInitialPlayoutStates();
EXPECT_EQ(0, audio_device_->PlayoutBuffer(&bufferType, &sizeMS));
@@ -1657,7 +1657,7 @@
TEST_F(AudioDeviceAPITest, PlayoutDelay) {
// NOTE: this API is better tested in a functional test
- WebRtc_UWord16 sizeMS(0);
+ uint16_t sizeMS(0);
CheckInitialPlayoutStates();
// bulk tests
EXPECT_EQ(0, audio_device_->PlayoutDelay(&sizeMS));
@@ -1666,7 +1666,7 @@
TEST_F(AudioDeviceAPITest, RecordingDelay) {
// NOTE: this API is better tested in a functional test
- WebRtc_UWord16 sizeMS(0);
+ uint16_t sizeMS(0);
CheckInitialRecordingStates();
// bulk tests
@@ -1676,7 +1676,7 @@
TEST_F(AudioDeviceAPITest, CPULoad) {
// NOTE: this API is better tested in a functional test
- WebRtc_UWord16 load(0);
+ uint16_t load(0);
// bulk tests
#ifdef _WIN32
@@ -1761,7 +1761,7 @@
#endif // !WIN32 && !WEBRTC_LINUX
TEST_F(AudioDeviceAPITest, RecordingSampleRate) {
- WebRtc_UWord32 sampleRate(0);
+ uint32_t sampleRate(0);
// bulk tests
EXPECT_EQ(0, audio_device_->RecordingSampleRate(&sampleRate));
@@ -1780,7 +1780,7 @@
}
TEST_F(AudioDeviceAPITest, PlayoutSampleRate) {
- WebRtc_UWord32 sampleRate(0);
+ uint32_t sampleRate(0);
// bulk tests
EXPECT_EQ(0, audio_device_->PlayoutSampleRate(&sampleRate));
diff --git a/modules/audio_device/test/func_test_manager.cc b/modules/audio_device/test/func_test_manager.cc
index 9ecec7c..bc0dd78 100644
--- a/modules/audio_device/test/func_test_manager.cc
+++ b/modules/audio_device/test/func_test_manager.cc
@@ -39,11 +39,11 @@
struct AudioPacket
{
- WebRtc_UWord8 dataBuffer[4 * 960];
- WebRtc_UWord16 nSamples;
- WebRtc_UWord16 nBytesPerSample;
- WebRtc_UWord8 nChannels;
- WebRtc_UWord32 samplesPerSec;
+ uint8_t dataBuffer[4 * 960];
+ uint16_t nSamples;
+ uint16_t nBytesPerSample;
+ uint8_t nChannels;
+ uint32_t samplesPerSec;
};
// Helper functions
@@ -134,8 +134,7 @@
// AudioTransportImpl::SetFilePlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioTransportImpl::SetFilePlayout(bool enable,
- const char* fileName)
+int32_t AudioTransportImpl::SetFilePlayout(bool enable, const char* fileName)
{
_playFromFile = enable;
if (enable)
@@ -168,22 +167,22 @@
}
}
-WebRtc_Word32 AudioTransportImpl::RecordedDataIsAvailable(
+int32_t AudioTransportImpl::RecordedDataIsAvailable(
const void* audioSamples,
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 samplesPerSec,
- const WebRtc_UWord32 totalDelayMS,
- const WebRtc_Word32 clockDrift,
- const WebRtc_UWord32 currentMicLevel,
- WebRtc_UWord32& newMicLevel)
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec,
+ const uint32_t totalDelayMS,
+ const int32_t clockDrift,
+ const uint32_t currentMicLevel,
+ uint32_t& newMicLevel)
{
if (_fullDuplex && _audioList.GetSize() < 15)
{
AudioPacket* packet = new AudioPacket();
memcpy(packet->dataBuffer, audioSamples, nSamples * nBytesPerSample);
- packet->nSamples = (WebRtc_UWord16) nSamples;
+ packet->nSamples = (uint16_t) nSamples;
packet->nBytesPerSample = nBytesPerSample;
packet->nChannels = nChannels;
packet->samplesPerSec = samplesPerSec;
@@ -202,10 +201,10 @@
if (_microphoneVolume)
{
- WebRtc_UWord32 maxVolume(0);
- WebRtc_UWord32 minVolume(0);
- WebRtc_UWord32 volume(0);
- WebRtc_UWord16 stepSize(0);
+ uint32_t maxVolume(0);
+ uint32_t minVolume(0);
+ uint32_t volume(0);
+ uint16_t stepSize(0);
EXPECT_EQ(0, _audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, _audioDevice->MinMicrophoneVolume(&minVolume));
EXPECT_EQ(0, _audioDevice->MicrophoneVolumeStepSize(&stepSize));
@@ -228,9 +227,9 @@
if (_microphoneAGC)
{
- WebRtc_UWord32 maxVolume(0);
- WebRtc_UWord32 minVolume(0);
- WebRtc_UWord16 stepSize(0);
+ uint32_t maxVolume(0);
+ uint32_t minVolume(0);
+ uint16_t stepSize(0);
EXPECT_EQ(0, _audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, _audioDevice->MinMicrophoneVolume(&minVolume));
EXPECT_EQ(0, _audioDevice->MicrophoneVolumeStepSize(&stepSize));
@@ -313,13 +312,13 @@
}
-WebRtc_Word32 AudioTransportImpl::NeedMorePlayData(
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 samplesPerSec,
+int32_t AudioTransportImpl::NeedMorePlayData(
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec,
void* audioSamples,
- WebRtc_UWord32& nSamplesOut)
+ uint32_t& nSamplesOut)
{
if (_fullDuplex)
{
@@ -335,18 +334,18 @@
{
int ret(0);
int lenOut(0);
- WebRtc_Word16 tmpBuf_96kHz[80 * 12];
- WebRtc_Word16* ptr16In = NULL;
- WebRtc_Word16* ptr16Out = NULL;
+ int16_t tmpBuf_96kHz[80 * 12];
+ int16_t* ptr16In = NULL;
+ int16_t* ptr16Out = NULL;
- const WebRtc_UWord16 nSamplesIn = packet->nSamples;
- const WebRtc_UWord8 nChannelsIn = packet->nChannels;
- const WebRtc_UWord32 samplesPerSecIn = packet->samplesPerSec;
- const WebRtc_UWord16 nBytesPerSampleIn =
+ const uint16_t nSamplesIn = packet->nSamples;
+ const uint8_t nChannelsIn = packet->nChannels;
+ const uint32_t samplesPerSecIn = packet->samplesPerSec;
+ const uint16_t nBytesPerSampleIn =
packet->nBytesPerSample;
- WebRtc_Word32 fsInHz(samplesPerSecIn);
- WebRtc_Word32 fsOutHz(samplesPerSec);
+ int32_t fsInHz(samplesPerSecIn);
+ int32_t fsOutHz(samplesPerSec);
if (fsInHz == 44100)
fsInHz = 44000;
@@ -364,19 +363,19 @@
if (nChannels == 2)
{
_resampler.Push(
- (const WebRtc_Word16*) packet->dataBuffer,
+ (const int16_t*) packet->dataBuffer,
2 * nSamplesIn,
- (WebRtc_Word16*) audioSamples, 2
+ (int16_t*) audioSamples, 2
* nSamples, lenOut);
} else
{
_resampler.Push(
- (const WebRtc_Word16*) packet->dataBuffer,
+ (const int16_t*) packet->dataBuffer,
2 * nSamplesIn, tmpBuf_96kHz, 2
* nSamples, lenOut);
ptr16In = &tmpBuf_96kHz[0];
- ptr16Out = (WebRtc_Word16*) audioSamples;
+ ptr16Out = (int16_t*) audioSamples;
// do stereo -> mono
for (unsigned int i = 0; i < nSamples; i++)
@@ -387,7 +386,7 @@
ptr16In++;
}
}
- assert(2*nSamples == (WebRtc_UWord32)lenOut);
+ assert(2*nSamples == (uint32_t)lenOut);
} else
{
if (_playCount % 100 == 0)
@@ -406,19 +405,19 @@
if (nChannels == 1)
{
_resampler.Push(
- (const WebRtc_Word16*) packet->dataBuffer,
+ (const int16_t*) packet->dataBuffer,
nSamplesIn,
- (WebRtc_Word16*) audioSamples,
+ (int16_t*) audioSamples,
nSamples, lenOut);
} else
{
_resampler.Push(
- (const WebRtc_Word16*) packet->dataBuffer,
+ (const int16_t*) packet->dataBuffer,
nSamplesIn, tmpBuf_96kHz, nSamples,
lenOut);
ptr16In = &tmpBuf_96kHz[0];
- ptr16Out = (WebRtc_Word16*) audioSamples;
+ ptr16Out = (int16_t*) audioSamples;
// do mono -> stereo
for (unsigned int i = 0; i < nSamples; i++)
@@ -430,7 +429,7 @@
ptr16In++;
}
}
- assert(nSamples == (WebRtc_UWord32)lenOut);
+ assert(nSamples == (uint32_t)lenOut);
} else
{
if (_playCount % 100 == 0)
@@ -447,15 +446,15 @@
if (_playFromFile && _playFile.Open())
{
- WebRtc_Word16 fileBuf[480];
+ int16_t fileBuf[480];
// read mono-file
- WebRtc_Word32 len = _playFile.Read((WebRtc_Word8*) fileBuf, 2
+ int32_t len = _playFile.Read((int8_t*) fileBuf, 2
* nSamples);
- if (len != 2 * (WebRtc_Word32) nSamples)
+ if (len != 2 * (int32_t) nSamples)
{
_playFile.Rewind();
- _playFile.Read((WebRtc_Word8*) fileBuf, 2 * nSamples);
+ _playFile.Read((int8_t*) fileBuf, 2 * nSamples);
}
// convert to stero if required
@@ -466,7 +465,7 @@
{
// mono sample from file is duplicated and sent to left and right
// channels
- WebRtc_Word16* audio16 = (WebRtc_Word16*) audioSamples;
+ int16_t* audio16 = (int16_t*) audioSamples;
for (unsigned int i = 0; i < nSamples; i++)
{
(*audio16) = fileBuf[i]; // left
@@ -485,10 +484,10 @@
if (_speakerVolume)
{
- WebRtc_UWord32 maxVolume(0);
- WebRtc_UWord32 minVolume(0);
- WebRtc_UWord32 volume(0);
- WebRtc_UWord16 stepSize(0);
+ uint32_t maxVolume(0);
+ uint32_t minVolume(0);
+ uint32_t volume(0);
+ uint16_t stepSize(0);
EXPECT_EQ(0, _audioDevice->MaxSpeakerVolume(&maxVolume));
EXPECT_EQ(0, _audioDevice->MinSpeakerVolume(&minVolume));
EXPECT_EQ(0, _audioDevice->SpeakerVolumeStepSize(&stepSize));
@@ -498,7 +497,7 @@
TEST_LOG("[0]");
addMarker = false;
}
- WebRtc_UWord32 step = (maxVolume - minVolume) / 10;
+ uint32_t step = (maxVolume - minVolume) / 10;
step = (step < stepSize ? stepSize : step);
volume += step;
if (volume > maxVolume)
@@ -529,9 +528,9 @@
if (_loopBackMeasurements)
{
- WebRtc_UWord16 recDelayMS(0);
- WebRtc_UWord16 playDelayMS(0);
- WebRtc_UWord32 nItemsInList(0);
+ uint16_t recDelayMS(0);
+ uint16_t playDelayMS(0);
+ uint32_t nItemsInList(0);
nItemsInList = _audioList.GetSize();
EXPECT_EQ(0, _audioDevice->RecordingDelay(&recDelayMS));
@@ -577,7 +576,7 @@
{
}
-WebRtc_Word32 FuncTestManager::Init()
+int32_t FuncTestManager::Init()
{
EXPECT_TRUE((_processThread = ProcessThread::CreateProcessThread()) != NULL);
if (_processThread == NULL)
@@ -609,7 +608,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::Close()
+int32_t FuncTestManager::Close()
{
EXPECT_EQ(0, _audioDevice->RegisterEventObserver(NULL));
EXPECT_EQ(0, _audioDevice->RegisterAudioCallback(NULL));
@@ -652,7 +651,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::DoTest(const TestType testType)
+int32_t FuncTestManager::DoTest(const TestType testType)
{
switch (testType)
{
@@ -712,7 +711,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestAudioLayerSelection()
+int32_t FuncTestManager::TestAudioLayerSelection()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Audio Layer test:\n");
@@ -887,7 +886,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestDeviceEnumeration()
+int32_t FuncTestManager::TestDeviceEnumeration()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Device Enumeration test:\n");
@@ -908,7 +907,7 @@
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
- const WebRtc_Word16 nPlayoutDevices(audioDevice->PlayoutDevices());
+ const int16_t nPlayoutDevices(audioDevice->PlayoutDevices());
EXPECT_TRUE(nPlayoutDevices >= 0);
TEST_LOG("\nPlayoutDevices: %u\n \n", nPlayoutDevices);
for (int n = 0; n < nPlayoutDevices; n++)
@@ -930,7 +929,7 @@
EXPECT_EQ(-1, audioDevice->PlayoutDeviceName(-1, name, guid));
#endif
- const WebRtc_Word16 nRecordingDevices(audioDevice->RecordingDevices());
+ const int16_t nRecordingDevices(audioDevice->RecordingDevices());
EXPECT_TRUE(nRecordingDevices >= 0);
TEST_LOG("\nRecordingDevices: %u\n \n", nRecordingDevices);
for (int n = 0; n < nRecordingDevices; n++)
@@ -960,7 +959,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestDeviceSelection()
+int32_t FuncTestManager::TestDeviceSelection()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Device Selection test:\n");
@@ -996,7 +995,7 @@
EXPECT_TRUE(audioDevice->Initialized());
bool available(false);
- WebRtc_Word16 nDevices(-1);
+ int16_t nDevices(-1);
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
@@ -1172,7 +1171,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestAudioTransport()
+int32_t FuncTestManager::TestAudioTransport()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Audio Transport test:\n");
@@ -1223,7 +1222,7 @@
}
bool available(false);
- WebRtc_UWord32 samplesPerSec(0);
+ uint32_t samplesPerSec(0);
if (playIsAvailable)
{
@@ -1233,7 +1232,7 @@
EXPECT_EQ(0, audioDevice->SpeakerVolumeIsAvailable(&available));
if (available)
{
- WebRtc_UWord32 maxVolume(0);
+ uint32_t maxVolume(0);
EXPECT_EQ(0, audioDevice->MaxSpeakerVolume(&maxVolume));
EXPECT_EQ(0, audioDevice->SetSpeakerVolume(maxVolume/2));
}
@@ -1285,7 +1284,7 @@
EXPECT_EQ(0, audioDevice->MicrophoneVolumeIsAvailable(&available));
if (available)
{
- WebRtc_UWord32 maxVolume(0);
+ uint32_t maxVolume(0);
EXPECT_EQ(0, audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, audioDevice->SetMicrophoneVolume(maxVolume));
}
@@ -1361,8 +1360,8 @@
// ==============================
// Finally, make full duplex test
- WebRtc_UWord32 playSamplesPerSec(0);
- WebRtc_UWord32 recSamplesPerSecRec(0);
+ uint32_t playSamplesPerSec(0);
+ uint32_t recSamplesPerSecRec(0);
EXPECT_EQ(0, audioDevice->RegisterAudioCallback(_audioTransport));
@@ -1371,7 +1370,7 @@
EXPECT_EQ(0, audioDevice->MicrophoneVolumeIsAvailable(&available));
if (available)
{
- WebRtc_UWord32 maxVolume(0);
+ uint32_t maxVolume(0);
EXPECT_EQ(0, audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, audioDevice->SetMicrophoneVolume(maxVolume));
}
@@ -1420,7 +1419,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestSpeakerVolume()
+int32_t FuncTestManager::TestSpeakerVolume()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Speaker Volume test:\n");
@@ -1445,8 +1444,8 @@
}
bool available(false);
- WebRtc_UWord32 startVolume(0);
- WebRtc_UWord32 samplesPerSec(0);
+ uint32_t startVolume(0);
+ uint32_t samplesPerSec(0);
EXPECT_EQ(0, audioDevice->SpeakerVolumeIsAvailable(&available));
if (available)
@@ -1521,7 +1520,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestSpeakerMute()
+int32_t FuncTestManager::TestSpeakerMute()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Speaker Mute test:\n");
@@ -1547,7 +1546,7 @@
bool available(false);
bool startMute(false);
- WebRtc_UWord32 samplesPerSec(0);
+ uint32_t samplesPerSec(0);
EXPECT_EQ(0, audioDevice->SpeakerMuteIsAvailable(&available));
if (available)
@@ -1616,7 +1615,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestMicrophoneVolume()
+int32_t FuncTestManager::TestMicrophoneVolume()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Microphone Volume test:\n");
@@ -1681,7 +1680,7 @@
fileRecording = true;
}
- WebRtc_UWord32 startVolume(0);
+ uint32_t startVolume(0);
bool enabled(false);
// store initial volume setting
@@ -1755,7 +1754,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestMicrophoneMute()
+int32_t FuncTestManager::TestMicrophoneMute()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Microphone Mute test:\n");
@@ -1892,7 +1891,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestMicrophoneBoost()
+int32_t FuncTestManager::TestMicrophoneBoost()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Microphone Boost test:\n");
@@ -2029,7 +2028,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestMicrophoneAGC()
+int32_t FuncTestManager::TestMicrophoneAGC()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Microphone AGC test:\n");
@@ -2093,7 +2092,7 @@
fileRecording = true;
}
- WebRtc_UWord32 startVolume(0);
+ uint32_t startVolume(0);
bool enabled(false);
// store initial volume setting
@@ -2168,7 +2167,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestLoopback()
+int32_t FuncTestManager::TestLoopback()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Loopback measurement test:\n");
@@ -2188,8 +2187,8 @@
bool recIsAvailable(false);
bool playIsAvailable(false);
- WebRtc_UWord8 nPlayChannels(0);
- WebRtc_UWord8 nRecChannels(0);
+ uint8_t nPlayChannels(0);
+ uint8_t nRecChannels(0);
if (SelectRecordingDevice() == -1)
{
@@ -2226,8 +2225,8 @@
if (recIsAvailable && playIsAvailable)
{
- WebRtc_UWord32 playSamplesPerSec(0);
- WebRtc_UWord32 recSamplesPerSecRec(0);
+ uint32_t playSamplesPerSec(0);
+ uint32_t recSamplesPerSecRec(0);
EXPECT_EQ(0, audioDevice->RegisterAudioCallback(_audioTransport));
@@ -2248,7 +2247,7 @@
EXPECT_EQ(0, audioDevice->MicrophoneVolumeIsAvailable(&available));
if (available)
{
- WebRtc_UWord32 maxVolume(0);
+ uint32_t maxVolume(0);
EXPECT_EQ(0, audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, audioDevice->SetMicrophoneVolume(maxVolume));
}
@@ -2294,7 +2293,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestDeviceRemoval()
+int32_t FuncTestManager::TestDeviceRemoval()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Device removal test:\n");
@@ -2314,9 +2313,9 @@
bool recIsAvailable(false);
bool playIsAvailable(false);
- WebRtc_UWord8 nPlayChannels(0);
- WebRtc_UWord8 nRecChannels(0);
- WebRtc_UWord8 loopCount(0);
+ uint8_t nPlayChannels(0);
+ uint8_t nRecChannels(0);
+ uint8_t loopCount(0);
while (loopCount < 2)
{
@@ -2354,8 +2353,8 @@
if (recIsAvailable && playIsAvailable)
{
- WebRtc_UWord32 playSamplesPerSec(0);
- WebRtc_UWord32 recSamplesPerSecRec(0);
+ uint32_t playSamplesPerSec(0);
+ uint32_t recSamplesPerSecRec(0);
EXPECT_EQ(0, audioDevice->RegisterAudioCallback(_audioTransport));
@@ -2376,7 +2375,7 @@
EXPECT_EQ(0, audioDevice->MicrophoneVolumeIsAvailable(&available));
if (available)
{
- WebRtc_UWord32 maxVolume(0);
+ uint32_t maxVolume(0);
EXPECT_EQ(0, audioDevice->MaxMicrophoneVolume(&maxVolume));
EXPECT_EQ(0, audioDevice->SetMicrophoneVolume(maxVolume));
}
@@ -2471,7 +2470,7 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::TestExtra()
+int32_t FuncTestManager::TestExtra()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Extra test:\n");
@@ -2498,12 +2497,12 @@
return 0;
}
-WebRtc_Word32 FuncTestManager::SelectRecordingDevice()
+int32_t FuncTestManager::SelectRecordingDevice()
{
- WebRtc_Word16 nDevices = _audioDevice->RecordingDevices();
+ int16_t nDevices = _audioDevice->RecordingDevices();
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
- WebRtc_Word32 ret(-1);
+ int32_t ret(-1);
#ifdef _WIN32
TEST_LOG("\nSelect Recording Device\n \n");
@@ -2560,9 +2559,9 @@
return ret;
}
-WebRtc_Word32 FuncTestManager::SelectPlayoutDevice()
+int32_t FuncTestManager::SelectPlayoutDevice()
{
- WebRtc_Word16 nDevices = _audioDevice->PlayoutDevices();
+ int16_t nDevices = _audioDevice->PlayoutDevices();
char name[kAdmMaxDeviceNameSize];
char guid[kAdmMaxGuidSize];
@@ -2582,7 +2581,7 @@
scanf("%u", &sel);
- WebRtc_Word32 ret(0);
+ int32_t ret(0);
if (sel == 0)
{
@@ -2612,7 +2611,7 @@
TEST_LOG("\n: ");
int sel(0);
EXPECT_TRUE(scanf("%u", &sel) > 0);
- WebRtc_Word32 ret(0);
+ int32_t ret(0);
if (sel < (nDevices))
{
EXPECT_EQ(0, (ret = _audioDevice->SetPlayoutDevice(sel)));
@@ -2625,7 +2624,7 @@
return ret;
}
-WebRtc_Word32 FuncTestManager::TestAdvancedMBAPI()
+int32_t FuncTestManager::TestAdvancedMBAPI()
{
TEST_LOG("\n=======================================\n");
TEST_LOG(" Advanced mobile device API test:\n");
diff --git a/modules/audio_device/test/func_test_manager.h b/modules/audio_device/test/func_test_manager.h
index 94de802..aafd4d8 100644
--- a/modules/audio_device/test/func_test_manager.h
+++ b/modules/audio_device/test/func_test_manager.h
@@ -92,29 +92,29 @@
class AudioTransportImpl: public AudioTransport
{
public:
- virtual WebRtc_Word32
+ virtual int32_t
RecordedDataIsAvailable(const void* audioSamples,
- const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 samplesPerSec,
- const WebRtc_UWord32 totalDelayMS,
- const WebRtc_Word32 clockDrift,
- const WebRtc_UWord32 currentMicLevel,
- WebRtc_UWord32& newMicLevel);
+ const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec,
+ const uint32_t totalDelayMS,
+ const int32_t clockDrift,
+ const uint32_t currentMicLevel,
+ uint32_t& newMicLevel);
- virtual WebRtc_Word32 NeedMorePlayData(const WebRtc_UWord32 nSamples,
- const WebRtc_UWord8 nBytesPerSample,
- const WebRtc_UWord8 nChannels,
- const WebRtc_UWord32 samplesPerSec,
- void* audioSamples,
- WebRtc_UWord32& nSamplesOut);
+ virtual int32_t NeedMorePlayData(const uint32_t nSamples,
+ const uint8_t nBytesPerSample,
+ const uint8_t nChannels,
+ const uint32_t samplesPerSec,
+ void* audioSamples,
+ uint32_t& nSamplesOut);
AudioTransportImpl(AudioDeviceModule* audioDevice);
~AudioTransportImpl();
public:
- WebRtc_Word32 SetFilePlayout(bool enable, const char* fileName = NULL);
+ int32_t SetFilePlayout(bool enable, const char* fileName = NULL);
void SetFullDuplex(bool enable);
void SetSpeakerVolume(bool enable)
{
@@ -167,8 +167,8 @@
FileWrapper& _playFile;
- WebRtc_UWord32 _recCount;
- WebRtc_UWord32 _playCount;
+ uint32_t _recCount;
+ uint32_t _playCount;
ListWrapper _audioList;
@@ -184,26 +184,26 @@
public:
FuncTestManager();
~FuncTestManager();
- WebRtc_Word32 Init();
- WebRtc_Word32 Close();
- WebRtc_Word32 DoTest(const TestType testType);
+ int32_t Init();
+ int32_t Close();
+ int32_t DoTest(const TestType testType);
private:
- WebRtc_Word32 TestAudioLayerSelection();
- WebRtc_Word32 TestDeviceEnumeration();
- WebRtc_Word32 TestDeviceSelection();
- WebRtc_Word32 TestAudioTransport();
- WebRtc_Word32 TestSpeakerVolume();
- WebRtc_Word32 TestMicrophoneVolume();
- WebRtc_Word32 TestSpeakerMute();
- WebRtc_Word32 TestMicrophoneMute();
- WebRtc_Word32 TestMicrophoneBoost();
- WebRtc_Word32 TestLoopback();
- WebRtc_Word32 TestDeviceRemoval();
- WebRtc_Word32 TestExtra();
- WebRtc_Word32 TestMicrophoneAGC();
- WebRtc_Word32 SelectPlayoutDevice();
- WebRtc_Word32 SelectRecordingDevice();
- WebRtc_Word32 TestAdvancedMBAPI();
+ int32_t TestAudioLayerSelection();
+ int32_t TestDeviceEnumeration();
+ int32_t TestDeviceSelection();
+ int32_t TestAudioTransport();
+ int32_t TestSpeakerVolume();
+ int32_t TestMicrophoneVolume();
+ int32_t TestSpeakerMute();
+ int32_t TestMicrophoneMute();
+ int32_t TestMicrophoneBoost();
+ int32_t TestLoopback();
+ int32_t TestDeviceRemoval();
+ int32_t TestExtra();
+ int32_t TestMicrophoneAGC();
+ int32_t SelectPlayoutDevice();
+ int32_t SelectRecordingDevice();
+ int32_t TestAdvancedMBAPI();
private:
// Paths to where the resource files to be used for this test are located.
std::string _playoutFile48;
diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc
index 8c61d10..0d4c60d 100644
--- a/modules/audio_device/win/audio_device_core_win.cc
+++ b/modules/audio_device/win/audio_device_core_win.cc
@@ -338,8 +338,8 @@
ok |= p->Init();
- WebRtc_Word16 numDevsRec = p->RecordingDevices();
- for (WebRtc_UWord16 i = 0; i < numDevsRec; i++)
+ int16_t numDevsRec = p->RecordingDevices();
+ for (uint16_t i = 0; i < numDevsRec; i++)
{
ok |= p->SetRecordingDevice(i);
temp_ok = p->RecordingIsAvailable(available);
@@ -356,8 +356,8 @@
}
}
- WebRtc_Word16 numDevsPlay = p->PlayoutDevices();
- for (WebRtc_UWord16 i = 0; i < numDevsPlay; i++)
+ int16_t numDevsPlay = p->PlayoutDevices();
+ for (uint16_t i = 0; i < numDevsPlay; i++)
{
ok |= p->SetPlayoutDevice(i);
temp_ok = p->PlayoutIsAvailable(available);
@@ -404,7 +404,7 @@
// AudioDeviceWindowsCore() - ctor
// ----------------------------------------------------------------------------
-AudioDeviceWindowsCore::AudioDeviceWindowsCore(const WebRtc_Word32 id) :
+AudioDeviceWindowsCore::AudioDeviceWindowsCore(const int32_t id) :
_comInit(ScopedCOMInitializer::kMTA),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_volumeMutex(*CriticalSectionWrapper::CreateCriticalSection()),
@@ -670,7 +670,7 @@
// ActiveAudioLayer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const
+int32_t AudioDeviceWindowsCore::ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const
{
audioLayer = AudioDeviceModule::kWindowsCoreAudio;
return 0;
@@ -680,7 +680,7 @@
// Init
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::Init()
+int32_t AudioDeviceWindowsCore::Init()
{
CriticalSectionScoped lock(&_critSect);
@@ -711,7 +711,7 @@
// Terminate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::Terminate()
+int32_t AudioDeviceWindowsCore::Terminate()
{
CriticalSectionScoped lock(&_critSect);
@@ -753,7 +753,7 @@
// SpeakerIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::SpeakerIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -772,7 +772,7 @@
// InitSpeaker
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::InitSpeaker()
+int32_t AudioDeviceWindowsCore::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -789,7 +789,7 @@
if (_usingOutputDeviceIndex)
{
- WebRtc_Word16 nDevices = PlayoutDevices();
+ int16_t nDevices = PlayoutDevices();
if (_outputDeviceIndex > (nDevices - 1))
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "current device selection is invalid => unable to initialize");
@@ -797,7 +797,7 @@
}
}
- WebRtc_Word32 ret(0);
+ int32_t ret(0);
SAFE_RELEASE(_ptrDeviceOut);
if (_usingOutputDeviceIndex)
@@ -854,7 +854,7 @@
// MicrophoneIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::MicrophoneIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -873,7 +873,7 @@
// InitMicrophone
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::InitMicrophone()
+int32_t AudioDeviceWindowsCore::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -890,7 +890,7 @@
if (_usingInputDeviceIndex)
{
- WebRtc_Word16 nDevices = RecordingDevices();
+ int16_t nDevices = RecordingDevices();
if (_inputDeviceIndex > (nDevices - 1))
{
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "current device selection is invalid => unable to initialize");
@@ -898,7 +898,7 @@
}
}
- WebRtc_Word32 ret(0);
+ int32_t ret(0);
SAFE_RELEASE(_ptrDeviceIn);
if (_usingInputDeviceIndex)
@@ -962,7 +962,7 @@
// SpeakerVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::SpeakerVolumeIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -1006,7 +1006,7 @@
// SetSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceWindowsCore::SetSpeakerVolume(uint32_t volume)
{
{
@@ -1023,8 +1023,8 @@
}
}
- if (volume < (WebRtc_UWord32)MIN_CORE_SPEAKER_VOLUME ||
- volume > (WebRtc_UWord32)MAX_CORE_SPEAKER_VOLUME)
+ if (volume < (uint32_t)MIN_CORE_SPEAKER_VOLUME ||
+ volume > (uint32_t)MAX_CORE_SPEAKER_VOLUME)
{
return -1;
}
@@ -1049,7 +1049,7 @@
// SpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceWindowsCore::SpeakerVolume(uint32_t& volume) const
{
{
@@ -1075,7 +1075,7 @@
EXIT_ON_ERROR(hr);
// scale input volume range [0.0,1.0] to valid output range
- volume = static_cast<WebRtc_UWord32> (fLevel*MAX_CORE_SPEAKER_VOLUME);
+ volume = static_cast<uint32_t> (fLevel*MAX_CORE_SPEAKER_VOLUME);
return 0;
@@ -1088,7 +1088,7 @@
// SetWaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetWaveOutVolume(WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight)
+int32_t AudioDeviceWindowsCore::SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight)
{
return -1;
}
@@ -1097,7 +1097,7 @@
// WaveOutVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::WaveOutVolume(WebRtc_UWord16& volumeLeft, WebRtc_UWord16& volumeRight) const
+int32_t AudioDeviceWindowsCore::WaveOutVolume(uint16_t& volumeLeft, uint16_t& volumeRight) const
{
return -1;
}
@@ -1111,7 +1111,7 @@
// how it is used today in VoE.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceWindowsCore::MaxSpeakerVolume(uint32_t& maxVolume) const
{
if (!_speakerIsInitialized)
@@ -1119,7 +1119,7 @@
return -1;
}
- maxVolume = static_cast<WebRtc_UWord32> (MAX_CORE_SPEAKER_VOLUME);
+ maxVolume = static_cast<uint32_t> (MAX_CORE_SPEAKER_VOLUME);
return 0;
}
@@ -1128,7 +1128,7 @@
// MinSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceWindowsCore::MinSpeakerVolume(uint32_t& minVolume) const
{
if (!_speakerIsInitialized)
@@ -1136,7 +1136,7 @@
return -1;
}
- minVolume = static_cast<WebRtc_UWord32> (MIN_CORE_SPEAKER_VOLUME);
+ minVolume = static_cast<uint32_t> (MIN_CORE_SPEAKER_VOLUME);
return 0;
}
@@ -1145,7 +1145,7 @@
// SpeakerVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioDeviceWindowsCore::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
if (!_speakerIsInitialized)
@@ -1162,7 +1162,7 @@
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::SpeakerMuteIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -1201,7 +1201,7 @@
// SetSpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetSpeakerMute(bool enable)
+int32_t AudioDeviceWindowsCore::SetSpeakerMute(bool enable)
{
CriticalSectionScoped lock(&_critSect);
@@ -1241,7 +1241,7 @@
// SpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SpeakerMute(bool& enabled) const
+int32_t AudioDeviceWindowsCore::SpeakerMute(bool& enabled) const
{
if (!_speakerIsInitialized)
@@ -1281,7 +1281,7 @@
// MicrophoneMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::MicrophoneMuteIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -1318,7 +1318,7 @@
// SetMicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetMicrophoneMute(bool enable)
+int32_t AudioDeviceWindowsCore::SetMicrophoneMute(bool enable)
{
if (!_microphoneIsInitialized)
@@ -1355,7 +1355,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneMute(bool& enabled) const
+int32_t AudioDeviceWindowsCore::MicrophoneMute(bool& enabled) const
{
if (!_microphoneIsInitialized)
@@ -1389,7 +1389,7 @@
// MicrophoneBoostIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::MicrophoneBoostIsAvailable(bool& available)
{
available = false;
@@ -1400,7 +1400,7 @@
// SetMicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetMicrophoneBoost(bool enable)
+int32_t AudioDeviceWindowsCore::SetMicrophoneBoost(bool enable)
{
if (!_microphoneIsInitialized)
@@ -1415,7 +1415,7 @@
// MicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneBoost(bool& enabled) const
+int32_t AudioDeviceWindowsCore::MicrophoneBoost(bool& enabled) const
{
if (!_microphoneIsInitialized)
@@ -1430,7 +1430,7 @@
// StereoRecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::StereoRecordingIsAvailable(bool& available)
{
available = true;
@@ -1441,7 +1441,7 @@
// SetStereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetStereoRecording(bool enable)
+int32_t AudioDeviceWindowsCore::SetStereoRecording(bool enable)
{
CriticalSectionScoped lock(&_critSect);
@@ -1466,7 +1466,7 @@
// StereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StereoRecording(bool& enabled) const
+int32_t AudioDeviceWindowsCore::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@@ -1481,7 +1481,7 @@
// StereoPlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::StereoPlayoutIsAvailable(bool& available)
{
available = true;
@@ -1492,7 +1492,7 @@
// SetStereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetStereoPlayout(bool enable)
+int32_t AudioDeviceWindowsCore::SetStereoPlayout(bool enable)
{
CriticalSectionScoped lock(&_critSect);
@@ -1517,7 +1517,7 @@
// StereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceWindowsCore::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@@ -1532,7 +1532,7 @@
// SetAGC
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetAGC(bool enable)
+int32_t AudioDeviceWindowsCore::SetAGC(bool enable)
{
CriticalSectionScoped lock(&_critSect);
_AGC = enable;
@@ -1553,7 +1553,7 @@
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::MicrophoneVolumeIsAvailable(bool& available)
{
CriticalSectionScoped lock(&_critSect);
@@ -1590,7 +1590,7 @@
// SetMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceWindowsCore::SetMicrophoneVolume(uint32_t volume)
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "AudioDeviceWindowsCore::SetMicrophoneVolume(volume=%u)", volume);
@@ -1608,8 +1608,8 @@
}
}
- if (volume < static_cast<WebRtc_UWord32>(MIN_CORE_MICROPHONE_VOLUME) ||
- volume > static_cast<WebRtc_UWord32>(MAX_CORE_MICROPHONE_VOLUME))
+ if (volume < static_cast<uint32_t>(MIN_CORE_MICROPHONE_VOLUME) ||
+ volume > static_cast<uint32_t>(MAX_CORE_MICROPHONE_VOLUME))
{
return -1;
}
@@ -1633,7 +1633,7 @@
// MicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceWindowsCore::MicrophoneVolume(uint32_t& volume) const
{
{
CriticalSectionScoped lock(&_critSect);
@@ -1658,7 +1658,7 @@
EXIT_ON_ERROR(hr);
// scale input volume range [0.0,1.0] to valid output range
- volume = static_cast<WebRtc_UWord32> (fLevel*MAX_CORE_MICROPHONE_VOLUME);
+ volume = static_cast<uint32_t> (fLevel*MAX_CORE_MICROPHONE_VOLUME);
return 0;
@@ -1676,7 +1676,7 @@
// how it is used today in VoE.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceWindowsCore::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -1685,7 +1685,7 @@
return -1;
}
- maxVolume = static_cast<WebRtc_UWord32> (MAX_CORE_MICROPHONE_VOLUME);
+ maxVolume = static_cast<uint32_t> (MAX_CORE_MICROPHONE_VOLUME);
return 0;
}
@@ -1694,7 +1694,7 @@
// MinMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceWindowsCore::MinMicrophoneVolume(uint32_t& minVolume) const
{
if (!_microphoneIsInitialized)
@@ -1702,7 +1702,7 @@
return -1;
}
- minVolume = static_cast<WebRtc_UWord32> (MIN_CORE_MICROPHONE_VOLUME);
+ minVolume = static_cast<uint32_t> (MIN_CORE_MICROPHONE_VOLUME);
return 0;
}
@@ -1711,7 +1711,7 @@
// MicrophoneVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioDeviceWindowsCore::MicrophoneVolumeStepSize(uint16_t& stepSize) const
{
if (!_microphoneIsInitialized)
@@ -1728,7 +1728,7 @@
// PlayoutDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceWindowsCore::PlayoutDevices()
+int16_t AudioDeviceWindowsCore::PlayoutDevices()
{
CriticalSectionScoped lock(&_critSect);
@@ -1745,7 +1745,7 @@
// SetPlayoutDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceWindowsCore::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@@ -1799,7 +1799,7 @@
// SetPlayoutDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioDeviceWindowsCore::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)
{
if (_playIsInitialized)
{
@@ -1858,17 +1858,17 @@
// PlayoutDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceWindowsCore::PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
bool defaultCommunicationDevice(false);
- const WebRtc_Word16 nDevices(PlayoutDevices()); // also updates the list of devices
+ const int16_t nDevices(PlayoutDevices()); // also updates the list of devices
// Special fix for the case when the user selects '-1' as index (<=> Default Communication Device)
- if (index == (WebRtc_UWord16)(-1))
+ if (index == (uint16_t)(-1))
{
defaultCommunicationDevice = true;
index = 0;
@@ -1889,7 +1889,7 @@
CriticalSectionScoped lock(&_critSect);
- WebRtc_Word32 ret(-1);
+ int32_t ret(-1);
WCHAR szDeviceName[MAX_PATH];
const int bufferLen = sizeof(szDeviceName)/sizeof(szDeviceName)[0];
@@ -1938,17 +1938,17 @@
// RecordingDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceWindowsCore::RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
bool defaultCommunicationDevice(false);
- const WebRtc_Word16 nDevices(RecordingDevices()); // also updates the list of devices
+ const int16_t nDevices(RecordingDevices()); // also updates the list of devices
// Special fix for the case when the user selects '-1' as index (<=> Default Communication Device)
- if (index == (WebRtc_UWord16)(-1))
+ if (index == (uint16_t)(-1))
{
defaultCommunicationDevice = true;
index = 0;
@@ -1969,7 +1969,7 @@
CriticalSectionScoped lock(&_critSect);
- WebRtc_Word32 ret(-1);
+ int32_t ret(-1);
WCHAR szDeviceName[MAX_PATH];
const int bufferLen = sizeof(szDeviceName)/sizeof(szDeviceName)[0];
@@ -2018,7 +2018,7 @@
// RecordingDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceWindowsCore::RecordingDevices()
+int16_t AudioDeviceWindowsCore::RecordingDevices()
{
CriticalSectionScoped lock(&_critSect);
@@ -2035,7 +2035,7 @@
// SetRecordingDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceWindowsCore::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@@ -2089,7 +2089,7 @@
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioDeviceWindowsCore::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)
{
if (_recIsInitialized)
{
@@ -2148,13 +2148,13 @@
// PlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::PlayoutIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::PlayoutIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
- WebRtc_Word32 res = InitPlayout();
+ int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@@ -2171,13 +2171,13 @@
// RecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::RecordingIsAvailable(bool& available)
+int32_t AudioDeviceWindowsCore::RecordingIsAvailable(bool& available)
{
available = false;
// Try to initialize the recording side
- WebRtc_Word32 res = InitRecording();
+ int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@@ -2194,7 +2194,7 @@
// InitPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::InitPlayout()
+int32_t AudioDeviceWindowsCore::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -2396,7 +2396,7 @@
{
// Update the audio buffer with the selected parameters
_ptrAudioBuffer->SetPlayoutSampleRate(_playSampleRate);
- _ptrAudioBuffer->SetPlayoutChannels((WebRtc_UWord8)_playChannels);
+ _ptrAudioBuffer->SetPlayoutChannels((uint8_t)_playChannels);
}
else
{
@@ -2452,7 +2452,7 @@
// used. Called from InitRecording(), most of which is skipped over. The DMO
// handles device initialization itself.
// Reference: http://msdn.microsoft.com/en-us/library/ff819492(v=vs.85).aspx
-WebRtc_Word32 AudioDeviceWindowsCore::InitRecordingDMO()
+int32_t AudioDeviceWindowsCore::InitRecordingDMO()
{
assert(_builtInAecEnabled);
assert(_dmo != NULL);
@@ -2536,7 +2536,7 @@
// InitRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::InitRecording()
+int32_t AudioDeviceWindowsCore::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -2711,7 +2711,7 @@
{
// Update the audio buffer with the selected parameters
_ptrAudioBuffer->SetRecordingSampleRate(_recSampleRate);
- _ptrAudioBuffer->SetRecordingChannels((WebRtc_UWord8)_recChannels);
+ _ptrAudioBuffer->SetRecordingChannels((uint8_t)_recChannels);
}
else
{
@@ -2767,7 +2767,7 @@
// StartRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StartRecording()
+int32_t AudioDeviceWindowsCore::StartRecording()
{
if (!_recIsInitialized)
@@ -2873,9 +2873,9 @@
// StopRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StopRecording()
+int32_t AudioDeviceWindowsCore::StopRecording()
{
- WebRtc_Word32 err = 0;
+ int32_t err = 0;
if (!_recIsInitialized)
{
@@ -3017,7 +3017,7 @@
// StartPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StartPlayout()
+int32_t AudioDeviceWindowsCore::StartPlayout()
{
if (!_playIsInitialized)
@@ -3077,7 +3077,7 @@
// StopPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::StopPlayout()
+int32_t AudioDeviceWindowsCore::StopPlayout()
{
if (!_playIsInitialized)
@@ -3161,10 +3161,10 @@
// PlayoutDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::PlayoutDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceWindowsCore::PlayoutDelay(uint16_t& delayMS) const
{
CriticalSectionScoped critScoped(&_critSect);
- delayMS = static_cast<WebRtc_UWord16>(_sndCardPlayDelay);
+ delayMS = static_cast<uint16_t>(_sndCardPlayDelay);
return 0;
}
@@ -3172,10 +3172,10 @@
// RecordingDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::RecordingDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceWindowsCore::RecordingDelay(uint16_t& delayMS) const
{
CriticalSectionScoped critScoped(&_critSect);
- delayMS = static_cast<WebRtc_UWord16>(_sndCardRecDelay);
+ delayMS = static_cast<uint16_t>(_sndCardRecDelay);
return 0;
}
@@ -3191,7 +3191,7 @@
// SetPlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS)
+int32_t AudioDeviceWindowsCore::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, uint16_t sizeMS)
{
CriticalSectionScoped lock(&_critSect);
@@ -3210,7 +3210,7 @@
// PlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::PlayoutBuffer(AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const
+int32_t AudioDeviceWindowsCore::PlayoutBuffer(AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const
{
CriticalSectionScoped lock(&_critSect);
type = _playBufType;
@@ -3222,7 +3222,7 @@
else
{
// Use same value as for PlayoutDelay
- sizeMS = static_cast<WebRtc_UWord16>(_sndCardPlayDelay);
+ sizeMS = static_cast<uint16_t>(_sndCardPlayDelay);
}
return 0;
@@ -3232,10 +3232,10 @@
// CPULoad
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::CPULoad(WebRtc_UWord16& load) const
+int32_t AudioDeviceWindowsCore::CPULoad(uint16_t& load) const
{
- load = static_cast<WebRtc_UWord16> (100*_avgCPULoad);
+ load = static_cast<uint16_t> (100*_avgCPULoad);
return 0;
}
@@ -3362,7 +3362,7 @@
{
if (AGC())
{
- WebRtc_UWord32 currentMicLevel = 0;
+ uint32_t currentMicLevel = 0;
if (MicrophoneVolume(currentMicLevel) == 0)
{
// This doesn't set the system volume, just stores it.
@@ -3411,7 +3411,7 @@
}
_Lock();
- WebRtc_UWord32 newMicLevel = _newMicLevel;
+ uint32_t newMicLevel = _newMicLevel;
_UnLock();
if (SetMicrophoneVolume(newMicLevel) == -1)
@@ -3436,7 +3436,7 @@
LARGE_INTEGER t1;
LARGE_INTEGER t2;
- WebRtc_Word32 time(0);
+ int32_t time(0);
// Initialize COM as MTA in this thread.
ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
@@ -3586,7 +3586,7 @@
EXIT_ON_ERROR(hr);
// Derive the amount of available space in the output buffer
- WebRtc_UWord32 framesAvailable = bufferLength - padding;
+ uint32_t framesAvailable = bufferLength - padding;
// WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "#avaliable audio frames = %u", framesAvailable);
// Do we have 10 ms available in the render buffer?
@@ -3598,8 +3598,8 @@
}
// Write n*10ms buffers to the render buffer
- const WebRtc_UWord32 n10msBuffers = (framesAvailable / _playBlockSize);
- for (WebRtc_UWord32 n = 0; n < n10msBuffers; n++)
+ const uint32_t n10msBuffers = (framesAvailable / _playBlockSize);
+ for (uint32_t n = 0; n < n10msBuffers; n++)
{
// Get pointer (i.e., grab the buffer) to next space in the shared render buffer.
hr = _ptrRenderClient->GetBuffer(_playBlockSize, &pData);
@@ -3611,7 +3611,7 @@
{
// Request data to be played out (#bytes = _playBlockSize*_audioFrameSize)
_UnLock();
- WebRtc_Word32 nSamples =
+ int32_t nSamples =
_ptrAudioBuffer->RequestPlayoutData(_playBlockSize);
_Lock();
@@ -3630,13 +3630,13 @@
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, "output state has been modified during unlocked period");
goto Exit;
}
- if (nSamples != static_cast<WebRtc_Word32>(_playBlockSize))
+ if (nSamples != static_cast<int32_t>(_playBlockSize))
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "nSamples(%d) != _playBlockSize(%d)", nSamples, _playBlockSize);
}
// Get the actual (stored) data
- nSamples = _ptrAudioBuffer->GetPlayoutData((WebRtc_Word8*)pData);
+ nSamples = _ptrAudioBuffer->GetPlayoutData((int8_t*)pData);
}
QueryPerformanceCounter(&t2); // measure time: STOP
@@ -3854,9 +3854,9 @@
// be that ProcessOutput will try to return more than 10 ms if
// we fail to call it frequently enough.
assert(kSamplesProduced == static_cast<int>(_recBlockSize));
- assert(sizeof(BYTE) == sizeof(WebRtc_Word8));
+ assert(sizeof(BYTE) == sizeof(int8_t));
_ptrAudioBuffer->SetRecordedBuffer(
- reinterpret_cast<WebRtc_Word8*>(data),
+ reinterpret_cast<int8_t*>(data),
kSamplesProduced);
_ptrAudioBuffer->SetVQEData(0, 0, 0);
@@ -3919,7 +3919,7 @@
LARGE_INTEGER t1;
LARGE_INTEGER t2;
- WebRtc_Word32 time(0);
+ int32_t time(0);
BYTE* syncBuffer = NULL;
UINT32 syncBufIndex = 0;
@@ -4085,11 +4085,11 @@
QueryPerformanceCounter(&t1);
// Get the current recording and playout delay.
- WebRtc_UWord32 sndCardRecDelay = (WebRtc_UWord32)
+ uint32_t sndCardRecDelay = (uint32_t)
(((((UINT64)t1.QuadPart * _perfCounterFactor) - recTime)
/ 10000) + (10*syncBufIndex) / _recBlockSize - 10);
- WebRtc_UWord32 sndCardPlayDelay =
- static_cast<WebRtc_UWord32>(_sndCardPlayDelay);
+ uint32_t sndCardPlayDelay =
+ static_cast<uint32_t>(_sndCardPlayDelay);
_sndCardRecDelay = sndCardRecDelay;
@@ -4097,11 +4097,11 @@
{
if (_ptrAudioBuffer)
{
- _ptrAudioBuffer->SetRecordedBuffer((const WebRtc_Word8*)syncBuffer, _recBlockSize);
+ _ptrAudioBuffer->SetRecordedBuffer((const int8_t*)syncBuffer, _recBlockSize);
_driftAccumulator += _sampleDriftAt48kHz;
- const WebRtc_Word32 clockDrift =
- static_cast<WebRtc_Word32>(_driftAccumulator);
+ const int32_t clockDrift =
+ static_cast<int32_t>(_driftAccumulator);
_driftAccumulator -= clockDrift;
_ptrAudioBuffer->SetVQEData(sndCardPlayDelay,
@@ -4141,7 +4141,7 @@
if (_AGC)
{
- WebRtc_UWord32 newMicLevel = _ptrAudioBuffer->NewMicLevel();
+ uint32_t newMicLevel = _ptrAudioBuffer->NewMicLevel();
if (newMicLevel != 0)
{
// The VQE will only deliver non-zero microphone levels when a change is needed.
@@ -4411,7 +4411,7 @@
// such devices.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir)
+int32_t AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4454,7 +4454,7 @@
// current list of such devices.
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceWindowsCore::_DeviceListCount(EDataFlow dir)
+int16_t AudioDeviceWindowsCore::_DeviceListCount(EDataFlow dir)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4478,7 +4478,7 @@
return -1;
}
- return static_cast<WebRtc_Word16> (count);
+ return static_cast<int16_t> (count);
}
// ----------------------------------------------------------------------------
@@ -4492,7 +4492,7 @@
// in _RefreshDeviceList().
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetListDeviceName(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetListDeviceName(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4517,7 +4517,7 @@
return -1;
}
- WebRtc_Word32 res = _GetDeviceName(pDevice, szBuffer, bufferLen);
+ int32_t res = _GetDeviceName(pDevice, szBuffer, bufferLen);
SAFE_RELEASE(pDevice);
return res;
}
@@ -4531,7 +4531,7 @@
// Uses: _ptrEnumerator
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDefaultDeviceName(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetDefaultDeviceName(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4554,7 +4554,7 @@
return -1;
}
- WebRtc_Word32 res = _GetDeviceName(pDevice, szBuffer, bufferLen);
+ int32_t res = _GetDeviceName(pDevice, szBuffer, bufferLen);
SAFE_RELEASE(pDevice);
return res;
}
@@ -4570,7 +4570,7 @@
// in _RefreshDeviceList().
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetListDeviceID(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetListDeviceID(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4595,7 +4595,7 @@
return -1;
}
- WebRtc_Word32 res = _GetDeviceID(pDevice, szBuffer, bufferLen);
+ int32_t res = _GetDeviceID(pDevice, szBuffer, bufferLen);
SAFE_RELEASE(pDevice);
return res;
}
@@ -4609,7 +4609,7 @@
// Uses: _ptrEnumerator
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDefaultDeviceID(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetDefaultDeviceID(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4632,14 +4632,14 @@
return -1;
}
- WebRtc_Word32 res = _GetDeviceID(pDevice, szBuffer, bufferLen);
+ int32_t res = _GetDeviceID(pDevice, szBuffer, bufferLen);
SAFE_RELEASE(pDevice);
return res;
}
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir,
- ERole role,
- int* index)
+int32_t AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir,
+ ERole role,
+ int* index)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4725,9 +4725,9 @@
// _GetDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice,
- LPWSTR pszBuffer,
- int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice,
+ LPWSTR pszBuffer,
+ int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4800,7 +4800,7 @@
// _GetDeviceID
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen)
+int32_t AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4836,7 +4836,7 @@
// _GetDefaultDevice
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetDefaultDevice(EDataFlow dir, ERole role, IMMDevice** ppDevice)
+int32_t AudioDeviceWindowsCore::_GetDefaultDevice(EDataFlow dir, ERole role, IMMDevice** ppDevice)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -4861,7 +4861,7 @@
// _GetListDevice
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_GetListDevice(EDataFlow dir, int index, IMMDevice** ppDevice)
+int32_t AudioDeviceWindowsCore::_GetListDevice(EDataFlow dir, int index, IMMDevice** ppDevice)
{
HRESULT hr(S_OK);
@@ -4897,7 +4897,7 @@
// _EnumerateEndpointDevicesAll
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsCore::_EnumerateEndpointDevicesAll(EDataFlow dataFlow) const
+int32_t AudioDeviceWindowsCore::_EnumerateEndpointDevicesAll(EDataFlow dataFlow) const
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
diff --git a/modules/audio_device/win/audio_device_core_win.h b/modules/audio_device/win/audio_device_core_win.h
index 1c1c6c5..ea28f7c 100644
--- a/modules/audio_device/win/audio_device_core_win.h
+++ b/modules/audio_device/win/audio_device_core_win.h
@@ -41,8 +41,8 @@
const float MIN_CORE_SPEAKER_VOLUME = 0.0f;
const float MAX_CORE_MICROPHONE_VOLUME = 255.0f;
const float MIN_CORE_MICROPHONE_VOLUME = 0.0f;
-const WebRtc_UWord16 CORE_SPEAKER_VOLUME_STEP_SIZE = 1;
-const WebRtc_UWord16 CORE_MICROPHONE_VOLUME_STEP_SIZE = 1;
+const uint16_t CORE_SPEAKER_VOLUME_STEP_SIZE = 1;
+const uint16_t CORE_MICROPHONE_VOLUME_STEP_SIZE = 1;
// Utility class which initializes COM in the constructor (STA or MTA),
// and uninitializes COM in the destructor.
@@ -83,116 +83,116 @@
class AudioDeviceWindowsCore : public AudioDeviceGeneric
{
public:
- AudioDeviceWindowsCore(const WebRtc_Word32 id);
+ AudioDeviceWindowsCore(const int32_t id);
~AudioDeviceWindowsCore();
static bool CoreAudioIsSupported();
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32 ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const;
+ 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(AudioDeviceModule::WindowsDeviceType device);
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
- virtual WebRtc_Word32 SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device);
+ virtual int32_t SetPlayoutDevice(uint16_t index);
+ virtual int32_t SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device);
+ 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(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;
+ virtual int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type, 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;
virtual int32_t EnableBuiltInAEC(bool enable);
virtual bool BuiltInAECIsEnabled() const;
@@ -240,7 +240,7 @@
void _UnLock() { _critSect.Leave(); };
private:
- WebRtc_Word32 Id() {return _id;}
+ int32_t Id() {return _id;}
private:
int SetDMOProperties();
@@ -253,20 +253,20 @@
REFPROPERTYKEY key,
LONG value);
- WebRtc_Word32 _EnumerateEndpointDevicesAll(EDataFlow dataFlow) const;
+ int32_t _EnumerateEndpointDevicesAll(EDataFlow dataFlow) const;
void _TraceCOMError(HRESULT hr) const;
- WebRtc_Word32 _RefreshDeviceList(EDataFlow dir);
- WebRtc_Word16 _DeviceListCount(EDataFlow dir);
- WebRtc_Word32 _GetDefaultDeviceName(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen);
- WebRtc_Word32 _GetListDeviceName(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen);
- WebRtc_Word32 _GetDeviceName(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen);
- WebRtc_Word32 _GetListDeviceID(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen);
- WebRtc_Word32 _GetDefaultDeviceID(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen);
- WebRtc_Word32 _GetDefaultDeviceIndex(EDataFlow dir, ERole role, int* index);
- WebRtc_Word32 _GetDeviceID(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen);
- WebRtc_Word32 _GetDefaultDevice(EDataFlow dir, ERole role, IMMDevice** ppDevice);
- WebRtc_Word32 _GetListDevice(EDataFlow dir, int index, IMMDevice** ppDevice);
+ int32_t _RefreshDeviceList(EDataFlow dir);
+ int16_t _DeviceListCount(EDataFlow dir);
+ int32_t _GetDefaultDeviceName(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen);
+ int32_t _GetListDeviceName(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen);
+ int32_t _GetDeviceName(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen);
+ int32_t _GetListDeviceID(EDataFlow dir, int index, LPWSTR szBuffer, int bufferLen);
+ int32_t _GetDefaultDeviceID(EDataFlow dir, ERole role, LPWSTR szBuffer, int bufferLen);
+ int32_t _GetDefaultDeviceIndex(EDataFlow dir, ERole role, int* index);
+ int32_t _GetDeviceID(IMMDevice* pDevice, LPWSTR pszBuffer, int bufferLen);
+ int32_t _GetDefaultDevice(EDataFlow dir, ERole role, IMMDevice** ppDevice);
+ int32_t _GetListDevice(EDataFlow dir, int index, IMMDevice** ppDevice);
void _Get44kHzDrift();
@@ -274,14 +274,14 @@
// Does nothing if UNICODE is undefined.
char* WideToUTF8(const TCHAR* src) const;
- WebRtc_Word32 InitRecordingDMO();
+ int32_t InitRecordingDMO();
private:
ScopedCOMInitializer _comInit;
AudioDeviceBuffer* _ptrAudioBuffer;
CriticalSectionWrapper& _critSect;
CriticalSectionWrapper& _volumeMutex;
- WebRtc_Word32 _id;
+ int32_t _id;
private: // MMDevice
IMMDeviceEnumerator* _ptrEnumerator;
@@ -320,27 +320,27 @@
HANDLE _hMmTask;
UINT _playAudioFrameSize;
- WebRtc_UWord32 _playSampleRate;
- WebRtc_UWord32 _devicePlaySampleRate;
- WebRtc_UWord32 _playBlockSize;
- WebRtc_UWord32 _devicePlayBlockSize;
- WebRtc_UWord32 _playChannels;
- WebRtc_UWord32 _sndCardPlayDelay;
+ uint32_t _playSampleRate;
+ uint32_t _devicePlaySampleRate;
+ uint32_t _playBlockSize;
+ uint32_t _devicePlayBlockSize;
+ uint32_t _playChannels;
+ uint32_t _sndCardPlayDelay;
UINT64 _writtenSamples;
LONGLONG _playAcc;
UINT _recAudioFrameSize;
- WebRtc_UWord32 _recSampleRate;
- WebRtc_UWord32 _recBlockSize;
- WebRtc_UWord32 _recChannels;
+ uint32_t _recSampleRate;
+ uint32_t _recBlockSize;
+ uint32_t _recChannels;
UINT64 _readSamples;
- WebRtc_UWord32 _sndCardRecDelay;
+ uint32_t _sndCardRecDelay;
float _sampleDriftAt48kHz;
float _driftAccumulator;
- WebRtc_UWord16 _recChannelsPrioList[2];
- WebRtc_UWord16 _playChannelsPrioList[2];
+ uint16_t _recChannelsPrioList[2];
+ uint16_t _playChannelsPrioList[2];
LARGE_INTEGER _perfCounterFreq;
double _perfCounterFactor;
@@ -359,21 +359,21 @@
bool _usingOutputDeviceIndex;
AudioDeviceModule::WindowsDeviceType _inputDevice;
AudioDeviceModule::WindowsDeviceType _outputDevice;
- WebRtc_UWord16 _inputDeviceIndex;
- WebRtc_UWord16 _outputDeviceIndex;
+ uint16_t _inputDeviceIndex;
+ uint16_t _outputDeviceIndex;
bool _AGC;
- WebRtc_UWord16 _playWarning;
- WebRtc_UWord16 _playError;
- WebRtc_UWord16 _recWarning;
- WebRtc_UWord16 _recError;
+ uint16_t _playWarning;
+ uint16_t _playError;
+ uint16_t _recWarning;
+ uint16_t _recError;
AudioDeviceModule::BufferType _playBufType;
- WebRtc_UWord16 _playBufDelay;
- WebRtc_UWord16 _playBufDelayFixed;
+ uint16_t _playBufDelay;
+ uint16_t _playBufDelayFixed;
- WebRtc_UWord16 _newMicLevel;
+ uint16_t _newMicLevel;
mutable char _str[512];
};
diff --git a/modules/audio_device/win/audio_device_utility_win.cc b/modules/audio_device/win/audio_device_utility_win.cc
index 49fb522..abbbc37 100644
--- a/modules/audio_device/win/audio_device_utility_win.cc
+++ b/modules/audio_device/win/audio_device_utility_win.cc
@@ -34,7 +34,7 @@
// AudioDeviceUtilityWindows() - ctor
// ----------------------------------------------------------------------------
-AudioDeviceUtilityWindows::AudioDeviceUtilityWindows(const WebRtc_Word32 id) :
+AudioDeviceUtilityWindows::AudioDeviceUtilityWindows(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
_lastError(AudioDeviceModule::kAdmErrNone)
@@ -66,7 +66,7 @@
// Init()
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceUtilityWindows::Init()
+int32_t AudioDeviceUtilityWindows::Init()
{
TCHAR szOS[STRING_MAX_SIZE];
diff --git a/modules/audio_device/win/audio_device_utility_win.h b/modules/audio_device/win/audio_device_utility_win.h
index 77b4c22..b483a61 100644
--- a/modules/audio_device/win/audio_device_utility_win.h
+++ b/modules/audio_device/win/audio_device_utility_win.h
@@ -22,17 +22,17 @@
class AudioDeviceUtilityWindows : public AudioDeviceUtility
{
public:
- AudioDeviceUtilityWindows(const WebRtc_Word32 id);
+ AudioDeviceUtilityWindows(const int32_t id);
~AudioDeviceUtilityWindows();
- virtual WebRtc_Word32 Init();
+ virtual int32_t Init();
private:
BOOL GetOSDisplayString(LPTSTR pszOS);
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioDeviceModule::ErrorCode _lastError;
};
diff --git a/modules/audio_device/win/audio_device_wave_win.cc b/modules/audio_device/win/audio_device_wave_win.cc
index 17edc7b..9368748 100644
--- a/modules/audio_device/win/audio_device_wave_win.cc
+++ b/modules/audio_device/win/audio_device_wave_win.cc
@@ -45,7 +45,7 @@
// AudioDeviceWindowsWave - ctor
// ----------------------------------------------------------------------------
-AudioDeviceWindowsWave::AudioDeviceWindowsWave(const WebRtc_Word32 id) :
+AudioDeviceWindowsWave::AudioDeviceWindowsWave(const int32_t id) :
_ptrAudioBuffer(NULL),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_timeEvent(*EventWrapper::Create()),
@@ -189,7 +189,7 @@
// ActiveAudioLayer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const
+int32_t AudioDeviceWindowsWave::ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const
{
audioLayer = AudioDeviceModule::kWindowsWaveAudio;
return 0;
@@ -199,7 +199,7 @@
// Init
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::Init()
+int32_t AudioDeviceWindowsWave::Init()
{
CriticalSectionScoped lock(&_critSect);
@@ -209,7 +209,7 @@
return 0;
}
- const WebRtc_UWord32 nowTime(AudioDeviceUtility::GetTimeInMS());
+ const uint32_t nowTime(AudioDeviceUtility::GetTimeInMS());
_recordedBytes = 0;
_prevRecByteCheckTime = nowTime;
@@ -312,7 +312,7 @@
// Terminate
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::Terminate()
+int32_t AudioDeviceWindowsWave::Terminate()
{
if (!_initialized)
@@ -353,7 +353,7 @@
_critSect.Enter();
SetEvent(_hShutdownGetVolumeEvent);
_critSect.Leave();
- WebRtc_Word32 ret = WaitForSingleObject(_hGetCaptureVolumeThread, 2000);
+ int32_t ret = WaitForSingleObject(_hGetCaptureVolumeThread, 2000);
if (ret != WAIT_OBJECT_0)
{
// the thread did not stop as it should
@@ -433,7 +433,7 @@
if (AGC())
{
- WebRtc_UWord32 currentMicLevel = 0;
+ uint32_t currentMicLevel = 0;
if (MicrophoneVolume(currentMicLevel) == 0)
{
// This doesn't set the system volume, just stores it.
@@ -468,7 +468,7 @@
}
_critSect.Enter();
- WebRtc_UWord32 newMicLevel = _newMicLevel;
+ uint32_t newMicLevel = _newMicLevel;
_critSect.Leave();
if (SetMicrophoneVolume(newMicLevel) == -1)
@@ -493,7 +493,7 @@
// SpeakerIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::SpeakerIsAvailable(bool& available)
{
// Enumerate all avaliable speakers and make an attempt to open up the
@@ -520,7 +520,7 @@
// InitSpeaker
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::InitSpeaker()
+int32_t AudioDeviceWindowsWave::InitSpeaker()
{
CriticalSectionScoped lock(&_critSect);
@@ -558,7 +558,7 @@
// MicrophoneIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::MicrophoneIsAvailable(bool& available)
{
// Enumerate all avaliable microphones and make an attempt to open up the
@@ -585,7 +585,7 @@
// InitMicrophone
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::InitMicrophone()
+int32_t AudioDeviceWindowsWave::InitMicrophone()
{
CriticalSectionScoped lock(&_critSect);
@@ -616,7 +616,7 @@
}
}
- WebRtc_UWord32 maxVol = 0;
+ uint32_t maxVol = 0;
if (_mixerManager.MaxMicrophoneVolume(maxVol) == -1)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -624,7 +624,7 @@
}
_maxMicVolume = maxVol;
- WebRtc_UWord32 minVol = 0;
+ uint32_t minVol = 0;
if (_mixerManager.MinMicrophoneVolume(minVol) == -1)
{
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
@@ -657,7 +657,7 @@
// SpeakerVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::SpeakerVolumeIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -688,7 +688,7 @@
// SetSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceWindowsWave::SetSpeakerVolume(uint32_t volume)
{
return (_mixerManager.SetSpeakerVolume(volume));
@@ -698,10 +698,10 @@
// SpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceWindowsWave::SpeakerVolume(uint32_t& volume) const
{
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_mixerManager.SpeakerVolume(level) == -1)
{
@@ -729,7 +729,7 @@
// 0x4000, 0x4FFF, and 0x43BE will all be truncated to 0x4000.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetWaveOutVolume(WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight)
+int32_t AudioDeviceWindowsWave::SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight)
{
MMRESULT res(0);
@@ -793,7 +793,7 @@
// control.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::WaveOutVolume(WebRtc_UWord16& volumeLeft, WebRtc_UWord16& volumeRight) const
+int32_t AudioDeviceWindowsWave::WaveOutVolume(uint16_t& volumeLeft, uint16_t& volumeRight) const
{
MMRESULT res(0);
@@ -840,8 +840,8 @@
WORD wVolumeLeft = LOWORD(dwVolume);
WORD wVolumeRight = HIWORD(dwVolume);
- volumeLeft = static_cast<WebRtc_UWord16> (wVolumeLeft);
- volumeRight = static_cast<WebRtc_UWord16> (wVolumeRight);
+ volumeLeft = static_cast<uint16_t> (wVolumeLeft);
+ volumeRight = static_cast<uint16_t> (wVolumeRight);
return 0;
}
@@ -850,10 +850,10 @@
// MaxSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceWindowsWave::MaxSpeakerVolume(uint32_t& maxVolume) const
{
- WebRtc_UWord32 maxVol(0);
+ uint32_t maxVol(0);
if (_mixerManager.MaxSpeakerVolume(maxVol) == -1)
{
@@ -868,10 +868,10 @@
// MinSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceWindowsWave::MinSpeakerVolume(uint32_t& minVolume) const
{
- WebRtc_UWord32 minVol(0);
+ uint32_t minVol(0);
if (_mixerManager.MinSpeakerVolume(minVol) == -1)
{
@@ -886,10 +886,10 @@
// SpeakerVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioDeviceWindowsWave::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
{
@@ -904,7 +904,7 @@
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::SpeakerMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -937,7 +937,7 @@
// SetSpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetSpeakerMute(bool enable)
+int32_t AudioDeviceWindowsWave::SetSpeakerMute(bool enable)
{
return (_mixerManager.SetSpeakerMute(enable));
}
@@ -946,7 +946,7 @@
// SpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SpeakerMute(bool& enabled) const
+int32_t AudioDeviceWindowsWave::SpeakerMute(bool& enabled) const
{
bool muted(0);
@@ -964,7 +964,7 @@
// MicrophoneMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::MicrophoneMuteIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -997,7 +997,7 @@
// SetMicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetMicrophoneMute(bool enable)
+int32_t AudioDeviceWindowsWave::SetMicrophoneMute(bool enable)
{
return (_mixerManager.SetMicrophoneMute(enable));
}
@@ -1006,7 +1006,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneMute(bool& enabled) const
+int32_t AudioDeviceWindowsWave::MicrophoneMute(bool& enabled) const
{
bool muted(0);
@@ -1024,7 +1024,7 @@
// MicrophoneBoostIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::MicrophoneBoostIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -1057,7 +1057,7 @@
// SetMicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetMicrophoneBoost(bool enable)
+int32_t AudioDeviceWindowsWave::SetMicrophoneBoost(bool enable)
{
return (_mixerManager.SetMicrophoneBoost(enable));
@@ -1067,7 +1067,7 @@
// MicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneBoost(bool& enabled) const
+int32_t AudioDeviceWindowsWave::MicrophoneBoost(bool& enabled) const
{
bool onOff(0);
@@ -1085,7 +1085,7 @@
// StereoRecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StereoRecordingIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::StereoRecordingIsAvailable(bool& available)
{
available = true;
return 0;
@@ -1095,7 +1095,7 @@
// SetStereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetStereoRecording(bool enable)
+int32_t AudioDeviceWindowsWave::SetStereoRecording(bool enable)
{
if (enable)
@@ -1110,7 +1110,7 @@
// StereoRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StereoRecording(bool& enabled) const
+int32_t AudioDeviceWindowsWave::StereoRecording(bool& enabled) const
{
if (_recChannels == 2)
@@ -1125,7 +1125,7 @@
// StereoPlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StereoPlayoutIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::StereoPlayoutIsAvailable(bool& available)
{
available = true;
return 0;
@@ -1154,7 +1154,7 @@
// high-order byte of channel 1.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetStereoPlayout(bool enable)
+int32_t AudioDeviceWindowsWave::SetStereoPlayout(bool enable)
{
if (enable)
@@ -1169,7 +1169,7 @@
// StereoPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StereoPlayout(bool& enabled) const
+int32_t AudioDeviceWindowsWave::StereoPlayout(bool& enabled) const
{
if (_playChannels == 2)
@@ -1184,7 +1184,7 @@
// SetAGC
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetAGC(bool enable)
+int32_t AudioDeviceWindowsWave::SetAGC(bool enable)
{
_AGC = enable;
@@ -1205,7 +1205,7 @@
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::MicrophoneVolumeIsAvailable(bool& available)
{
bool isAvailable(false);
@@ -1236,7 +1236,7 @@
// SetMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioDeviceWindowsWave::SetMicrophoneVolume(uint32_t volume)
{
return (_mixerManager.SetMicrophoneVolume(volume));
}
@@ -1245,9 +1245,9 @@
// MicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneVolume(WebRtc_UWord32& volume) const
+int32_t AudioDeviceWindowsWave::MicrophoneVolume(uint32_t& volume) const
{
- WebRtc_UWord32 level(0);
+ uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1)
{
@@ -1263,7 +1263,7 @@
// MaxMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioDeviceWindowsWave::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
// _maxMicVolume can be zero in AudioMixerManager::MaxMicrophoneVolume():
// (1) API GetLineControl() returns failure at querying the max Mic level.
@@ -1283,7 +1283,7 @@
// MinMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioDeviceWindowsWave::MinMicrophoneVolume(uint32_t& minVolume) const
{
minVolume = _minMicVolume;
return 0;
@@ -1293,10 +1293,10 @@
// MicrophoneVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioDeviceWindowsWave::MicrophoneVolumeStepSize(uint16_t& stepSize) const
{
- WebRtc_UWord16 delta(0);
+ uint16_t delta(0);
if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
{
@@ -1311,7 +1311,7 @@
// PlayoutDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceWindowsWave::PlayoutDevices()
+int16_t AudioDeviceWindowsWave::PlayoutDevices()
{
return (waveOutGetNumDevs());
@@ -1321,7 +1321,7 @@
// SetPlayoutDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetPlayoutDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceWindowsWave::SetPlayoutDevice(uint16_t index)
{
if (_playIsInitialized)
@@ -1349,7 +1349,7 @@
// SetPlayoutDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioDeviceWindowsWave::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)
{
if (_playIsInitialized)
{
@@ -1374,17 +1374,17 @@
// PlayoutDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PlayoutDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceWindowsWave::PlayoutDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
- WebRtc_UWord16 nDevices(PlayoutDevices());
+ uint16_t nDevices(PlayoutDevices());
// Special fix for the case when the user asks for the name of the default device.
//
- if (index == (WebRtc_UWord16)(-1))
+ if (index == (uint16_t)(-1))
{
index = 0;
}
@@ -1479,17 +1479,17 @@
// RecordingDeviceName
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::RecordingDeviceName(
- WebRtc_UWord16 index,
+int32_t AudioDeviceWindowsWave::RecordingDeviceName(
+ uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize])
{
- WebRtc_UWord16 nDevices(RecordingDevices());
+ uint16_t nDevices(RecordingDevices());
// Special fix for the case when the user asks for the name of the default device.
//
- if (index == (WebRtc_UWord16)(-1))
+ if (index == (uint16_t)(-1))
{
index = 0;
}
@@ -1584,7 +1584,7 @@
// RecordingDevices
// ----------------------------------------------------------------------------
-WebRtc_Word16 AudioDeviceWindowsWave::RecordingDevices()
+int16_t AudioDeviceWindowsWave::RecordingDevices()
{
return (waveInGetNumDevs());
@@ -1594,7 +1594,7 @@
// SetRecordingDevice I (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetRecordingDevice(WebRtc_UWord16 index)
+int32_t AudioDeviceWindowsWave::SetRecordingDevice(uint16_t index)
{
if (_recIsInitialized)
@@ -1622,7 +1622,7 @@
// SetRecordingDevice II (II)
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioDeviceWindowsWave::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)
{
if (device == AudioDeviceModule::kDefaultDevice)
{
@@ -1647,13 +1647,13 @@
// PlayoutIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PlayoutIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::PlayoutIsAvailable(bool& available)
{
available = false;
// Try to initialize the playout side
- WebRtc_Word32 res = InitPlayout();
+ int32_t res = InitPlayout();
// Cancel effect of initialization
StopPlayout();
@@ -1670,13 +1670,13 @@
// RecordingIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::RecordingIsAvailable(bool& available)
+int32_t AudioDeviceWindowsWave::RecordingIsAvailable(bool& available)
{
available = false;
// Try to initialize the recording side
- WebRtc_Word32 res = InitRecording();
+ int32_t res = InitRecording();
// Cancel effect of initialization
StopRecording();
@@ -1693,7 +1693,7 @@
// InitPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::InitPlayout()
+int32_t AudioDeviceWindowsWave::InitPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -1830,7 +1830,7 @@
// Prepare wave-out headers
//
- const WebRtc_UWord8 bytesPerSample = 2*_playChannels;
+ const uint8_t bytesPerSample = 2*_playChannels;
for (int n = 0; n < N_BUFFERS_OUT; n++)
{
@@ -1889,7 +1889,7 @@
// InitRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::InitRecording()
+int32_t AudioDeviceWindowsWave::InitRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -2040,7 +2040,7 @@
// StartRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StartRecording()
+int32_t AudioDeviceWindowsWave::StartRecording()
{
if (!_recIsInitialized)
@@ -2082,7 +2082,7 @@
// StopRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StopRecording()
+int32_t AudioDeviceWindowsWave::StopRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -2191,7 +2191,7 @@
// StartPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StartPlayout()
+int32_t AudioDeviceWindowsWave::StartPlayout()
{
if (!_playIsInitialized)
@@ -2233,7 +2233,7 @@
// StopPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::StopPlayout()
+int32_t AudioDeviceWindowsWave::StopPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -2306,10 +2306,10 @@
// PlayoutDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PlayoutDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceWindowsWave::PlayoutDelay(uint16_t& delayMS) const
{
CriticalSectionScoped lock(&_critSect);
- delayMS = (WebRtc_UWord16)_sndCardPlayDelay;
+ delayMS = (uint16_t)_sndCardPlayDelay;
return 0;
}
@@ -2317,10 +2317,10 @@
// RecordingDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::RecordingDelay(WebRtc_UWord16& delayMS) const
+int32_t AudioDeviceWindowsWave::RecordingDelay(uint16_t& delayMS) const
{
CriticalSectionScoped lock(&_critSect);
- delayMS = (WebRtc_UWord16)_sndCardRecDelay;
+ delayMS = (uint16_t)_sndCardRecDelay;
return 0;
}
@@ -2336,7 +2336,7 @@
// SetPlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS)
+int32_t AudioDeviceWindowsWave::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, uint16_t sizeMS)
{
CriticalSectionScoped lock(&_critSect);
_playBufType = type;
@@ -2351,7 +2351,7 @@
// PlayoutBuffer
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PlayoutBuffer(AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const
+int32_t AudioDeviceWindowsWave::PlayoutBuffer(AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const
{
CriticalSectionScoped lock(&_critSect);
type = _playBufType;
@@ -2371,10 +2371,10 @@
// CPULoad
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::CPULoad(WebRtc_UWord16& load) const
+int32_t AudioDeviceWindowsWave::CPULoad(uint16_t& load) const
{
- load = static_cast<WebRtc_UWord16>(100*_avgCPULoad);
+ load = static_cast<uint16_t>(100*_avgCPULoad);
return 0;
}
@@ -2459,7 +2459,7 @@
// InputSanityCheckAfterUnlockedPeriod
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::InputSanityCheckAfterUnlockedPeriod() const
+int32_t AudioDeviceWindowsWave::InputSanityCheckAfterUnlockedPeriod() const
{
if (_hWaveIn == NULL)
{
@@ -2473,7 +2473,7 @@
// OutputSanityCheckAfterUnlockedPeriod
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::OutputSanityCheckAfterUnlockedPeriod() const
+int32_t AudioDeviceWindowsWave::OutputSanityCheckAfterUnlockedPeriod() const
{
if (_hWaveOut == NULL)
{
@@ -2487,10 +2487,10 @@
// EnumeratePlayoutDevices
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::EnumeratePlayoutDevices()
+int32_t AudioDeviceWindowsWave::EnumeratePlayoutDevices()
{
- WebRtc_UWord16 nDevices(PlayoutDevices());
+ uint16_t nDevices(PlayoutDevices());
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "===============================================================");
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "#output devices: %u", nDevices);
@@ -2539,10 +2539,10 @@
// EnumerateRecordingDevices
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::EnumerateRecordingDevices()
+int32_t AudioDeviceWindowsWave::EnumerateRecordingDevices()
{
- WebRtc_UWord16 nDevices(RecordingDevices());
+ uint16_t nDevices(RecordingDevices());
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "===============================================================");
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "#input devices: %u", nDevices);
@@ -2664,7 +2664,7 @@
// PrepareStartPlayout
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PrepareStartPlayout()
+int32_t AudioDeviceWindowsWave::PrepareStartPlayout()
{
CriticalSectionScoped lock(&_critSect);
@@ -2701,7 +2701,7 @@
// PrepareStartRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::PrepareStartRecording()
+int32_t AudioDeviceWindowsWave::PrepareStartRecording()
{
CriticalSectionScoped lock(&_critSect);
@@ -2733,7 +2733,7 @@
for (int n = 0; n < N_BUFFERS_IN; n++)
{
- const WebRtc_UWord8 nBytesPerSample = 2*_recChannels;
+ const uint8_t nBytesPerSample = 2*_recChannels;
// set up the input wave header
_waveHeaderIn[n].lpData = reinterpret_cast<LPSTR>(&_recBuffer[n]);
@@ -2776,14 +2776,14 @@
// GetPlayoutBufferDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::GetPlayoutBufferDelay(WebRtc_UWord32& writtenSamples, WebRtc_UWord32& playedSamples)
+int32_t AudioDeviceWindowsWave::GetPlayoutBufferDelay(uint32_t& writtenSamples, uint32_t& playedSamples)
{
int i;
int ms_Header;
long playedDifference;
int msecInPlayoutBuffer(0); // #milliseconds of audio in the playout buffer
- const WebRtc_UWord16 nSamplesPerMs = (WebRtc_UWord16)(N_PLAY_SAMPLES_PER_SEC/1000); // default is 48000/1000 = 48
+ const uint16_t nSamplesPerMs = (uint16_t)(N_PLAY_SAMPLES_PER_SEC/1000); // default is 48000/1000 = 48
MMRESULT res;
MMTIME mmtime;
@@ -3003,13 +3003,13 @@
// GetRecordingBufferDelay
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::GetRecordingBufferDelay(WebRtc_UWord32& readSamples, WebRtc_UWord32& recSamples)
+int32_t AudioDeviceWindowsWave::GetRecordingBufferDelay(uint32_t& readSamples, uint32_t& recSamples)
{
long recDifference;
MMTIME mmtime;
MMRESULT mmr;
- const WebRtc_UWord16 nSamplesPerMs = (WebRtc_UWord16)(N_REC_SAMPLES_PER_SEC/1000); // default is 48000/1000 = 48
+ const uint16_t nSamplesPerMs = (uint16_t)(N_REC_SAMPLES_PER_SEC/1000); // default is 48000/1000 = 48
// Retrieve the current input position of the given waveform-audio input device
//
@@ -3121,9 +3121,9 @@
bool AudioDeviceWindowsWave::ThreadProcess()
{
- WebRtc_UWord32 time(0);
- WebRtc_UWord32 playDiff(0);
- WebRtc_UWord32 recDiff(0);
+ uint32_t time(0);
+ uint32_t playDiff(0);
+ uint32_t recDiff(0);
LONGLONG playTime(0);
LONGLONG recTime(0);
@@ -3184,7 +3184,7 @@
}
if (_playing &&
- (playDiff > (WebRtc_UWord32)(_dTcheckPlayBufDelay - 1)) ||
+ (playDiff > (uint32_t)(_dTcheckPlayBufDelay - 1)) ||
(playDiff < 0))
{
Lock();
@@ -3227,8 +3227,8 @@
Lock();
if (_recording)
{
- WebRtc_Word32 nRecordedBytes(0);
- WebRtc_UWord16 maxIter(10);
+ int32_t nRecordedBytes(0);
+ uint16_t maxIter(10);
// Deliver all availiable recorded buffers and update the CPU load measurement.
// We use a while loop here to compensate for the fact that the multi-media timer
@@ -3285,11 +3285,11 @@
// RecProc
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::RecProc(LONGLONG& consumedTime)
+int32_t AudioDeviceWindowsWave::RecProc(LONGLONG& consumedTime)
{
MMRESULT res;
- WebRtc_UWord32 bufCount(0);
- WebRtc_UWord32 nBytesRecorded(0);
+ uint32_t bufCount(0);
+ uint32_t nBytesRecorded(0);
consumedTime = 0;
@@ -3302,8 +3302,8 @@
bufCount = _recBufCount;
// take mono/stereo mode into account when deriving size of a full buffer
- const WebRtc_UWord16 bytesPerSample = 2*_recChannels;
- const WebRtc_UWord32 fullBufferSizeInBytes = bytesPerSample * REC_BUF_SIZE_IN_SAMPLES;
+ const uint16_t bytesPerSample = 2*_recChannels;
+ const uint32_t fullBufferSizeInBytes = bytesPerSample * REC_BUF_SIZE_IN_SAMPLES;
// read number of recorded bytes for the given input-buffer
nBytesRecorded = _waveHeaderIn[bufCount].dwBytesRecorded;
@@ -3311,14 +3311,14 @@
if (nBytesRecorded == fullBufferSizeInBytes ||
(nBytesRecorded > 0))
{
- WebRtc_Word32 msecOnPlaySide;
- WebRtc_Word32 msecOnRecordSide;
- WebRtc_UWord32 writtenSamples;
- WebRtc_UWord32 playedSamples;
- WebRtc_UWord32 readSamples, recSamples;
+ int32_t msecOnPlaySide;
+ int32_t msecOnRecordSide;
+ uint32_t writtenSamples;
+ uint32_t playedSamples;
+ uint32_t readSamples, recSamples;
bool send = true;
- WebRtc_UWord32 nSamplesRecorded = (nBytesRecorded/bytesPerSample); // divide by 2 or 4 depending on mono or stereo
+ uint32_t nSamplesRecorded = (nBytesRecorded/bytesPerSample); // divide by 2 or 4 depending on mono or stereo
if (nBytesRecorded == fullBufferSizeInBytes)
{
@@ -3355,7 +3355,7 @@
// If we use the alternative playout delay method, skip the clock drift compensation
// since it will be an unreliable estimate and might degrade AEC performance.
- WebRtc_Word32 drift = (_useHeader > 0) ? 0 : GetClockDrift(playedSamples, recSamples);
+ int32_t drift = (_useHeader > 0) ? 0 : GetClockDrift(playedSamples, recSamples);
_ptrAudioBuffer->SetVQEData(msecOnPlaySide, msecOnRecordSide, drift);
@@ -3385,7 +3385,7 @@
if (_AGC)
{
- WebRtc_UWord32 newMicLevel = _ptrAudioBuffer->NewMicLevel();
+ uint32_t newMicLevel = _ptrAudioBuffer->NewMicLevel();
if (newMicLevel != 0)
{
// The VQE will only deliver non-zero microphone levels when a change is needed.
@@ -3474,10 +3474,10 @@
int AudioDeviceWindowsWave::PlayProc(LONGLONG& consumedTime)
{
- WebRtc_Word32 remTimeMS(0);
+ int32_t remTimeMS(0);
int8_t playBuffer[4*PLAY_BUF_SIZE_IN_SAMPLES];
- WebRtc_UWord32 writtenSamples(0);
- WebRtc_UWord32 playedSamples(0);
+ uint32_t writtenSamples(0);
+ uint32_t playedSamples(0);
LARGE_INTEGER t1;
LARGE_INTEGER t2;
@@ -3492,7 +3492,7 @@
// The threshold can be adaptive or fixed. The adaptive scheme is updated
// also for fixed mode but the updated threshold is not utilized.
//
- const WebRtc_UWord16 thresholdMS =
+ const uint16_t thresholdMS =
(_playBufType == AudioDeviceModule::kAdaptiveBufferSize) ? _playBufDelay : _playBufDelayFixed;
if (remTimeMS < thresholdMS + 9)
@@ -3559,7 +3559,7 @@
// Ensure that this callback is executed without taking the audio-thread lock.
//
UnLock();
- WebRtc_UWord32 nSamples = _ptrAudioBuffer->RequestPlayoutData(PLAY_BUF_SIZE_IN_SAMPLES);
+ uint32_t nSamples = _ptrAudioBuffer->RequestPlayoutData(PLAY_BUF_SIZE_IN_SAMPLES);
Lock();
if (OutputSanityCheckAfterUnlockedPeriod() == -1)
@@ -3626,7 +3626,7 @@
// Write
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::Write(int8_t* data, WebRtc_UWord16 nSamples)
+int32_t AudioDeviceWindowsWave::Write(int8_t* data, uint16_t nSamples)
{
if (_hWaveOut == NULL)
{
@@ -3637,11 +3637,11 @@
{
MMRESULT res;
- const WebRtc_UWord16 bufCount(_playBufCount);
+ const uint16_t bufCount(_playBufCount);
// Place data in the memory associated with _waveHeaderOut[bufCount]
//
- const WebRtc_Word16 nBytes = (2*_playChannels)*nSamples;
+ const int16_t nBytes = (2*_playChannels)*nSamples;
memcpy(&_playBuffer[bufCount][0], &data[0], nBytes);
// Send a data block to the given waveform-audio output device.
@@ -3684,7 +3684,7 @@
// GetClockDrift
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::GetClockDrift(const WebRtc_UWord32 plSamp, const WebRtc_UWord32 rcSamp)
+int32_t AudioDeviceWindowsWave::GetClockDrift(const uint32_t plSamp, const uint32_t rcSamp)
{
int drift = 0;
unsigned int plSampDiff = 0, rcSampDiff = 0;
@@ -3733,10 +3733,10 @@
// MonitorRecording
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::MonitorRecording(const WebRtc_UWord32 time)
+int32_t AudioDeviceWindowsWave::MonitorRecording(const uint32_t time)
{
- const WebRtc_UWord16 bytesPerSample = 2*_recChannels;
- const WebRtc_UWord32 nRecordedSamples = _recordedBytes/bytesPerSample;
+ const uint16_t bytesPerSample = 2*_recChannels;
+ const uint32_t nRecordedSamples = _recordedBytes/bytesPerSample;
if (nRecordedSamples > 5*N_REC_SAMPLES_PER_SEC)
{
@@ -3785,9 +3785,9 @@
// Restart timer if needed (they seem to be messed up after a hibernate).
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioDeviceWindowsWave::RestartTimerIfNeeded(const WebRtc_UWord32 time)
+int32_t AudioDeviceWindowsWave::RestartTimerIfNeeded(const uint32_t time)
{
- const WebRtc_UWord32 diffMS = time - _prevTimerCheckTime;
+ const uint32_t diffMS = time - _prevTimerCheckTime;
_prevTimerCheckTime = time;
if (diffMS > 7)
diff --git a/modules/audio_device/win/audio_device_wave_win.h b/modules/audio_device/win/audio_device_wave_win.h
index 7837bc6..665f471 100644
--- a/modules/audio_device/win/audio_device_wave_win.h
+++ b/modules/audio_device/win/audio_device_wave_win.h
@@ -20,19 +20,19 @@
class EventWrapper;
class ThreadWrapper;
-const WebRtc_UWord32 TIMER_PERIOD_MS = 2;
-const WebRtc_UWord32 REC_CHECK_TIME_PERIOD_MS = 4;
-const WebRtc_UWord16 REC_PUT_BACK_DELAY = 4;
+const uint32_t TIMER_PERIOD_MS = 2;
+const uint32_t REC_CHECK_TIME_PERIOD_MS = 4;
+const uint16_t REC_PUT_BACK_DELAY = 4;
-const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 48000;
-const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 48000;
+const uint32_t N_REC_SAMPLES_PER_SEC = 48000;
+const uint32_t N_PLAY_SAMPLES_PER_SEC = 48000;
-const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording
-const WebRtc_UWord32 N_PLAY_CHANNELS = 2; // default is stereo playout
+const uint32_t N_REC_CHANNELS = 1; // default is mono recording
+const uint32_t N_PLAY_CHANNELS = 2; // default is stereo playout
// NOTE - CPU load will not be correct for other sizes than 10ms
-const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC/100);
-const WebRtc_UWord32 PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC/100);
+const uint32_t REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC/100);
+const uint32_t PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC/100);
enum { N_BUFFERS_IN = 200 };
enum { N_BUFFERS_OUT = 200 };
@@ -40,114 +40,114 @@
class AudioDeviceWindowsWave : public AudioDeviceGeneric
{
public:
- AudioDeviceWindowsWave(const WebRtc_Word32 id);
+ AudioDeviceWindowsWave(const int32_t id);
~AudioDeviceWindowsWave();
// Retrieve the currently utilized audio layer
- virtual WebRtc_Word32 ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const;
+ 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(AudioDeviceModule::WindowsDeviceType device);
- virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
- virtual WebRtc_Word32 SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device);
+ virtual int32_t SetPlayoutDevice(uint16_t index);
+ virtual int32_t SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device);
+ 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(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;
+ virtual int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type, 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;
@@ -165,36 +165,36 @@
private:
void Lock() { _critSect.Enter(); };
void UnLock() { _critSect.Leave(); };
- WebRtc_Word32 Id() {return _id;}
+ int32_t Id() {return _id;}
bool IsUsingOutputDeviceIndex() const {return _usingOutputDeviceIndex;}
AudioDeviceModule::WindowsDeviceType OutputDevice() const {return _outputDevice;}
- WebRtc_UWord16 OutputDeviceIndex() const {return _outputDeviceIndex;}
+ uint16_t OutputDeviceIndex() const {return _outputDeviceIndex;}
bool IsUsingInputDeviceIndex() const {return _usingInputDeviceIndex;}
AudioDeviceModule::WindowsDeviceType InputDevice() const {return _inputDevice;}
- WebRtc_UWord16 InputDeviceIndex() const {return _inputDeviceIndex;}
+ uint16_t InputDeviceIndex() const {return _inputDeviceIndex;}
private:
- inline WebRtc_Word32 InputSanityCheckAfterUnlockedPeriod() const;
- inline WebRtc_Word32 OutputSanityCheckAfterUnlockedPeriod() const;
+ inline int32_t InputSanityCheckAfterUnlockedPeriod() const;
+ inline int32_t OutputSanityCheckAfterUnlockedPeriod() const;
private:
- WebRtc_Word32 EnumeratePlayoutDevices();
- WebRtc_Word32 EnumerateRecordingDevices();
+ int32_t EnumeratePlayoutDevices();
+ int32_t EnumerateRecordingDevices();
void TraceSupportFlags(DWORD dwSupport) const;
void TraceWaveInError(MMRESULT error) const;
void TraceWaveOutError(MMRESULT error) const;
- WebRtc_Word32 PrepareStartRecording();
- WebRtc_Word32 PrepareStartPlayout();
+ int32_t PrepareStartRecording();
+ int32_t PrepareStartPlayout();
- WebRtc_Word32 RecProc(LONGLONG& consumedTime);
+ int32_t RecProc(LONGLONG& consumedTime);
int PlayProc(LONGLONG& consumedTime);
- WebRtc_Word32 GetPlayoutBufferDelay(WebRtc_UWord32& writtenSamples, WebRtc_UWord32& playedSamples);
- WebRtc_Word32 GetRecordingBufferDelay(WebRtc_UWord32& readSamples, WebRtc_UWord32& recSamples);
- WebRtc_Word32 Write(int8_t* data, WebRtc_UWord16 nSamples);
- WebRtc_Word32 GetClockDrift(const WebRtc_UWord32 plSamp, const WebRtc_UWord32 rcSamp);
- WebRtc_Word32 MonitorRecording(const WebRtc_UWord32 time);
- WebRtc_Word32 RestartTimerIfNeeded(const WebRtc_UWord32 time);
+ int32_t GetPlayoutBufferDelay(uint32_t& writtenSamples, uint32_t& playedSamples);
+ int32_t GetRecordingBufferDelay(uint32_t& readSamples, uint32_t& recSamples);
+ int32_t Write(int8_t* data, uint16_t nSamples);
+ int32_t GetClockDrift(const uint32_t plSamp, const uint32_t rcSamp);
+ int32_t MonitorRecording(const uint32_t time);
+ int32_t RestartTimerIfNeeded(const uint32_t time);
private:
static bool ThreadFunc(void*);
@@ -221,11 +221,11 @@
HANDLE _hSetCaptureVolumeEvent;
ThreadWrapper* _ptrThread;
- WebRtc_UWord32 _threadID;
+ uint32_t _threadID;
CriticalSectionWrapper& _critSectCb;
- WebRtc_Word32 _id;
+ int32_t _id;
AudioMixerManager _mixerManager;
@@ -233,8 +233,8 @@
bool _usingOutputDeviceIndex;
AudioDeviceModule::WindowsDeviceType _inputDevice;
AudioDeviceModule::WindowsDeviceType _outputDevice;
- WebRtc_UWord16 _inputDeviceIndex;
- WebRtc_UWord16 _outputDeviceIndex;
+ uint16_t _inputDeviceIndex;
+ uint16_t _outputDeviceIndex;
bool _inputDeviceIsSpecified;
bool _outputDeviceIsSpecified;
@@ -247,14 +247,14 @@
WAVEHDR _waveHeaderIn[N_BUFFERS_IN];
WAVEHDR _waveHeaderOut[N_BUFFERS_OUT];
- WebRtc_UWord8 _recChannels;
- WebRtc_UWord8 _playChannels;
- WebRtc_UWord16 _recBufCount;
- WebRtc_UWord16 _recDelayCount;
- WebRtc_UWord16 _recPutBackDelay;
+ uint8_t _recChannels;
+ uint8_t _playChannels;
+ uint16_t _recBufCount;
+ uint16_t _recDelayCount;
+ uint16_t _recPutBackDelay;
- int8_t _recBuffer[N_BUFFERS_IN][4*REC_BUF_SIZE_IN_SAMPLES];
- int8_t _playBuffer[N_BUFFERS_OUT][4*PLAY_BUF_SIZE_IN_SAMPLES];
+ int8_t _recBuffer[N_BUFFERS_IN][4*REC_BUF_SIZE_IN_SAMPLES];
+ int8_t _playBuffer[N_BUFFERS_OUT][4*PLAY_BUF_SIZE_IN_SAMPLES];
AudioDeviceModule::BufferType _playBufType;
@@ -271,67 +271,67 @@
bool _AGC;
private:
- WebRtc_UWord32 _prevPlayTime;
- WebRtc_UWord32 _prevRecTime;
- WebRtc_UWord32 _prevTimerCheckTime;
+ uint32_t _prevPlayTime;
+ uint32_t _prevRecTime;
+ uint32_t _prevTimerCheckTime;
- WebRtc_UWord16 _playBufCount; // playout buffer index
- WebRtc_UWord16 _dTcheckPlayBufDelay; // dT for check of play buffer, {2,5,10} [ms]
- WebRtc_UWord16 _playBufDelay; // playback delay
- WebRtc_UWord16 _playBufDelayFixed; // fixed playback delay
- WebRtc_UWord16 _minPlayBufDelay; // minimum playback delay
- WebRtc_UWord16 _MAX_minBuffer; // level of (adaptive) min threshold must be < _MAX_minBuffer
+ uint16_t _playBufCount; // playout buffer index
+ uint16_t _dTcheckPlayBufDelay; // dT for check of play buffer, {2,5,10} [ms]
+ uint16_t _playBufDelay; // playback delay
+ uint16_t _playBufDelayFixed; // fixed playback delay
+ uint16_t _minPlayBufDelay; // minimum playback delay
+ uint16_t _MAX_minBuffer; // level of (adaptive) min threshold must be < _MAX_minBuffer
- WebRtc_Word32 _erZeroCounter; // counts "buffer-is-empty" events
- WebRtc_Word32 _intro;
- WebRtc_Word32 _waitCounter;
+ int32_t _erZeroCounter; // counts "buffer-is-empty" events
+ int32_t _intro;
+ int32_t _waitCounter;
- WebRtc_UWord32 _writtenSamples;
- WebRtc_UWord32 _writtenSamplesOld;
- WebRtc_UWord32 _playedSamplesOld;
+ uint32_t _writtenSamples;
+ uint32_t _writtenSamplesOld;
+ uint32_t _playedSamplesOld;
- WebRtc_UWord32 _sndCardPlayDelay;
- WebRtc_UWord32 _sndCardRecDelay;
+ uint32_t _sndCardPlayDelay;
+ uint32_t _sndCardRecDelay;
- WebRtc_UWord32 _plSampOld;
- WebRtc_UWord32 _rcSampOld;
+ uint32_t _plSampOld;
+ uint32_t _rcSampOld;
- WebRtc_UWord32 _read_samples;
- WebRtc_UWord32 _read_samples_old;
- WebRtc_UWord32 _rec_samples_old;
+ uint32_t _read_samples;
+ uint32_t _read_samples_old;
+ uint32_t _rec_samples_old;
// State that detects driver problems:
- WebRtc_Word32 _dc_diff_mean;
- WebRtc_Word32 _dc_y_prev;
- WebRtc_Word32 _dc_penalty_counter;
- WebRtc_Word32 _dc_prevtime;
- WebRtc_UWord32 _dc_prevplay;
+ int32_t _dc_diff_mean;
+ int32_t _dc_y_prev;
+ int32_t _dc_penalty_counter;
+ int32_t _dc_prevtime;
+ uint32_t _dc_prevplay;
- WebRtc_UWord32 _recordedBytes; // accumulated #recorded bytes (reset periodically)
- WebRtc_UWord32 _prevRecByteCheckTime; // time when we last checked the recording process
+ uint32_t _recordedBytes; // accumulated #recorded bytes (reset periodically)
+ uint32_t _prevRecByteCheckTime; // time when we last checked the recording process
// CPU load measurements
LARGE_INTEGER _perfFreq;
LONGLONG _playAcc; // accumulated time for playout callback
float _avgCPULoad; // average total (rec+play) CPU load
- WebRtc_Word32 _wrapCounter;
+ int32_t _wrapCounter;
- WebRtc_Word32 _useHeader;
- WebRtc_Word16 _timesdwBytes;
- WebRtc_Word32 _no_of_msecleft_warnings;
- WebRtc_Word32 _writeErrors;
- WebRtc_Word32 _timerFaults;
- WebRtc_Word32 _timerRestartAttempts;
+ int32_t _useHeader;
+ int16_t _timesdwBytes;
+ int32_t _no_of_msecleft_warnings;
+ int32_t _writeErrors;
+ int32_t _timerFaults;
+ int32_t _timerRestartAttempts;
- 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_UWord32 _newMicLevel;
- WebRtc_UWord32 _minMicVolume;
- WebRtc_UWord32 _maxMicVolume;
+ uint32_t _newMicLevel;
+ uint32_t _minMicVolume;
+ uint32_t _maxMicVolume;
};
} // namespace webrtc
diff --git a/modules/audio_device/win/audio_mixer_manager_win.cc b/modules/audio_device/win/audio_mixer_manager_win.cc
index a1dbcb5..0c4b01e 100644
--- a/modules/audio_device/win/audio_mixer_manager_win.cc
+++ b/modules/audio_device/win/audio_mixer_manager_win.cc
@@ -31,7 +31,7 @@
// CONSTRUCTION/DESTRUCTION
// ============================================================================
-AudioMixerManager::AudioMixerManager(const WebRtc_Word32 id) :
+AudioMixerManager::AudioMixerManager(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_id(id),
_inputMixerHandle(NULL),
@@ -59,7 +59,7 @@
// Close
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::Close()
+int32_t AudioMixerManager::Close()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -83,7 +83,7 @@
// CloseSpeaker
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::CloseSpeaker()
+int32_t AudioMixerManager::CloseSpeaker()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -106,7 +106,7 @@
// CloseMicrophone
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::CloseMicrophone()
+int32_t AudioMixerManager::CloseMicrophone()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -129,7 +129,7 @@
// EnumerateAll
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::EnumerateAll()
+int32_t AudioMixerManager::EnumerateAll()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -170,7 +170,7 @@
// EnumerateSpeakers
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::EnumerateSpeakers()
+int32_t AudioMixerManager::EnumerateSpeakers()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -254,7 +254,7 @@
// EnumerateMicrophones
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::EnumerateMicrophones()
+int32_t AudioMixerManager::EnumerateMicrophones()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -565,7 +565,7 @@
// Avoids opening the mixer if valid control has not been found.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType device)
{
if (device == AudioDeviceModule::kDefaultDevice)
{
@@ -691,7 +691,7 @@
// Avoids opening the mixer if valid control has not been found.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::OpenSpeaker(WebRtc_UWord16 index)
+int32_t AudioMixerManager::OpenSpeaker(uint16_t index)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::OpenSpeaker(index=%d)", index);
@@ -787,7 +787,7 @@
// Avoids opening the mixer if valid control has not been found.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType device)
+int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType device)
{
if (device == AudioDeviceModule::kDefaultDevice)
{
@@ -913,7 +913,7 @@
// Avoids opening the mixer if valid control has not been found.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::OpenMicrophone(WebRtc_UWord16 index)
+int32_t AudioMixerManager::OpenMicrophone(uint16_t index)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::OpenMicrophone(index=%d)", index);
@@ -1028,7 +1028,7 @@
// SetSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SetSpeakerVolume(WebRtc_UWord32 volume)
+int32_t AudioMixerManager::SetSpeakerVolume(uint32_t volume)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::SetSpeakerVolume(volume=%u)", volume);
@@ -1061,7 +1061,7 @@
// always equals MIXERCONTROL_CT_UNITS_UNSIGNED;
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SpeakerVolume(WebRtc_UWord32& volume) const
+int32_t AudioMixerManager::SpeakerVolume(uint32_t& volume) const
{
if (_outputMixerHandle == NULL)
@@ -1093,7 +1093,7 @@
// always equals MIXERCONTROL_CT_UNITS_UNSIGNED
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MaxSpeakerVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioMixerManager::MaxSpeakerVolume(uint32_t& maxVolume) const
{
if (_outputMixerHandle == NULL)
@@ -1122,7 +1122,7 @@
// MinSpeakerVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MinSpeakerVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioMixerManager::MinSpeakerVolume(uint32_t& minVolume) const
{
if (_outputMixerHandle == NULL)
@@ -1151,7 +1151,7 @@
// SpeakerVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SpeakerVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioMixerManager::SpeakerVolumeStepSize(uint16_t& stepSize) const
{
if (_outputMixerHandle == NULL)
@@ -1170,7 +1170,7 @@
return -1;
}
- stepSize = static_cast<WebRtc_UWord16> (mixerControl.Metrics.cSteps);
+ stepSize = static_cast<uint16_t> (mixerControl.Metrics.cSteps);
return 0;
}
@@ -1179,7 +1179,7 @@
// SpeakerVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SpeakerVolumeIsAvailable(bool& available)
+int32_t AudioMixerManager::SpeakerVolumeIsAvailable(bool& available)
{
if (_outputMixerHandle == NULL)
{
@@ -1196,7 +1196,7 @@
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SpeakerMuteIsAvailable(bool& available)
+int32_t AudioMixerManager::SpeakerMuteIsAvailable(bool& available)
{
if (_outputMixerHandle == NULL)
{
@@ -1215,7 +1215,7 @@
// This mute function works a master mute for the output speaker.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SetSpeakerMute(bool enable)
+int32_t AudioMixerManager::SetSpeakerMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::SetSpeakerMute(enable=%u)", enable);
@@ -1253,7 +1253,7 @@
// SpeakerMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SpeakerMute(bool& enabled) const
+int32_t AudioMixerManager::SpeakerMute(bool& enabled) const
{
if (_outputMixerHandle == NULL)
@@ -1291,7 +1291,7 @@
// MicrophoneMuteIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneMuteIsAvailable(bool& available)
+int32_t AudioMixerManager::MicrophoneMuteIsAvailable(bool& available)
{
if (_inputMixerHandle == NULL)
{
@@ -1310,7 +1310,7 @@
// This mute function works a master mute for the input microphone.
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SetMicrophoneMute(bool enable)
+int32_t AudioMixerManager::SetMicrophoneMute(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::SetMicrophoneMute(enable=%u)", enable);
@@ -1348,7 +1348,7 @@
// MicrophoneMute
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneMute(bool& enabled) const
+int32_t AudioMixerManager::MicrophoneMute(bool& enabled) const
{
if (_inputMixerHandle == NULL)
@@ -1386,7 +1386,7 @@
// MicrophoneBoostIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneBoostIsAvailable(bool& available)
+int32_t AudioMixerManager::MicrophoneBoostIsAvailable(bool& available)
{
if (_inputMixerHandle == NULL)
{
@@ -1403,7 +1403,7 @@
// SetMicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SetMicrophoneBoost(bool enable)
+int32_t AudioMixerManager::SetMicrophoneBoost(bool enable)
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "AudioMixerManager::SetMicrophoneBoost(enable=%u)", enable);
@@ -1441,7 +1441,7 @@
// MicrophoneBoost
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneBoost(bool& enabled) const
+int32_t AudioMixerManager::MicrophoneBoost(bool& enabled) const
{
if (_inputMixerHandle == NULL)
@@ -1479,7 +1479,7 @@
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneVolumeIsAvailable(bool& available)
+int32_t AudioMixerManager::MicrophoneVolumeIsAvailable(bool& available)
{
if (_inputMixerHandle == NULL)
{
@@ -1496,7 +1496,7 @@
// SetMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::SetMicrophoneVolume(WebRtc_UWord32 volume)
+int32_t AudioMixerManager::SetMicrophoneVolume(uint32_t volume)
{
CriticalSectionScoped lock(&_critSect);
@@ -1524,7 +1524,7 @@
// MicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneVolume(WebRtc_UWord32& volume) const
+int32_t AudioMixerManager::MicrophoneVolume(uint32_t& volume) const
{
CriticalSectionScoped lock(&_critSect);
@@ -1554,7 +1554,7 @@
// MaxMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
+int32_t AudioMixerManager::MaxMicrophoneVolume(uint32_t& maxVolume) const
{
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
@@ -1584,7 +1584,7 @@
// MinMicrophoneVolume
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
+int32_t AudioMixerManager::MinMicrophoneVolume(uint32_t& minVolume) const
{
if (_inputMixerHandle == NULL)
@@ -1613,7 +1613,7 @@
// MicrophoneVolumeStepSize
// ----------------------------------------------------------------------------
-WebRtc_Word32 AudioMixerManager::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
+int32_t AudioMixerManager::MicrophoneVolumeStepSize(uint16_t& stepSize) const
{
if (_inputMixerHandle == NULL)
@@ -1633,7 +1633,7 @@
return -1;
}
- stepSize = static_cast<WebRtc_UWord16> (mixerControl.Metrics.cSteps);
+ stepSize = static_cast<uint16_t> (mixerControl.Metrics.cSteps);
return 0;
}
diff --git a/modules/audio_device/win/audio_mixer_manager_win.h b/modules/audio_device/win/audio_mixer_manager_win.h
index da9de47..fc507c4 100644
--- a/modules/audio_device/win/audio_mixer_manager_win.h
+++ b/modules/audio_device/win/audio_mixer_manager_win.h
@@ -46,37 +46,37 @@
bool onOffControlIsValid;
};
public:
- WebRtc_Word32 EnumerateAll();
- WebRtc_Word32 EnumerateSpeakers();
- WebRtc_Word32 EnumerateMicrophones();
- WebRtc_Word32 OpenSpeaker(AudioDeviceModule::WindowsDeviceType device);
- WebRtc_Word32 OpenSpeaker(WebRtc_UWord16 index);
- WebRtc_Word32 OpenMicrophone(AudioDeviceModule::WindowsDeviceType device);
- WebRtc_Word32 OpenMicrophone(WebRtc_UWord16 index);
- 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 EnumerateAll();
+ int32_t EnumerateSpeakers();
+ int32_t EnumerateMicrophones();
+ int32_t OpenSpeaker(AudioDeviceModule::WindowsDeviceType device);
+ int32_t OpenSpeaker(uint16_t index);
+ int32_t OpenMicrophone(AudioDeviceModule::WindowsDeviceType device);
+ int32_t OpenMicrophone(uint16_t index);
+ 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;
UINT Devices() const;
@@ -119,12 +119,12 @@
char* WideToUTF8(const TCHAR* src) const;
public:
- AudioMixerManager(const WebRtc_Word32 id);
+ AudioMixerManager(const int32_t id);
~AudioMixerManager();
private:
CriticalSectionWrapper& _critSect;
- WebRtc_Word32 _id;
+ int32_t _id;
HMIXER _outputMixerHandle;
UINT _outputMixerID;
HMIXER _inputMixerHandle;