Remove deprecated OS X Core Audio APIs.

We no longer support the 10.4 SDK, so we can remove the weak-leaking
feature and exclusively use the added-in-10.5 APIs.

BUG=issue143
TEST=voe_auto_test

Review URL: http://webrtc-codereview.appspot.com/322001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1136 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2011-12-08 20:15:36 +00:00
parent 63b50f60d6
commit b0be7aa7ae

View File

@ -1638,19 +1638,8 @@ WebRtc_Word32 AudioDeviceMac::InitPlayout()
if (_twoDevices || !_recIsInitialized) if (_twoDevices || !_recIsInitialized)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_outputDeviceID,
if (AudioDeviceCreateIOProcID != NULL) deviceIOProc, this, &_deviceIOProcID));
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_outputDeviceID,
deviceIOProc, this, &_deviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceAddIOProc(_outputDeviceID, deviceIOProc, this));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} }
// Mark playout side as initialized // Mark playout side as initialized
@ -1868,36 +1857,12 @@ WebRtc_Word32 AudioDeviceMac::InitRecording()
if (_twoDevices) if (_twoDevices)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_inputDeviceID,
if (AudioDeviceCreateIOProcID != NULL) inDeviceIOProc, this, &_inDeviceIOProcID));
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_inputDeviceID,
inDeviceIOProc, this, &_inDeviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceAddIOProc(_inputDeviceID, inDeviceIOProc,
this));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} else if (!_playIsInitialized) } else if (!_playIsInitialized)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_inputDeviceID,
if (AudioDeviceCreateIOProcID != NULL) deviceIOProc, this, &_deviceIOProcID));
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceCreateIOProcID(_inputDeviceID, deviceIOProc,
this, &_deviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceAddIOProc(_inputDeviceID, deviceIOProc,
this));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} }
// Mark recording side as initialized // Mark recording side as initialized
@ -1910,7 +1875,7 @@ WebRtc_Word32 AudioDeviceMac::StartRecording()
{ {
WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id, WEBRTC_TRACE(kTraceModuleCall, kTraceAudioDevice, _id,
"%s", __FUNCTION__); "%s", __FUNCTION__);
CriticalSectionScoped lock(_critSect); CriticalSectionScoped lock(_critSect);
if (!_recIsInitialized) if (!_recIsInitialized)
@ -1941,32 +1906,10 @@ WebRtc_Word32 AudioDeviceMac::StartRecording()
if (_twoDevices) if (_twoDevices)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _inDeviceIOProcID));
if (AudioDeviceCreateIOProcID != NULL)
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _inDeviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, inDeviceIOProc));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} else if (!_playing) } else if (!_playing)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _deviceIOProcID));
if (AudioDeviceCreateIOProcID != NULL)
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, _deviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_inputDeviceID, deviceIOProc));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} }
_recording = true; _recording = true;
@ -2133,18 +2076,7 @@ WebRtc_Word32 AudioDeviceMac::StartPlayout()
if (_twoDevices || !_recording) if (_twoDevices || !_recording)
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_outputDeviceID, _deviceIOProcID));
if (AudioDeviceCreateIOProcID != NULL)
{
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_outputDeviceID, _deviceIOProcID));
}
else
{
#endif
WEBRTC_CA_RETURN_ON_ERR(AudioDeviceStart(_outputDeviceID, deviceIOProc));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
} }
_playing = true; _playing = true;
@ -3043,24 +2975,10 @@ OSStatus AudioDeviceMac::implDeviceIOProc(const AudioBufferList *inputData,
{ {
// In the case of a shared device, the single driving ioProc // In the case of a shared device, the single driving ioProc
// is stopped here // is stopped here
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_LOG_ERR(AudioDeviceStop(_outputDeviceID,
if (AudioDeviceCreateIOProcID != NULL) _deviceIOProcID));
{ WEBRTC_CA_LOG_WARN(AudioDeviceDestroyIOProcID(_outputDeviceID,
WEBRTC_CA_LOG_ERR(AudioDeviceStop(_outputDeviceID, _deviceIOProcID));
_deviceIOProcID));
WEBRTC_CA_LOG_WARN(AudioDeviceDestroyIOProcID(_outputDeviceID,
_deviceIOProcID));
}
else
{
#endif
WEBRTC_CA_LOG_ERR(AudioDeviceStop(_outputDeviceID,
deviceIOProc));
WEBRTC_CA_LOG_WARN(AudioDeviceRemoveIOProc(_outputDeviceID,
deviceIOProc));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
if (err == noErr) if (err == noErr)
{ {
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice,
@ -3164,22 +3082,9 @@ OSStatus AudioDeviceMac::implInDeviceIOProc(const AudioBufferList *inputData,
if (_doStopRec) if (_doStopRec)
{ {
// This will be signalled only when a shared device is not in use. // This will be signalled only when a shared device is not in use.
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 WEBRTC_CA_LOG_ERR(AudioDeviceStop(_inputDeviceID, _inDeviceIOProcID));
if (AudioDeviceCreateIOProcID != NULL) WEBRTC_CA_LOG_WARN(AudioDeviceDestroyIOProcID(_inputDeviceID,
{ _inDeviceIOProcID));
WEBRTC_CA_LOG_ERR(AudioDeviceStop(_inputDeviceID, _inDeviceIOProcID));
WEBRTC_CA_LOG_WARN(AudioDeviceDestroyIOProcID(_inputDeviceID,
_inDeviceIOProcID));
}
else
{
#endif
WEBRTC_CA_LOG_ERR(AudioDeviceStop(_inputDeviceID, inDeviceIOProc));
WEBRTC_CA_LOG_WARN(AudioDeviceRemoveIOProc(_inputDeviceID,
inDeviceIOProc));
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
}
#endif
if (err == noErr) if (err == noErr)
{ {
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice,