Bug 829314, enable webrtc_trace logging for getUserMedia's VideoEngine, r=jesup

This commit is contained in:
Dan Mosedale 2013-01-11 15:30:20 -08:00
parent d34cee3383
commit 5af872649d
2 changed files with 19 additions and 1 deletions

View File

@ -42,5 +42,6 @@ ifdef MOZ_WEBRTC
LOCAL_INCLUDES += \
-I$(topsrcdir)/media/webrtc/trunk/src \
-I$(topsrcdir)/media/webrtc/signaling/src/common \
-I$(topsrcdir)/media/webrtc/signaling/src/common/browser_logging \
$(NULL)
endif

View File

@ -10,7 +10,8 @@
#error "This file must be #included before any IPDL-generated files or other files that #include prlog.h"
#endif
#include "prlog.h"
#include "CSFLog.h"
#include "prenv.h"
#ifdef PR_LOGGING
static PRLogModuleInfo*
@ -45,6 +46,22 @@ MediaEngineWebRTC::EnumerateVideoDevices(nsTArray<nsRefPtr<MediaEngineVideoSourc
}
}
PRLogModuleInfo *logs = GetWebRTCLogInfo();
if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) {
// no need to a critical section or lock here
gWebrtcTraceLoggingOn = 1;
const char *file = PR_GetEnv("WEBRTC_TRACE_FILE");
if (!file) {
file = "WebRTC.log";
}
LOG(("Logging webrtc to %s level %d", __FUNCTION__, file, logs->level));
mVideoEngine->SetTraceFilter(logs->level);
mVideoEngine->SetTraceFile(file);
}
ptrViEBase = webrtc::ViEBase::GetInterface(mVideoEngine);
if (!ptrViEBase) {
return;