Convert WEBRTC_TRACE to LOG in utility.
BUG=3153
R=mflodman@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/11099004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5886 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/utility/source/file_player_impl.cc b/webrtc/modules/utility/source/file_player_impl.cc
index 9240e64..23a928f 100644
--- a/webrtc/modules/utility/source/file_player_impl.cc
+++ b/webrtc/modules/utility/source/file_player_impl.cc
@@ -9,7 +9,7 @@
*/
#include "webrtc/modules/utility/source/file_player_impl.h"
-#include "webrtc/system_wrappers/interface/trace.h"
+#include "webrtc/system_wrappers/interface/logging.h"
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
#include "frame_scaler.h"
@@ -35,8 +35,6 @@
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
return new VideoFilePlayerImpl(instanceID, fileFormat);
#else
- WEBRTC_TRACE(kTraceError, kTraceFile, -1,
- "Invalid file format: %d", kFileFormatAviFile);
assert(false);
return NULL;
#endif
@@ -114,10 +112,9 @@
{
if(_codec.plfreq == 0)
{
- WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID,
- "FilePlayerImpl::Get10msAudioFromFile() playing not started!\
- codecFreq = %d, wantedFreq = %d",
- _codec.plfreq, frequencyInHz);
+ LOG(LS_WARNING) << "Get10msAudioFromFile() playing not started!"
+ << " codec freq = " << _codec.plfreq
+ << ", wanted freq = " << frequencyInHz;
return -1;
}
@@ -175,8 +172,7 @@
if(_resampler.ResetIfNeeded(unresampledAudioFrame.sample_rate_hz_,
frequencyInHz, kResamplerSynchronous))
{
- WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID,
- "FilePlayerImpl::Get10msAudioFromFile() unexpected codec");
+ LOG(LS_WARNING) << "Get10msAudioFromFile() unexpected codec.";
// New sampling frequency. Update state.
outLen = frequencyInHz / 100;
@@ -214,8 +210,7 @@
_scaling = scaleFactor;
return 0;
}
- WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID,
- "FilePlayerImpl::SetAudioScaling() not allowed scale factor");
+ LOG(LS_WARNING) << "SetAudioScaling() non-allowed scale factor.";
return -1;
}
@@ -255,9 +250,8 @@
codecInstL16.pacsize = 160;
} else
{
- WEBRTC_TRACE(kTraceError, kTraceVoice, _instanceID,
- "FilePlayerImpl::StartPlayingFile() sample frequency\
- specifed not supported for PCM format.");
+ LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
+ << "supported for PCM format.";
return -1;
}
@@ -266,12 +260,8 @@
startPosition,
stopPosition) == -1)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to initialize file\
- %s playout.", fileName);
+ LOG(LS_WARNING) << "StartPlayingFile() failed to initialize "
+ << "pcm file " << fileName;
return -1;
}
SetAudioScaling(volumeScaling);
@@ -280,13 +270,8 @@
if (_fileModule.StartPlayingAudioFile(fileName, notification, loop,
_fileFormat, codecInst) == -1)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingPreEncodedFile() failed to\
- initialize pre-encoded file %s playout.",
- fileName);
+ LOG(LS_WARNING) << "StartPlayingFile() failed to initialize "
+ << "pre-encoded file " << fileName;
return -1;
}
} else
@@ -297,12 +282,8 @@
startPosition,
stopPosition) == -1)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to initialize file\
- %s playout.", fileName);
+ LOG(LS_WARNING) << "StartPlayingFile() failed to initialize file "
+ << fileName;
return -1;
}
SetAudioScaling(volumeScaling);
@@ -350,12 +331,8 @@
codecInstL16.pacsize = 160;
}else
{
- WEBRTC_TRACE(
- kTraceError,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() sample frequency specifed\
- not supported for PCM format.");
+ LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
+ << "supported for PCM format.";
return -1;
}
if (_fileModule.StartPlayingAudioStream(sourceStream, notification,
@@ -363,12 +340,8 @@
startPosition,
stopPosition) == -1)
{
- WEBRTC_TRACE(
- kTraceError,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to initialize stream\
- playout.");
+ LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
+ << "playout.";
return -1;
}
@@ -377,12 +350,8 @@
if (_fileModule.StartPlayingAudioStream(sourceStream, notification,
_fileFormat, codecInst) == -1)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to initialize stream\
- playout.");
+ LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
+ << "playout.";
return -1;
}
} else {
@@ -392,9 +361,8 @@
startPosition,
stopPosition) == -1)
{
- WEBRTC_TRACE(kTraceError, kTraceVoice, _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to initialize\
- stream playout.");
+ LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
+ << "playout.";
return -1;
}
}
@@ -430,23 +398,14 @@
{
if ((_fileModule.codec_info(_codec) == -1))
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() failed to retrieve Codec info\
- of file data.");
+ LOG(LS_WARNING) << "Failed to retrieve codec info of file data.";
return -1;
}
if( STR_CASE_CMP(_codec.plname, "L16") != 0 &&
_audioDecoder.SetDecodeCodec(_codec,AMRFileStorage) == -1)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVoice,
- _instanceID,
- "FilePlayerImpl::StartPlayingFile() codec %s not supported",
- _codec.plname);
+ LOG(LS_WARNING) << "SetUpAudioDecoder() codec " << _codec.plname
+ << " not supported.";
return -1;
}
_numberOf10MsPerFrame = _codec.pacsize / (_codec.plfreq / 100);
@@ -627,12 +586,7 @@
reinterpret_cast< int8_t*>(_encodedData.payloadData),
encodedBufferLengthInBytes) != 0)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVideo,
- _instanceID,
- "FilePlayerImpl::TimeUntilNextVideoFrame() error reading\
- video data");
+ LOG(LS_WARNING) << "Error reading video data.";
return -1;
}
_encodedData.payloadSize = encodedBufferLengthInBytes;
@@ -685,23 +639,16 @@
{
if (_fileModule.VideoCodecInst(video_codec_info_) != 0)
{
- WEBRTC_TRACE(
- kTraceWarning,
- kTraceVideo,
- _instanceID,
- "FilePlayerImpl::SetVideoDecoder() failed to retrieve Codec info of\
- file data.");
+ LOG(LS_WARNING) << "SetVideoDecoder() failed to retrieve codec info of "
+ << "file data.";
return -1;
}
int32_t useNumberOfCores = 1;
if (video_decoder_->SetDecodeCodec(video_codec_info_, useNumberOfCores) !=
0) {
- WEBRTC_TRACE(kTraceWarning,
- kTraceVideo,
- _instanceID,
- "FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
- video_codec_info_.plName);
+ LOG(LS_WARNING) << "SetUpVideoDecoder() codec "
+ << video_codec_info_.plName << " not supported.";
return -1;
}