| Index: webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
|
| diff --git a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
|
| index f73a399c9d220ddb11fa96f6dc2053ae3027d3ba..80a5347978fc406d4a1f38ce8729da45e03fd10b 100644
|
| --- a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
|
| +++ b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
|
| @@ -41,24 +41,23 @@ class AutoPulseLock {
|
| pa_threaded_mainloop* const pa_mainloop_;
|
| };
|
|
|
| -AudioMixerManagerLinuxPulse::AudioMixerManagerLinuxPulse(const int32_t id) :
|
| - _id(id),
|
| - _paOutputDeviceIndex(-1),
|
| - _paInputDeviceIndex(-1),
|
| - _paPlayStream(NULL),
|
| - _paRecStream(NULL),
|
| - _paMainloop(NULL),
|
| - _paContext(NULL),
|
| - _paVolume(0),
|
| - _paMute(0),
|
| - _paVolSteps(0),
|
| - _paSpeakerMute(false),
|
| - _paSpeakerVolume(PA_VOLUME_NORM),
|
| - _paChannels(0),
|
| - _paObjectsSet(false)
|
| -{
|
| - WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id,
|
| - "%s constructed", __FUNCTION__);
|
| +AudioMixerManagerLinuxPulse::AudioMixerManagerLinuxPulse(const int32_t id)
|
| + : _id(id),
|
| + _paOutputDeviceIndex(-1),
|
| + _paInputDeviceIndex(-1),
|
| + _paPlayStream(nullptr),
|
| + _paRecStream(nullptr),
|
| + _paMainloop(nullptr),
|
| + _paContext(nullptr),
|
| + _paVolume(0),
|
| + _paMute(0),
|
| + _paVolSteps(0),
|
| + _paSpeakerMute(false),
|
| + _paSpeakerVolume(PA_VOLUME_NORM),
|
| + _paChannels(0),
|
| + _paObjectsSet(false) {
|
| + WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s constructed",
|
| + __FUNCTION__);
|
| }
|
|
|
| AudioMixerManagerLinuxPulse::~AudioMixerManagerLinuxPulse()
|
| @@ -108,8 +107,8 @@ int32_t AudioMixerManagerLinuxPulse::Close()
|
| CloseSpeaker();
|
| CloseMicrophone();
|
|
|
| - _paMainloop = NULL;
|
| - _paContext = NULL;
|
| + _paMainloop = nullptr;
|
| + _paContext = nullptr;
|
| _paObjectsSet = false;
|
|
|
| return 0;
|
| @@ -124,7 +123,7 @@ int32_t AudioMixerManagerLinuxPulse::CloseSpeaker()
|
|
|
| // Reset the index to -1
|
| _paOutputDeviceIndex = -1;
|
| - _paPlayStream = NULL;
|
| + _paPlayStream = nullptr;
|
|
|
| return 0;
|
| }
|
| @@ -137,7 +136,7 @@ int32_t AudioMixerManagerLinuxPulse::CloseMicrophone()
|
|
|
| // Reset the index to -1
|
| _paInputDeviceIndex = -1;
|
| - _paRecStream = NULL;
|
| + _paRecStream = nullptr;
|
|
|
| return 0;
|
| }
|
| @@ -271,12 +270,10 @@ int32_t AudioMixerManagerLinuxPulse::SetSpeakerVolume(
|
| pa_cvolume cVolumes;
|
| LATE(pa_cvolume_set)(&cVolumes, spec->channels, volume);
|
|
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
| paOperation = LATE(pa_context_set_sink_input_volume)(
|
| - _paContext,
|
| - LATE(pa_stream_get_index)(_paPlayStream),
|
| - &cVolumes,
|
| - PaSetVolumeCallback, NULL);
|
| + _paContext, LATE(pa_stream_get_index)(_paPlayStream), &cVolumes,
|
| + PaSetVolumeCallback, nullptr);
|
| if (!paOperation)
|
| {
|
| setFailed = true;
|
| @@ -447,13 +444,10 @@ int32_t AudioMixerManagerLinuxPulse::SetSpeakerMute(bool enable)
|
| // We can only really mute if we have a connected stream
|
| AutoPulseLock auto_lock(_paMainloop);
|
|
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
| paOperation = LATE(pa_context_set_sink_input_mute)(
|
| - _paContext,
|
| - LATE(pa_stream_get_index)(_paPlayStream),
|
| - (int) enable,
|
| - PaSetVolumeCallback,
|
| - NULL);
|
| + _paContext, LATE(pa_stream_get_index)(_paPlayStream), (int)enable,
|
| + PaSetVolumeCallback, nullptr);
|
| if (!paOperation)
|
| {
|
| setFailed = true;
|
| @@ -567,7 +561,7 @@ AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable(bool& available)
|
| deviceIndex = LATE(pa_stream_get_device_index)(_paRecStream);
|
| }
|
|
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| // Get info for this source
|
| // We want to know if the actual device can record in stereo
|
| @@ -619,7 +613,7 @@ int32_t AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable)
|
| }
|
|
|
| bool setFailed(false);
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| uint32_t deviceIndex = (uint32_t) _paInputDeviceIndex;
|
|
|
| @@ -636,9 +630,7 @@ int32_t AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable)
|
|
|
| // Set mute switch for the source
|
| paOperation = LATE(pa_context_set_source_mute_by_index)(
|
| - _paContext, deviceIndex,
|
| - enable,
|
| - PaSetVolumeCallback, NULL);
|
| + _paContext, deviceIndex, enable, PaSetVolumeCallback, nullptr);
|
|
|
| if (!paOperation)
|
| {
|
| @@ -814,7 +806,7 @@ AudioMixerManagerLinuxPulse::SetMicrophoneVolume(uint32_t volume)
|
| }
|
|
|
| bool setFailed(false);
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| // Get the number of channels for this source
|
| paOperation
|
| @@ -829,11 +821,8 @@ AudioMixerManagerLinuxPulse::SetMicrophoneVolume(uint32_t volume)
|
| LATE(pa_cvolume_set)(&cVolumes, channels, volume);
|
|
|
| // Set the volume for the source
|
| - paOperation
|
| - = LATE(pa_context_set_source_volume_by_index)(_paContext, deviceIndex,
|
| - &cVolumes,
|
| - PaSetVolumeCallback,
|
| - NULL);
|
| + paOperation = LATE(pa_context_set_source_volume_by_index)(
|
| + _paContext, deviceIndex, &cVolumes, PaSetVolumeCallback, nullptr);
|
|
|
| if (!paOperation)
|
| {
|
| @@ -952,7 +941,7 @@ int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize(
|
| deviceIndex = LATE(pa_stream_get_device_index)(_paRecStream);
|
| }
|
|
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| // Get info for this source
|
| paOperation
|
| @@ -1113,7 +1102,7 @@ void AudioMixerManagerLinuxPulse::WaitForOperationCompletion(
|
| }
|
|
|
| bool AudioMixerManagerLinuxPulse::GetSinkInputInfo() const {
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| AutoPulseLock auto_lock(_paMainloop);
|
| // Get info for this stream (sink input).
|
| @@ -1129,7 +1118,7 @@ bool AudioMixerManagerLinuxPulse::GetSinkInputInfo() const {
|
|
|
| bool AudioMixerManagerLinuxPulse::GetSinkInfoByIndex(
|
| int device_index) const {
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| AutoPulseLock auto_lock(_paMainloop);
|
| paOperation = LATE(pa_context_get_sink_info_by_index)(_paContext,
|
| @@ -1141,7 +1130,7 @@ bool AudioMixerManagerLinuxPulse::GetSinkInfoByIndex(
|
|
|
| bool AudioMixerManagerLinuxPulse::GetSourceInfoByIndex(
|
| int device_index) const {
|
| - pa_operation* paOperation = NULL;
|
| + pa_operation* paOperation = nullptr;
|
|
|
| AutoPulseLock auto_lock(_paMainloop);
|
| paOperation = LATE(pa_context_get_source_info_by_index)(
|
|
|