*/
#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"
#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
{
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;
}
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;
_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;
}
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;
}
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);
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
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);
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,
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;
}
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 {
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;
}
}
{
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);
VideoFilePlayerImpl::VideoFilePlayerImpl(uint32_t instanceID,
FileFormats fileFormat)
: FilePlayerImpl(instanceID, fileFormat),
- video_decoder_(new VideoCoder(instanceID)),
+ video_decoder_(new VideoCoder()),
video_codec_info_(),
_decodedVideoFrames(0),
_encodedData(*new EncodedVideoData()),
CriticalSectionScoped lock( _critSec);
_decodedVideoFrames = 0;
- video_decoder_.reset(new VideoCoder(_instanceID));
+ video_decoder_.reset(new VideoCoder());
return FilePlayerImpl::StopPlayingFile();
}
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;
{
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;
}