Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1086)

Unified Diff: webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
diff --git a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
index e7e07546956ef46ab446442751add795efd4c835..d5b940479db851efd2f2bd911f6135c82f6c1a6e 100644
--- a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
+++ b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
@@ -118,7 +118,7 @@ int32_t AudioMixerManagerMac::OpenSpeaker(AudioDeviceID deviceID) {
size = sizeof(hogPid);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &hogPid));
+ _outputDeviceID, &propertyAddress, 0, nullptr, &size, &hogPid));
if (hogPid == -1) {
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
@@ -144,7 +144,7 @@ int32_t AudioMixerManagerMac::OpenSpeaker(AudioDeviceID deviceID) {
size = sizeof(AudioStreamBasicDescription);
memset(&streamFormat, 0, size);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &streamFormat));
+ _outputDeviceID, &propertyAddress, 0, nullptr, &size, &streamFormat));
_noOutputChannels = streamFormat.mChannelsPerFrame;
@@ -168,7 +168,7 @@ int32_t AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID) {
kAudioDevicePropertyHogMode, kAudioDevicePropertyScopeInput, 0};
size = sizeof(hogPid);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &hogPid));
+ _inputDeviceID, &propertyAddress, 0, nullptr, &size, &hogPid));
if (hogPid == -1) {
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id,
" No process has hogged the input device");
@@ -193,7 +193,7 @@ int32_t AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID) {
size = sizeof(AudioStreamBasicDescription);
memset(&streamFormat, 0, size);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &streamFormat));
+ _inputDeviceID, &propertyAddress, 0, nullptr, &size, &streamFormat));
_noInputChannels = streamFormat.mChannelsPerFrame;
@@ -243,7 +243,7 @@ int32_t AudioMixerManagerMac::SetSpeakerVolume(uint32_t volume) {
if (err == noErr && isSettable) {
size = sizeof(vol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, size, &vol));
+ _outputDeviceID, &propertyAddress, 0, nullptr, size, &vol));
return 0;
}
@@ -257,7 +257,7 @@ int32_t AudioMixerManagerMac::SetSpeakerVolume(uint32_t volume) {
if (err == noErr && isSettable) {
size = sizeof(vol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, size, &vol));
+ _outputDeviceID, &propertyAddress, 0, nullptr, size, &vol));
}
success = true;
}
@@ -293,7 +293,7 @@ int32_t AudioMixerManagerMac::SpeakerVolume(uint32_t& volume) const {
if (hasProperty) {
size = sizeof(vol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &vol));
+ _outputDeviceID, &propertyAddress, 0, nullptr, &size, &vol));
// vol 0.0 to 1.0 -> convert to 0 - 255
volume = static_cast<uint32_t>(vol * 255 + 0.5);
@@ -307,7 +307,7 @@ int32_t AudioMixerManagerMac::SpeakerVolume(uint32_t& volume) const {
if (hasProperty) {
size = sizeof(channelVol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &channelVol));
+ _outputDeviceID, &propertyAddress, 0, nullptr, &size, &channelVol));
vol += channelVol;
channels++;
@@ -479,7 +479,7 @@ int32_t AudioMixerManagerMac::SetSpeakerMute(bool enable) {
if (err == noErr && isSettable) {
size = sizeof(mute);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, size, &mute));
+ _outputDeviceID, &propertyAddress, 0, nullptr, size, &mute));
return 0;
}
@@ -493,7 +493,7 @@ int32_t AudioMixerManagerMac::SetSpeakerMute(bool enable) {
if (err == noErr && isSettable) {
size = sizeof(mute);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, size, &mute));
+ _outputDeviceID, &propertyAddress, 0, nullptr, size, &mute));
}
success = true;
}
@@ -529,7 +529,7 @@ int32_t AudioMixerManagerMac::SpeakerMute(bool& enabled) const {
if (hasProperty) {
size = sizeof(muted);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &muted));
+ _outputDeviceID, &propertyAddress, 0, nullptr, &size, &muted));
// 1 means muted
enabled = static_cast<bool>(muted);
@@ -541,8 +541,9 @@ int32_t AudioMixerManagerMac::SpeakerMute(bool& enabled) const {
hasProperty = AudioObjectHasProperty(_outputDeviceID, &propertyAddress);
if (hasProperty) {
size = sizeof(channelMuted);
- WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _outputDeviceID, &propertyAddress, 0, NULL, &size, &channelMuted));
+ WEBRTC_CA_RETURN_ON_ERR(
+ AudioObjectGetPropertyData(_outputDeviceID, &propertyAddress, 0,
+ nullptr, &size, &channelMuted));
muted = (muted && channelMuted);
channels++;
@@ -655,7 +656,7 @@ int32_t AudioMixerManagerMac::SetMicrophoneMute(bool enable) {
if (err == noErr && isSettable) {
size = sizeof(mute);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, size, &mute));
+ _inputDeviceID, &propertyAddress, 0, nullptr, size, &mute));
return 0;
}
@@ -669,7 +670,7 @@ int32_t AudioMixerManagerMac::SetMicrophoneMute(bool enable) {
if (err == noErr && isSettable) {
size = sizeof(mute);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, size, &mute));
+ _inputDeviceID, &propertyAddress, 0, nullptr, size, &mute));
}
success = true;
}
@@ -705,7 +706,7 @@ int32_t AudioMixerManagerMac::MicrophoneMute(bool& enabled) const {
if (hasProperty) {
size = sizeof(muted);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &muted));
+ _inputDeviceID, &propertyAddress, 0, nullptr, &size, &muted));
// 1 means muted
enabled = static_cast<bool>(muted);
@@ -717,8 +718,9 @@ int32_t AudioMixerManagerMac::MicrophoneMute(bool& enabled) const {
hasProperty = AudioObjectHasProperty(_inputDeviceID, &propertyAddress);
if (hasProperty) {
size = sizeof(channelMuted);
- WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &channelMuted));
+ WEBRTC_CA_RETURN_ON_ERR(
+ AudioObjectGetPropertyData(_inputDeviceID, &propertyAddress, 0,
+ nullptr, &size, &channelMuted));
muted = (muted && channelMuted);
channels++;
@@ -864,7 +866,7 @@ int32_t AudioMixerManagerMac::SetMicrophoneVolume(uint32_t volume) {
if (err == noErr && isSettable) {
size = sizeof(vol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, size, &vol));
+ _inputDeviceID, &propertyAddress, 0, nullptr, size, &vol));
return 0;
}
@@ -878,7 +880,7 @@ int32_t AudioMixerManagerMac::SetMicrophoneVolume(uint32_t volume) {
if (err == noErr && isSettable) {
size = sizeof(vol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectSetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, size, &vol));
+ _inputDeviceID, &propertyAddress, 0, nullptr, size, &vol));
}
success = true;
}
@@ -914,7 +916,7 @@ int32_t AudioMixerManagerMac::MicrophoneVolume(uint32_t& volume) const {
if (hasProperty) {
size = sizeof(volFloat32);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &volFloat32));
+ _inputDeviceID, &propertyAddress, 0, nullptr, &size, &volFloat32));
// vol 0.0 to 1.0 -> convert to 0 - 255
volume = static_cast<uint32_t>(volFloat32 * 255 + 0.5);
@@ -928,7 +930,7 @@ int32_t AudioMixerManagerMac::MicrophoneVolume(uint32_t& volume) const {
if (hasProperty) {
size = sizeof(channelVol);
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
- _inputDeviceID, &propertyAddress, 0, NULL, &size, &channelVol));
+ _inputDeviceID, &propertyAddress, 0, nullptr, &size, &channelVol));
volFloat32 += channelVol;
channels++;
@@ -1006,8 +1008,8 @@ void AudioMixerManagerMac::logCAMsg(const TraceLevel level,
const int32_t id,
const char* msg,
const char* err) {
- assert(msg != NULL);
- assert(err != NULL);
+ assert(msg != nullptr);
+ assert(err != nullptr);
#ifdef WEBRTC_ARCH_BIG_ENDIAN
WEBRTC_TRACE(level, module, id, "%s: %.4s", msg, err);

Powered by Google App Engine
This is Rietveld 408576698