Removed unnecessary Pulse init from VoE startup.
Saves 10% (~260ms) of the total PeerConnectionTest wallclock time. R=niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5479004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5254 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
762fcdcca9
commit
7ae8495779
@ -299,14 +299,16 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
|
||||
#if defined(LINUX_PULSE)
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "attempting to use the Linux PulseAudio APIs...");
|
||||
|
||||
if (AudioDeviceLinuxPulse::PulseAudioIsSupported())
|
||||
// create *Linux PulseAudio* implementation
|
||||
AudioDeviceLinuxPulse* pulseDevice = new AudioDeviceLinuxPulse(Id());
|
||||
if (pulseDevice->Init() != -1)
|
||||
{
|
||||
// create *Linux PulseAudio* implementation
|
||||
ptrAudioDevice = new AudioDeviceLinuxPulse(Id());
|
||||
ptrAudioDevice = pulseDevice;
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "Linux PulseAudio APIs will be utilized");
|
||||
}
|
||||
else
|
||||
{
|
||||
delete pulseDevice;
|
||||
#endif
|
||||
#if defined(LINUX_ALSA)
|
||||
// create *Linux ALSA Audio* implementation
|
||||
|
@ -33,35 +33,6 @@ namespace webrtc
|
||||
// Static Methods
|
||||
// ============================================================================
|
||||
|
||||
bool AudioDeviceLinuxPulse::PulseAudioIsSupported()
|
||||
{
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, -1, "%s",
|
||||
__FUNCTION__);
|
||||
|
||||
bool pulseAudioIsSupported(true);
|
||||
|
||||
// Check that we can initialize
|
||||
AudioDeviceLinuxPulse* admPulse = new AudioDeviceLinuxPulse(-1);
|
||||
if (admPulse->InitPulseAudio() == -1)
|
||||
{
|
||||
pulseAudioIsSupported = false;
|
||||
}
|
||||
admPulse->TerminatePulseAudio();
|
||||
delete admPulse;
|
||||
|
||||
if (pulseAudioIsSupported)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, -1,
|
||||
"*** Linux Pulse Audio is supported ***");
|
||||
} else
|
||||
{
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, -1,
|
||||
"*** Linux Pulse Audio is NOT supported => will revert to the ALSA API ***");
|
||||
}
|
||||
|
||||
return (pulseAudioIsSupported);
|
||||
}
|
||||
|
||||
AudioDeviceLinuxPulse::AudioDeviceLinuxPulse(const int32_t id) :
|
||||
_ptrAudioBuffer(NULL),
|
||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
|
@ -95,8 +95,6 @@ public:
|
||||
AudioDeviceLinuxPulse(const int32_t id);
|
||||
virtual ~AudioDeviceLinuxPulse();
|
||||
|
||||
static bool PulseAudioIsSupported();
|
||||
|
||||
// Retrieve the currently utilized audio layer
|
||||
virtual int32_t ActiveAudioLayer(
|
||||
AudioDeviceModule::AudioLayer& audioLayer) const OVERRIDE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user