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

Unified Diff: webrtc/voice_engine/output_mixer.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/voice_engine/output_mixer.cc
diff --git a/webrtc/voice_engine/output_mixer.cc b/webrtc/voice_engine/output_mixer.cc
index 61babd2750b363b4a04793531bb898dd835cf3ba..aa73ae6137f308ac608d801198684ef2c737acb0 100644
--- a/webrtc/voice_engine/output_mixer.cc
+++ b/webrtc/voice_engine/output_mixer.cc
@@ -80,36 +80,33 @@ OutputMixer::Create(OutputMixer*& mixer, uint32_t instanceId)
WEBRTC_TRACE(kTraceMemory, kTraceVoice, instanceId,
"OutputMixer::Create(instanceId=%d)", instanceId);
mixer = new OutputMixer(instanceId);
- if (mixer == NULL)
- {
- WEBRTC_TRACE(kTraceMemory, kTraceVoice, instanceId,
- "OutputMixer::Create() unable to allocate memory for"
- "mixer");
- return -1;
+ if (mixer == nullptr) {
+ WEBRTC_TRACE(kTraceMemory, kTraceVoice, instanceId,
+ "OutputMixer::Create() unable to allocate memory for"
+ "mixer");
+ return -1;
}
return 0;
}
-OutputMixer::OutputMixer(uint32_t instanceId) :
- _mixerModule(*AudioConferenceMixer::Create(instanceId)),
- _audioLevel(),
- _instanceId(instanceId),
- _externalMediaCallbackPtr(NULL),
- _externalMedia(false),
- _panLeft(1.0f),
- _panRight(1.0f),
- _mixingFrequencyHz(8000),
- _outputFileRecording(false)
-{
- WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId,-1),
- "OutputMixer::OutputMixer() - ctor");
-
- if (_mixerModule.RegisterMixedStreamCallback(this) == -1)
- {
- WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId,-1),
- "OutputMixer::OutputMixer() failed to register mixer"
- "callbacks");
- }
+OutputMixer::OutputMixer(uint32_t instanceId)
+ : _mixerModule(*AudioConferenceMixer::Create(instanceId)),
+ _audioLevel(),
+ _instanceId(instanceId),
+ _externalMediaCallbackPtr(nullptr),
+ _externalMedia(false),
+ _panLeft(1.0f),
+ _panRight(1.0f),
+ _mixingFrequencyHz(8000),
+ _outputFileRecording(false) {
+ WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, -1),
+ "OutputMixer::OutputMixer() - ctor");
+
+ if (_mixerModule.RegisterMixedStreamCallback(this) == -1) {
+ WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, -1),
+ "OutputMixer::OutputMixer() failed to register mixer"
+ "callbacks");
+ }
}
void
@@ -118,7 +115,7 @@ OutputMixer::Destroy(OutputMixer*& mixer)
if (mixer)
{
delete mixer;
- mixer = NULL;
+ mixer = nullptr;
}
}
@@ -133,7 +130,7 @@ OutputMixer::~OutputMixer()
{
rtc::CritScope cs(&_fileCritSect);
if (output_file_recorder_) {
- output_file_recorder_->RegisterModuleFileCallback(NULL);
+ output_file_recorder_->RegisterModuleFileCallback(nullptr);
output_file_recorder_->StopRecording();
}
}
@@ -180,7 +177,7 @@ int OutputMixer::DeRegisterExternalMediaProcessing()
rtc::CritScope cs(&_callbackCritSect);
_externalMedia = false;
- _externalMediaCallbackPtr = NULL;
+ _externalMediaCallbackPtr = nullptr;
return 0;
}
@@ -264,18 +261,16 @@ int OutputMixer::StartRecordingPlayout(const char* fileName,
const uint32_t notificationTime(0);
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
- if ((codecInst != NULL) &&
- ((codecInst->channels < 1) || (codecInst->channels > 2)))
- {
- _engineStatisticsPtr->SetLastError(
- VE_BAD_ARGUMENT, kTraceError,
- "StartRecordingPlayout() invalid compression");
- return(-1);
+ if ((codecInst != nullptr) &&
+ ((codecInst->channels < 1) || (codecInst->channels > 2))) {
+ _engineStatisticsPtr->SetLastError(
+ VE_BAD_ARGUMENT, kTraceError,
+ "StartRecordingPlayout() invalid compression");
+ return (-1);
}
- if(codecInst == NULL)
- {
- format = kFileFormatPcm16kHzFile;
- codecInst=&dummyCodec;
+ if (codecInst == nullptr) {
+ format = kFileFormatPcm16kHzFile;
+ codecInst = &dummyCodec;
}
else if((STR_CASE_CMP(codecInst->plname,"L16") == 0) ||
(STR_CASE_CMP(codecInst->plname,"PCMU") == 0) ||
@@ -292,7 +287,7 @@ int OutputMixer::StartRecordingPlayout(const char* fileName,
// Destroy the old instance
if (output_file_recorder_) {
- output_file_recorder_->RegisterModuleFileCallback(NULL);
+ output_file_recorder_->RegisterModuleFileCallback(nullptr);
output_file_recorder_.reset();
}
@@ -337,17 +332,15 @@ int OutputMixer::StartRecordingPlayout(OutStream* stream,
const uint32_t notificationTime(0);
CodecInst dummyCodec={100,"L16",16000,320,1,320000};
- if (codecInst != NULL && codecInst->channels != 1)
- {
- _engineStatisticsPtr->SetLastError(
- VE_BAD_ARGUMENT, kTraceError,
- "StartRecordingPlayout() invalid compression");
- return(-1);
+ if (codecInst != nullptr && codecInst->channels != 1) {
+ _engineStatisticsPtr->SetLastError(
+ VE_BAD_ARGUMENT, kTraceError,
+ "StartRecordingPlayout() invalid compression");
+ return (-1);
}
- if(codecInst == NULL)
- {
- format = kFileFormatPcm16kHzFile;
- codecInst=&dummyCodec;
+ if (codecInst == nullptr) {
+ format = kFileFormatPcm16kHzFile;
+ codecInst = &dummyCodec;
}
else if((STR_CASE_CMP(codecInst->plname,"L16") == 0) ||
(STR_CASE_CMP(codecInst->plname,"PCMU") == 0) ||
@@ -364,7 +357,7 @@ int OutputMixer::StartRecordingPlayout(OutStream* stream,
// Destroy the old instance
if (output_file_recorder_) {
- output_file_recorder_->RegisterModuleFileCallback(NULL);
+ output_file_recorder_->RegisterModuleFileCallback(nullptr);
output_file_recorder_.reset();
}
@@ -413,7 +406,7 @@ int OutputMixer::StopRecordingPlayout()
"StopRecording(), could not stop recording");
return -1;
}
- output_file_recorder_->RegisterModuleFileCallback(NULL);
+ output_file_recorder_->RegisterModuleFileCallback(nullptr);
output_file_recorder_.reset();
_outputFileRecording = false;

Powered by Google App Engine
This is Rietveld 408576698