bug-1256430 start AEC log independently of webrtc TRACE; r?pkerr
MozReview-Commit-ID: EWcstGD5FVb
--- a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
+++ b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
@@ -18,17 +18,16 @@
#endif
#include "nsIFile.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
using mozilla::LogLevel;
-//@@NG TODO This is not thread safe. I am not sure if it is necessary at all though. gWebRtcTraceLoggingOn is _never_ set a non-false value.
static int gWebRtcTraceLoggingOn = 0;
#if defined(ANDROID)
static const char *default_tmp_dir = "/dev/null";
static const char *default_log_name = "nspr";
#else // Assume a POSIX environment
NS_NAMED_LITERAL_CSTRING(default_log_name, "WebRTC.log");
@@ -101,33 +100,24 @@ void CheckOverrides(uint32_t *aTraceMask
const char *file_name = PR_GetEnv("WEBRTC_TRACE_FILE");
if (file_name) {
aLogFile->Assign(file_name);
}
}
void ConfigAecLog(nsCString &aAECLogDir) {
- printf("@@NG ConfigAecLog entered.\n");
if (webrtc::Trace::aec_debug()) {
return;
}
- printf("@@NG ConfigAecLog past guard.\n");
#if defined(ANDROID)
// For AEC, do not use a default value: force the user to specify a directory.
if (aAECLogDir.IsEmpty()) {
aAECLogDir.Assign(default_tmp_dir);
}
- /*#elif defined(XP_MACOSX)
- printf("@@NG assigning default /tmp/ AEC log dir.\n");
- if( aAECLogDir.IsEmpty()) {
- aAECLogDir.Assign("/tmp/");
- } else {
- printf("@@NG aECLogDir is not empty: \"%s\"",aAECLogDir.get());
- }*/
#else
if (aAECLogDir.IsEmpty()) {
nsCOMPtr<nsIFile> tempDir;
nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir));
if (NS_SUCCEEDED(rv)) {
if (aAECLogDir.IsEmpty()) {
tempDir->GetNativePath(aAECLogDir);
}
@@ -135,17 +125,16 @@ void ConfigAecLog(nsCString &aAECLogDir)
}
#endif
webrtc::Trace::set_aec_debug_filename(aAECLogDir.get());
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
if (XRE_IsParentProcess()) {
// Capture the final choices for the trace settings.
mozilla::Preferences::SetCString("media.webrtc.debug.aec_log_dir", aAECLogDir);
}
- printf("@@NG ConfigAecLog aAECLogDir is %s.\n",aAECLogDir.get());
#endif
}
void ConfigWebRtcLog(uint32_t trace_mask, nsCString &aLogFile, nsCString &aAECLogDir, bool multi_log)
{
if (gWebRtcTraceLoggingOn) {
return;
}
--- a/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
+++ b/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
@@ -676,39 +676,32 @@ int32_t
WebrtcGlobalInformation::DebugLevel(const GlobalObject& aGlobal)
{
return sLastSetLevel;
}
void
WebrtcGlobalInformation::SetAecDebug(const GlobalObject& aGlobal, bool aEnable)
{
- printf("@@NG WebrtcGlobalInformation::SetAecDebug aEnable=%d XRE_isParentProcess()=%d\n",aEnable,XRE_IsParentProcess());
- //StartWebRtcLog(sLastSetLevel); // to make it read the aec path
if( aEnable ) {
- printf("@@NG WebrtcGlobalInformation::SetAecDebug->StartAecLog()\n");
StartAecLog();
} else {
- printf("@@NG WebrtcGlobalInformation::SetAecDebug->StoptAecLog()\n");
StopAecLog();
}
- //webrtc::Trace::set_aec_debug(aEnable);
sLastAECDebug = aEnable;
for (auto& cp : WebrtcContentParents::GetAll()){
- printf("@@NG WebrtcGlobalInformation->SendSetAecLogging aEnable=%d\n",aEnable);
Unused << cp->SendSetAecLogging(aEnable);
}
}
bool
WebrtcGlobalInformation::AecDebug(const GlobalObject& aGlobal)
{
- printf("@@NG WebrtcGlobalInformation::AecDebug == %d \n",sLastAECDebug);
return sLastAECDebug;
}
bool
WebrtcGlobalParent::RecvGetStatsResult(const int& aRequestId,
nsTArray<RTCStatsReportInternal>&& Stats)
{
MOZ_ASSERT(NS_IsMainThread());
@@ -886,23 +879,20 @@ WebrtcGlobalChild::RecvClearLogRequest()
RunLogClear();
return true;
}
bool
WebrtcGlobalChild::RecvSetAecLogging(const bool& aEnable)
{
- printf("@@NG RecvSetAecLogging\n");
if (!mShutdown) {
if( aEnable ) {
- printf("@@NG WebrtcGlobalChild::RecvSetAecLogging->StartAecLog\n");
StartAecLog();
} else {
- printf("@@NG WebrtcGlobalChild::RecvSetAecLogging->StopAecLog\n");
StopAecLog();
}
}
return true;
}
bool
WebrtcGlobalChild::RecvSetDebugMode(const int& aLevel)