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
This commit is contained in:
asapersson@webrtc.org 2014-04-11 07:59:43 +00:00
parent b884eb6118
commit 8b2ec15d1e
6 changed files with 57 additions and 162 deletions

View File

@ -9,7 +9,7 @@
*/ */
#include "webrtc/modules/utility/source/file_player_impl.h" #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 #ifdef WEBRTC_MODULE_UTILITY_VIDEO
#include "frame_scaler.h" #include "frame_scaler.h"
@ -35,8 +35,6 @@ FilePlayer* FilePlayer::CreateFilePlayer(uint32_t instanceID,
#ifdef WEBRTC_MODULE_UTILITY_VIDEO #ifdef WEBRTC_MODULE_UTILITY_VIDEO
return new VideoFilePlayerImpl(instanceID, fileFormat); return new VideoFilePlayerImpl(instanceID, fileFormat);
#else #else
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
"Invalid file format: %d", kFileFormatAviFile);
assert(false); assert(false);
return NULL; return NULL;
#endif #endif
@ -114,10 +112,9 @@ int32_t FilePlayerImpl::Get10msAudioFromFile(
{ {
if(_codec.plfreq == 0) if(_codec.plfreq == 0)
{ {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID, LOG(LS_WARNING) << "Get10msAudioFromFile() playing not started!"
"FilePlayerImpl::Get10msAudioFromFile() playing not started!\ << " codec freq = " << _codec.plfreq
codecFreq = %d, wantedFreq = %d", << ", wanted freq = " << frequencyInHz;
_codec.plfreq, frequencyInHz);
return -1; return -1;
} }
@ -175,8 +172,7 @@ int32_t FilePlayerImpl::Get10msAudioFromFile(
if(_resampler.ResetIfNeeded(unresampledAudioFrame.sample_rate_hz_, if(_resampler.ResetIfNeeded(unresampledAudioFrame.sample_rate_hz_,
frequencyInHz, kResamplerSynchronous)) frequencyInHz, kResamplerSynchronous))
{ {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID, LOG(LS_WARNING) << "Get10msAudioFromFile() unexpected codec.";
"FilePlayerImpl::Get10msAudioFromFile() unexpected codec");
// New sampling frequency. Update state. // New sampling frequency. Update state.
outLen = frequencyInHz / 100; outLen = frequencyInHz / 100;
@ -214,8 +210,7 @@ int32_t FilePlayerImpl::SetAudioScaling(float scaleFactor)
_scaling = scaleFactor; _scaling = scaleFactor;
return 0; return 0;
} }
WEBRTC_TRACE(kTraceWarning, kTraceVoice, _instanceID, LOG(LS_WARNING) << "SetAudioScaling() non-allowed scale factor.";
"FilePlayerImpl::SetAudioScaling() not allowed scale factor");
return -1; return -1;
} }
@ -255,9 +250,8 @@ int32_t FilePlayerImpl::StartPlayingFile(const char* fileName,
codecInstL16.pacsize = 160; codecInstL16.pacsize = 160;
} else } else
{ {
WEBRTC_TRACE(kTraceError, kTraceVoice, _instanceID, LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
"FilePlayerImpl::StartPlayingFile() sample frequency\ << "supported for PCM format.";
specifed not supported for PCM format.");
return -1; return -1;
} }
@ -266,12 +260,8 @@ int32_t FilePlayerImpl::StartPlayingFile(const char* fileName,
startPosition, startPosition,
stopPosition) == -1) stopPosition) == -1)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "StartPlayingFile() failed to initialize "
kTraceWarning, << "pcm file " << fileName;
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() failed to initialize file\
%s playout.", fileName);
return -1; return -1;
} }
SetAudioScaling(volumeScaling); SetAudioScaling(volumeScaling);
@ -280,13 +270,8 @@ int32_t FilePlayerImpl::StartPlayingFile(const char* fileName,
if (_fileModule.StartPlayingAudioFile(fileName, notification, loop, if (_fileModule.StartPlayingAudioFile(fileName, notification, loop,
_fileFormat, codecInst) == -1) _fileFormat, codecInst) == -1)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "StartPlayingFile() failed to initialize "
kTraceWarning, << "pre-encoded file " << fileName;
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingPreEncodedFile() failed to\
initialize pre-encoded file %s playout.",
fileName);
return -1; return -1;
} }
} else } else
@ -297,12 +282,8 @@ int32_t FilePlayerImpl::StartPlayingFile(const char* fileName,
startPosition, startPosition,
stopPosition) == -1) stopPosition) == -1)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "StartPlayingFile() failed to initialize file "
kTraceWarning, << fileName;
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() failed to initialize file\
%s playout.", fileName);
return -1; return -1;
} }
SetAudioScaling(volumeScaling); SetAudioScaling(volumeScaling);
@ -350,12 +331,8 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream& sourceStream,
codecInstL16.pacsize = 160; codecInstL16.pacsize = 160;
}else }else
{ {
WEBRTC_TRACE( LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
kTraceError, << "supported for PCM format.";
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() sample frequency specifed\
not supported for PCM format.");
return -1; return -1;
} }
if (_fileModule.StartPlayingAudioStream(sourceStream, notification, if (_fileModule.StartPlayingAudioStream(sourceStream, notification,
@ -363,12 +340,8 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream& sourceStream,
startPosition, startPosition,
stopPosition) == -1) stopPosition) == -1)
{ {
WEBRTC_TRACE( LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
kTraceError, << "playout.";
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() failed to initialize stream\
playout.");
return -1; return -1;
} }
@ -377,12 +350,8 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream& sourceStream,
if (_fileModule.StartPlayingAudioStream(sourceStream, notification, if (_fileModule.StartPlayingAudioStream(sourceStream, notification,
_fileFormat, codecInst) == -1) _fileFormat, codecInst) == -1)
{ {
WEBRTC_TRACE( LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
kTraceWarning, << "playout.";
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() failed to initialize stream\
playout.");
return -1; return -1;
} }
} else { } else {
@ -392,9 +361,8 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream& sourceStream,
startPosition, startPosition,
stopPosition) == -1) stopPosition) == -1)
{ {
WEBRTC_TRACE(kTraceError, kTraceVoice, _instanceID, LOG(LS_ERROR) << "StartPlayingFile() failed to initialize stream "
"FilePlayerImpl::StartPlayingFile() failed to initialize\ << "playout.";
stream playout.");
return -1; return -1;
} }
} }
@ -430,23 +398,14 @@ int32_t FilePlayerImpl::SetUpAudioDecoder()
{ {
if ((_fileModule.codec_info(_codec) == -1)) if ((_fileModule.codec_info(_codec) == -1))
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "Failed to retrieve codec info of file data.";
kTraceWarning,
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() failed to retrieve Codec info\
of file data.");
return -1; return -1;
} }
if( STR_CASE_CMP(_codec.plname, "L16") != 0 && if( STR_CASE_CMP(_codec.plname, "L16") != 0 &&
_audioDecoder.SetDecodeCodec(_codec,AMRFileStorage) == -1) _audioDecoder.SetDecodeCodec(_codec,AMRFileStorage) == -1)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "SetUpAudioDecoder() codec " << _codec.plname
kTraceWarning, << " not supported.";
kTraceVoice,
_instanceID,
"FilePlayerImpl::StartPlayingFile() codec %s not supported",
_codec.plname);
return -1; return -1;
} }
_numberOf10MsPerFrame = _codec.pacsize / (_codec.plfreq / 100); _numberOf10MsPerFrame = _codec.pacsize / (_codec.plfreq / 100);
@ -627,12 +586,7 @@ int32_t VideoFilePlayerImpl::TimeUntilNextVideoFrame()
reinterpret_cast< int8_t*>(_encodedData.payloadData), reinterpret_cast< int8_t*>(_encodedData.payloadData),
encodedBufferLengthInBytes) != 0) encodedBufferLengthInBytes) != 0)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "Error reading video data.";
kTraceWarning,
kTraceVideo,
_instanceID,
"FilePlayerImpl::TimeUntilNextVideoFrame() error reading\
video data");
return -1; return -1;
} }
_encodedData.payloadSize = encodedBufferLengthInBytes; _encodedData.payloadSize = encodedBufferLengthInBytes;
@ -685,23 +639,16 @@ int32_t VideoFilePlayerImpl::SetUpVideoDecoder()
{ {
if (_fileModule.VideoCodecInst(video_codec_info_) != 0) if (_fileModule.VideoCodecInst(video_codec_info_) != 0)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "SetVideoDecoder() failed to retrieve codec info of "
kTraceWarning, << "file data.";
kTraceVideo,
_instanceID,
"FilePlayerImpl::SetVideoDecoder() failed to retrieve Codec info of\
file data.");
return -1; return -1;
} }
int32_t useNumberOfCores = 1; int32_t useNumberOfCores = 1;
if (video_decoder_->SetDecodeCodec(video_codec_info_, useNumberOfCores) != if (video_decoder_->SetDecodeCodec(video_codec_info_, useNumberOfCores) !=
0) { 0) {
WEBRTC_TRACE(kTraceWarning, LOG(LS_WARNING) << "SetUpVideoDecoder() codec "
kTraceVideo, << video_codec_info_.plName << " not supported.";
_instanceID,
"FilePlayerImpl::SetUpVideoDecoder() codec %s not supported",
video_codec_info_.plName);
return -1; return -1;
} }

View File

@ -12,7 +12,7 @@
#include "webrtc/engine_configurations.h" #include "webrtc/engine_configurations.h"
#include "webrtc/modules/media_file/interface/media_file.h" #include "webrtc/modules/media_file/interface/media_file.h"
#include "webrtc/modules/utility/source/file_recorder_impl.h" #include "webrtc/modules/utility/source/file_recorder_impl.h"
#include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/system_wrappers/interface/logging.h"
#ifdef WEBRTC_MODULE_UTILITY_VIDEO #ifdef WEBRTC_MODULE_UTILITY_VIDEO
#include "critical_section_wrapper.h" #include "critical_section_wrapper.h"
@ -38,8 +38,6 @@ FileRecorder* FileRecorder::CreateFileRecorder(uint32_t instanceID,
#ifdef WEBRTC_MODULE_UTILITY_VIDEO #ifdef WEBRTC_MODULE_UTILITY_VIDEO
return new AviRecorder(instanceID, fileFormat); return new AviRecorder(instanceID, fileFormat);
#else #else
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
"Invalid file format: %d", kFileFormatAviFile);
assert(false); assert(false);
return NULL; return NULL;
#endif #endif
@ -115,13 +113,8 @@ int32_t FileRecorderImpl::StartRecordingAudioFile(
} }
if( retVal != 0) if( retVal != 0)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "Failed to initialize file " << fileName
kTraceWarning, << " for recording.";
kTraceVoice,
_instanceID,
"FileRecorder::StartRecording() failed to initialize file %s for\
recording.",
fileName);
if(IsRecording()) if(IsRecording())
{ {
@ -152,12 +145,7 @@ int32_t FileRecorderImpl::StartRecordingAudioFile(
} }
if( retVal != 0) if( retVal != 0)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "Failed to initialize outStream for recording.";
kTraceWarning,
kTraceVoice,
_instanceID,
"FileRecorder::StartRecording() failed to initialize outStream for\
recording.");
if(IsRecording()) if(IsRecording())
{ {
@ -184,12 +172,8 @@ int32_t FileRecorderImpl::RecordAudioToFile(
{ {
if (codec_info_.plfreq == 0) if (codec_info_.plfreq == 0)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "RecordAudioToFile() recording audio is not "
kTraceWarning, << "turned on.";
kTraceVoice,
_instanceID,
"FileRecorder::RecordAudioToFile() recording audio is not turned\
on");
return -1; return -1;
} }
AudioFrame tempAudioFrame; AudioFrame tempAudioFrame;
@ -250,13 +234,9 @@ int32_t FileRecorderImpl::RecordAudioToFile(
if (_audioEncoder.Encode(*ptrAudioFrame, _audioBuffer, if (_audioEncoder.Encode(*ptrAudioFrame, _audioBuffer,
encodedLenInBytes) == -1) encodedLenInBytes) == -1)
{ {
WEBRTC_TRACE( LOG(LS_WARNING) << "RecordAudioToFile() codec "
kTraceWarning, << codec_info_.plname
kTraceVoice, << " not supported or failed to encode stream.";
_instanceID,
"FileRecorder::RecordAudioToFile() codec %s not supported or\
failed to encode stream",
codec_info_.plname);
return -1; return -1;
} }
} else { } else {
@ -309,12 +289,8 @@ int32_t FileRecorderImpl::SetUpAudioEncoder()
{ {
if(_audioEncoder.SetEncodeCodec(codec_info_,_amrFormat) == -1) if(_audioEncoder.SetEncodeCodec(codec_info_,_amrFormat) == -1)
{ {
WEBRTC_TRACE( LOG(LS_ERROR) << "SetUpAudioEncoder() codec "
kTraceError, << codec_info_.plname << " not supported.";
kTraceVoice,
_instanceID,
"FileRecorder::StartRecording() codec %s not supported",
codec_info_.plname);
return -1; return -1;
} }
} }
@ -600,8 +576,8 @@ bool AviRecorder::Process()
error = EncodeAndWriteVideoToFile( *frameToProcess); error = EncodeAndWriteVideoToFile( *frameToProcess);
if( error != 0) if( error != 0)
{ {
WEBRTC_TRACE(kTraceError, kTraceVideo, _instanceID, LOG(LS_ERROR) << "AviRecorder::Process() error writing to "
"AviRecorder::Process() error writing to file."); << "file.";
break; break;
} else { } else {
uint32_t frameLengthMS = 1000 / uint32_t frameLengthMS = 1000 /
@ -640,8 +616,7 @@ bool AviRecorder::Process()
error = EncodeAndWriteVideoToFile( *frameToProcess); error = EncodeAndWriteVideoToFile( *frameToProcess);
if(error != 0) if(error != 0)
{ {
WEBRTC_TRACE(kTraceError, kTraceVideo, _instanceID, LOG(LS_ERROR) << "AviRecorder::Process() error writing to file.";
"AviRecorder::Process() error writing to file.");
} else { } else {
_writtenVideoMS += frameLengthMS; _writtenVideoMS += frameLengthMS;
} }
@ -692,17 +667,12 @@ int32_t AviRecorder::EncodeAndWriteVideoToFile(I420VideoFrame& videoFrame)
(int8_t*)(_videoEncodedData.payloadData), (int8_t*)(_videoEncodedData.payloadData),
_videoEncodedData.payloadSize)) _videoEncodedData.payloadSize))
{ {
WEBRTC_TRACE(kTraceError, kTraceVideo, _instanceID, LOG(LS_ERROR) << "Error writing AVI file.";
"Error writing AVI file");
return -1; return -1;
} }
} else { } else {
WEBRTC_TRACE( LOG(LS_ERROR) << "FileRecorder::RecordVideoToFile() frame dropped by "
kTraceError, << "encoder, bitrate likely too low.";
kTraceVideo,
_instanceID,
"FileRecorder::RecordVideoToFile() frame dropped by encoder bitrate\
likely to low.");
} }
return 0; return 0;
} }

View File

@ -13,7 +13,6 @@
#ifdef WEBRTC_MODULE_UTILITY_VIDEO #ifdef WEBRTC_MODULE_UTILITY_VIDEO
#include "webrtc/common_video/libyuv/include/scaler.h" #include "webrtc/common_video/libyuv/include/scaler.h"
#include "webrtc/system_wrappers/interface/trace.h"
namespace webrtc { namespace webrtc {

View File

@ -10,7 +10,7 @@
#include "webrtc/modules/interface/module.h" #include "webrtc/modules/interface/module.h"
#include "webrtc/modules/utility/source/process_thread_impl.h" #include "webrtc/modules/utility/source/process_thread_impl.h"
#include "webrtc/system_wrappers/interface/trace.h"
namespace webrtc { namespace webrtc {
ProcessThread::~ProcessThread() ProcessThread::~ProcessThread()
@ -32,14 +32,12 @@ ProcessThreadImpl::ProcessThreadImpl()
_critSectModules(CriticalSectionWrapper::CreateCriticalSection()), _critSectModules(CriticalSectionWrapper::CreateCriticalSection()),
_thread(NULL) _thread(NULL)
{ {
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s created", __FUNCTION__);
} }
ProcessThreadImpl::~ProcessThreadImpl() ProcessThreadImpl::~ProcessThreadImpl()
{ {
delete _critSectModules; delete _critSectModules;
delete &_timeEvent; delete &_timeEvent;
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__);
} }
int32_t ProcessThreadImpl::Start() int32_t ProcessThreadImpl::Start()
@ -101,9 +99,7 @@ int32_t ProcessThreadImpl::RegisterModule(Module* module)
} }
_modules.push_front(module); _modules.push_front(module);
WEBRTC_TRACE(kTraceInfo, kTraceUtility, -1,
"number of registered modules has increased to %d",
_modules.size());
// Wake the thread calling ProcessThreadImpl::Process() to update the // Wake the thread calling ProcessThreadImpl::Process() to update the
// waiting time. The waiting time for the just registered module may be // waiting time. The waiting time for the just registered module may be
// shorter than all other registered modules. // shorter than all other registered modules.
@ -119,9 +115,6 @@ int32_t ProcessThreadImpl::DeRegisterModule(const Module* module)
if(module == *iter) if(module == *iter)
{ {
_modules.erase(iter); _modules.erase(iter);
WEBRTC_TRACE(kTraceInfo, kTraceUtility, -1,
"number of registered modules has decreased to %d",
_modules.size());
return 0; return 0;
} }
} }

View File

@ -14,7 +14,7 @@
#include <stdio.h> #include <stdio.h>
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/system_wrappers/interface/logging.h"
#if defined(_WIN32) #if defined(_WIN32)
#include <Windows.h> #include <Windows.h>
@ -71,7 +71,6 @@ RtpDumpImpl::RtpDumpImpl()
_file(*FileWrapper::Create()), _file(*FileWrapper::Create()),
_startTime(0) _startTime(0)
{ {
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s created", __FUNCTION__);
} }
RtpDump::~RtpDump() RtpDump::~RtpDump()
@ -84,7 +83,6 @@ RtpDumpImpl::~RtpDumpImpl()
_file.CloseFile(); _file.CloseFile();
delete &_file; delete &_file;
delete _critSect; delete _critSect;
WEBRTC_TRACE(kTraceMemory, kTraceUtility, -1, "%s deleted", __FUNCTION__);
} }
int32_t RtpDumpImpl::Start(const char* fileNameUTF8) int32_t RtpDumpImpl::Start(const char* fileNameUTF8)
@ -100,8 +98,7 @@ int32_t RtpDumpImpl::Start(const char* fileNameUTF8)
_file.CloseFile(); _file.CloseFile();
if (_file.OpenFile(fileNameUTF8, false, false, false) == -1) if (_file.OpenFile(fileNameUTF8, false, false, false) == -1)
{ {
WEBRTC_TRACE(kTraceError, kTraceUtility, -1, LOG(LS_ERROR) << "Failed to open file.";
"failed to open the specified file");
return -1; return -1;
} }
@ -113,8 +110,7 @@ int32_t RtpDumpImpl::Start(const char* fileNameUTF8)
sprintf(magic, "#!rtpplay%s \n", RTPFILE_VERSION); sprintf(magic, "#!rtpplay%s \n", RTPFILE_VERSION);
if (_file.WriteText(magic) == -1) if (_file.WriteText(magic) == -1)
{ {
WEBRTC_TRACE(kTraceError, kTraceUtility, -1, LOG(LS_ERROR) << "Error writing to file.";
"error writing to file");
return -1; return -1;
} }
@ -129,8 +125,7 @@ int32_t RtpDumpImpl::Start(const char* fileNameUTF8)
memset(dummyHdr, 0, 16); memset(dummyHdr, 0, 16);
if (!_file.Write(dummyHdr, sizeof(dummyHdr))) if (!_file.Write(dummyHdr, sizeof(dummyHdr)))
{ {
WEBRTC_TRACE(kTraceError, kTraceUtility, -1, LOG(LS_ERROR) << "Error writing to file.";
"error writing to file");
return -1; return -1;
} }
return 0; return 0;
@ -198,14 +193,12 @@ int32_t RtpDumpImpl::DumpPacket(const uint8_t* packet, uint16_t packetLength)
if (!_file.Write(&hdr, sizeof(hdr))) if (!_file.Write(&hdr, sizeof(hdr)))
{ {
WEBRTC_TRACE(kTraceError, kTraceUtility, -1, LOG(LS_ERROR) << "Error writing to file.";
"error writing to file");
return -1; return -1;
} }
if (!_file.Write(packet, packetLength)) if (!_file.Write(packet, packetLength))
{ {
WEBRTC_TRACE(kTraceError, kTraceUtility, -1, LOG(LS_ERROR) << "Error writing to file.";
"error writing to file");
return -1; return -1;
} }

View File

@ -16,8 +16,8 @@
#include "webrtc/common_video/interface/texture_video_frame.h" #include "webrtc/common_video/interface/texture_video_frame.h"
#include "webrtc/modules/interface/module_common_types.h" #include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/system_wrappers/interface/logging.h"
#include "webrtc/system_wrappers/interface/tick_util.h" #include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/system_wrappers/interface/trace.h"
namespace webrtc { namespace webrtc {
VideoFramesQueue::VideoFramesQueue() VideoFramesQueue::VideoFramesQueue()
@ -56,16 +56,9 @@ int32_t VideoFramesQueue::AddFrame(const I420VideoFrame& newFrame) {
if (!ptrFrameToAdd) { if (!ptrFrameToAdd) {
if (_emptyFrames.size() + _incomingFrames.size() > if (_emptyFrames.size() + _incomingFrames.size() >
KMaxNumberOfFrames) { KMaxNumberOfFrames) {
WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, -1, LOG(LS_WARNING) << "Too many frames, limit: " << KMaxNumberOfFrames;
"%s: too many frames, limit: %d", __FUNCTION__,
KMaxNumberOfFrames);
return -1; return -1;
} }
WEBRTC_TRACE(kTraceMemory, kTraceVideoRenderer, -1,
"%s: allocating buffer %d", __FUNCTION__,
_emptyFrames.size() + _incomingFrames.size());
ptrFrameToAdd = new I420VideoFrame(); ptrFrameToAdd = new I420VideoFrame();
} }
ptrFrameToAdd->CopyFrame(newFrame); ptrFrameToAdd->CopyFrame(newFrame);