зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1163201 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
Родитель
67351b86be
Коммит
34f99e4b4c
|
@ -22,9 +22,7 @@
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsContentPolicy, nsIContentPolicy)
|
NS_IMPL_ISUPPORTS(nsContentPolicy, nsIContentPolicy)
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gConPolLog;
|
static PRLogModuleInfo* gConPolLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewContentPolicy(nsIContentPolicy **aResult)
|
NS_NewContentPolicy(nsIContentPolicy **aResult)
|
||||||
|
@ -40,11 +38,9 @@ nsContentPolicy::nsContentPolicy()
|
||||||
: mPolicies(NS_CONTENTPOLICY_CATEGORY)
|
: mPolicies(NS_CONTENTPOLICY_CATEGORY)
|
||||||
, mSimplePolicies(NS_SIMPLECONTENTPOLICY_CATEGORY)
|
, mSimplePolicies(NS_SIMPLECONTENTPOLICY_CATEGORY)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (! gConPolLog) {
|
if (! gConPolLog) {
|
||||||
gConPolLog = PR_NewLogModule("nsContentPolicy");
|
gConPolLog = PR_NewLogModule("nsContentPolicy");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentPolicy::~nsContentPolicy()
|
nsContentPolicy::~nsContentPolicy()
|
||||||
|
@ -187,8 +183,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
//uses the parameters from ShouldXYZ to produce and log a message
|
//uses the parameters from ShouldXYZ to produce and log a message
|
||||||
//logType must be a literal string constant
|
//logType must be a literal string constant
|
||||||
#define LOG_CHECK(logType) \
|
#define LOG_CHECK(logType) \
|
||||||
|
@ -216,12 +210,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
|
||||||
} \
|
} \
|
||||||
PR_END_MACRO
|
PR_END_MACRO
|
||||||
|
|
||||||
#else //!defined(PR_LOGGING)
|
|
||||||
|
|
||||||
#define LOG_CHECK(logType)
|
|
||||||
|
|
||||||
#endif //!defined(PR_LOGGING)
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsContentPolicy::ShouldLoad(uint32_t contentType,
|
nsContentPolicy::ShouldLoad(uint32_t contentType,
|
||||||
nsIURI *contentLocation,
|
nsIURI *contentLocation,
|
||||||
|
|
|
@ -56,7 +56,6 @@ class nsIPrincipal;
|
||||||
case nsIContentPolicy:: name : \
|
case nsIContentPolicy:: name : \
|
||||||
return #name
|
return #name
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
/**
|
/**
|
||||||
* Returns a string corresponding to the name of the response constant, or
|
* Returns a string corresponding to the name of the response constant, or
|
||||||
* "<Unknown Response>" if an unknown response value is given.
|
* "<Unknown Response>" if an unknown response value is given.
|
||||||
|
@ -119,8 +118,6 @@ NS_CP_ContentTypeName(uint32_t contentType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // defined(PR_LOGGING)
|
|
||||||
|
|
||||||
#undef CASE_RETURN
|
#undef CASE_RETURN
|
||||||
|
|
||||||
/* Passes on parameters from its "caller"'s context. */
|
/* Passes on parameters from its "caller"'s context. */
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetDataChannelLog();
|
extern PRLogModuleInfo* GetDataChannelLog();
|
||||||
#endif
|
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)
|
#define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)
|
||||||
|
|
||||||
|
|
|
@ -241,10 +241,8 @@ using namespace mozilla::dom;
|
||||||
|
|
||||||
typedef nsTArray<Link*> LinkArray;
|
typedef nsTArray<Link*> LinkArray;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gDocumentLeakPRLog;
|
static PRLogModuleInfo* gDocumentLeakPRLog;
|
||||||
static PRLogModuleInfo* gCspPRLog;
|
static PRLogModuleInfo* gCspPRLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NAME_NOT_VALID ((nsSimpleContentList*)1)
|
#define NAME_NOT_VALID ((nsSimpleContentList*)1)
|
||||||
|
|
||||||
|
@ -1591,7 +1589,6 @@ nsDocument::nsDocument(const char* aContentType)
|
||||||
{
|
{
|
||||||
SetContentTypeInternal(nsDependentCString(aContentType));
|
SetContentTypeInternal(nsDependentCString(aContentType));
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gDocumentLeakPRLog)
|
if (!gDocumentLeakPRLog)
|
||||||
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
|
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
|
||||||
|
|
||||||
|
@ -1601,7 +1598,6 @@ nsDocument::nsDocument(const char* aContentType)
|
||||||
|
|
||||||
if (!gCspPRLog)
|
if (!gCspPRLog)
|
||||||
gCspPRLog = PR_NewLogModule("CSP");
|
gCspPRLog = PR_NewLogModule("CSP");
|
||||||
#endif
|
|
||||||
|
|
||||||
// Start out mLastStyleSheetSet as null, per spec
|
// Start out mLastStyleSheetSet as null, per spec
|
||||||
SetDOMStringToNull(mLastStyleSheetSet);
|
SetDOMStringToNull(mLastStyleSheetSet);
|
||||||
|
@ -1640,11 +1636,9 @@ nsIDocument::~nsIDocument()
|
||||||
|
|
||||||
nsDocument::~nsDocument()
|
nsDocument::~nsDocument()
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDocumentLeakPRLog)
|
if (gDocumentLeakPRLog)
|
||||||
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
|
||||||
("DOCUMENT %p destroyed", this));
|
("DOCUMENT %p destroyed", this));
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
|
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
|
||||||
|
|
||||||
|
@ -2309,13 +2303,11 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
|
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
|
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
aURI->GetSpec(spec);
|
aURI->GetSpec(spec);
|
||||||
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
|
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mSecurityInfo = nullptr;
|
mSecurityInfo = nullptr;
|
||||||
|
|
||||||
|
@ -2644,7 +2636,6 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
|
||||||
nsIStreamListener **aDocListener,
|
nsIStreamListener **aDocListener,
|
||||||
bool aReset, nsIContentSink* aSink)
|
bool aReset, nsIContentSink* aSink)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
|
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
aChannel->GetURI(getter_AddRefs(uri));
|
aChannel->GetURI(getter_AddRefs(uri));
|
||||||
|
@ -2653,7 +2644,6 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
|
||||||
uri->GetSpec(spec);
|
uri->GetSpec(spec);
|
||||||
PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get());
|
PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
MOZ_ASSERT(NodePrincipal()->GetAppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID,
|
MOZ_ASSERT(NodePrincipal()->GetAppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID,
|
||||||
"Document should never have UNKNOWN_APP_ID");
|
"Document should never have UNKNOWN_APP_ID");
|
||||||
|
@ -2780,13 +2770,11 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
|
||||||
const nsSubstring& policy = tokenizer.nextToken();
|
const nsSubstring& policy = tokenizer.nextToken();
|
||||||
rv = csp->AppendPolicy(policy, aReportOnly);
|
rv = csp->AppendPolicy(policy, aReportOnly);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
{
|
{
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
||||||
("CSP refined with policy: \"%s\"",
|
("CSP refined with policy: \"%s\"",
|
||||||
NS_ConvertUTF16toUTF8(policy).get()));
|
NS_ConvertUTF16toUTF8(policy).get()));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -2823,10 +2811,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||||
if (!CSPService::sCSPEnabled) {
|
if (!CSPService::sCSPEnabled) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
||||||
("CSP is disabled, skipping CSP init for document %p", this));
|
("CSP is disabled, skipping CSP init for document %p", this));
|
||||||
#endif
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2878,7 +2864,6 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
!applyLoopCSP &&
|
!applyLoopCSP &&
|
||||||
cspHeaderValue.IsEmpty() &&
|
cspHeaderValue.IsEmpty() &&
|
||||||
cspROHeaderValue.IsEmpty()) {
|
cspROHeaderValue.IsEmpty()) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsCOMPtr<nsIURI> chanURI;
|
nsCOMPtr<nsIURI> chanURI;
|
||||||
aChannel->GetURI(getter_AddRefs(chanURI));
|
aChannel->GetURI(getter_AddRefs(chanURI));
|
||||||
nsAutoCString aspec;
|
nsAutoCString aspec;
|
||||||
|
@ -2887,13 +2872,10 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
("no CSP for document, %s, %s",
|
("no CSP for document, %s, %s",
|
||||||
aspec.get(),
|
aspec.get(),
|
||||||
applyAppDefaultCSP ? "is app" : "not an app"));
|
applyAppDefaultCSP ? "is app" : "not an app"));
|
||||||
#endif
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
|
||||||
#endif
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
|
@ -2912,12 +2894,10 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (csp) {
|
if (csp) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
|
||||||
"This document is sharing principal with another document.",
|
"This document is sharing principal with another document.",
|
||||||
"Since the document is an app, CSP was already set.",
|
"Since the document is an app, CSP was already set.",
|
||||||
"Skipping attempt to set CSP."));
|
"Skipping attempt to set CSP."));
|
||||||
#endif
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2925,9 +2905,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
|
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
|
||||||
|
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
|
||||||
#endif
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2980,10 +2958,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
rv = csp->PermitsAncestry(docShell, &safeAncestry);
|
rv = csp->PermitsAncestry(docShell, &safeAncestry);
|
||||||
|
|
||||||
if (NS_FAILED(rv) || !safeAncestry) {
|
if (NS_FAILED(rv) || !safeAncestry) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
||||||
("CSP doesn't like frame's ancestry, not loading."));
|
("CSP doesn't like frame's ancestry, not loading."));
|
||||||
#endif
|
|
||||||
// stop! ERROR page!
|
// stop! ERROR page!
|
||||||
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
|
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
|
||||||
}
|
}
|
||||||
|
@ -3002,13 +2978,11 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
mReferrerPolicySet = true;
|
mReferrerPolicySet = true;
|
||||||
} else if (mReferrerPolicy != referrerPolicy) {
|
} else if (mReferrerPolicy != referrerPolicy) {
|
||||||
mReferrerPolicy = mozilla::net::RP_No_Referrer;
|
mReferrerPolicy = mozilla::net::RP_No_Referrer;
|
||||||
#ifdef PR_LOGGING
|
|
||||||
{
|
{
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s",
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s",
|
||||||
"CSP wants to set referrer, but nsDocument"
|
"CSP wants to set referrer, but nsDocument"
|
||||||
"already has it set. No referrers will be sent"));
|
"already has it set. No referrers will be sent"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Referrer Policy is set separately for the speculative parser in
|
// Referrer Policy is set separately for the speculative parser in
|
||||||
|
@ -3018,10 +2992,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
|
||||||
|
|
||||||
rv = principal->SetCsp(csp);
|
rv = principal->SetCsp(csp);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
|
||||||
("Inserted CSP into principal %p", principal));
|
("Inserted CSP into principal %p", principal));
|
||||||
#endif
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,6 @@ using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::widget;
|
using namespace mozilla::widget;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
// Two types of focus pr logging are available:
|
// Two types of focus pr logging are available:
|
||||||
// 'Focus' for normal focus manager calls
|
// 'Focus' for normal focus manager calls
|
||||||
// 'FocusNavigation' for tab and document navigation
|
// 'FocusNavigation' for tab and document navigation
|
||||||
|
@ -94,15 +92,6 @@ PRLogModuleInfo* gFocusNavigationLog;
|
||||||
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
|
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
|
||||||
#define LOGCONTENTNAVIGATION(format, content) LOGTAG(gFocusNavigationLog, format, content)
|
#define LOGCONTENTNAVIGATION(format, content) LOGTAG(gFocusNavigationLog, format, content)
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define LOGFOCUS(args)
|
|
||||||
#define LOGFOCUSNAVIGATION(args)
|
|
||||||
#define LOGCONTENT(format, content)
|
|
||||||
#define LOGCONTENTNAVIGATION(format, content)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct nsDelayedBlurOrFocusEvent
|
struct nsDelayedBlurOrFocusEvent
|
||||||
{
|
{
|
||||||
nsDelayedBlurOrFocusEvent(uint32_t aType,
|
nsDelayedBlurOrFocusEvent(uint32_t aType,
|
||||||
|
@ -198,10 +187,8 @@ nsFocusManager::Init()
|
||||||
NS_ADDREF(fm);
|
NS_ADDREF(fm);
|
||||||
sInstance = fm;
|
sInstance = fm;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
gFocusLog = PR_NewLogModule("Focus");
|
gFocusLog = PR_NewLogModule("Focus");
|
||||||
gFocusNavigationLog = PR_NewLogModule("FocusNavigation");
|
gFocusNavigationLog = PR_NewLogModule("FocusNavigation");
|
||||||
#endif
|
|
||||||
|
|
||||||
nsIContent::sTabFocusModelAppliesToXUL =
|
nsIContent::sTabFocusModelAppliesToXUL =
|
||||||
Preferences::GetBool("accessibility.tabfocus_applies_to_xul",
|
Preferences::GetBool("accessibility.tabfocus_applies_to_xul",
|
||||||
|
@ -493,7 +480,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
|
||||||
{
|
{
|
||||||
*aElement = nullptr;
|
*aElement = nullptr;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
|
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
|
||||||
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
|
||||||
|
@ -506,7 +492,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGCONTENT(" Current Focus: %s", mFocusedContent.get());
|
LOGCONTENT(" Current Focus: %s", mFocusedContent.get());
|
||||||
#endif
|
|
||||||
|
|
||||||
// use FLAG_BYMOVEFOCUS when switching focus with MoveFocus unless one of
|
// use FLAG_BYMOVEFOCUS when switching focus with MoveFocus unless one of
|
||||||
// the other focus methods is already set, or we're just moving to the root
|
// the other focus methods is already set, or we're just moving to the root
|
||||||
|
@ -653,7 +638,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
|
||||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
|
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
|
||||||
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
|
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
||||||
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
|
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
|
@ -670,7 +654,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mActiveWindow == window) {
|
if (mActiveWindow == window) {
|
||||||
// The window is already active, so there is no need to focus anything,
|
// The window is already active, so there is no need to focus anything,
|
||||||
|
@ -751,7 +734,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
|
||||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
|
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
|
||||||
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
|
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
||||||
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
|
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
|
@ -768,7 +750,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mActiveWindow != window)
|
if (mActiveWindow != window)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -871,7 +852,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
|
||||||
|
|
||||||
window = window->GetOuterWindow();
|
window = window->GetOuterWindow();
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
||||||
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
|
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
|
@ -889,7 +869,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (nsCOMPtr<nsITabChild> child = do_GetInterface(window->GetDocShell())) {
|
if (nsCOMPtr<nsITabChild> child = do_GetInterface(window->GetDocShell())) {
|
||||||
bool active = static_cast<TabChild*>(child.get())->ParentIsActive();
|
bool active = static_cast<TabChild*>(child.get())->ParentIsActive();
|
||||||
|
@ -928,7 +907,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
|
||||||
|
|
||||||
window = window->GetOuterWindow();
|
window = window->GetOuterWindow();
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
||||||
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
|
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
|
@ -954,7 +932,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!IsSameOrAncestor(window, mFocusedWindow))
|
if (!IsSameOrAncestor(window, mFocusedWindow))
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1799,7 +1776,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
|
||||||
clearFirstFocusEvent = true;
|
clearFirstFocusEvent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
LOGCONTENT("Element %s has been focused", aContent);
|
LOGCONTENT("Element %s has been focused", aContent);
|
||||||
|
|
||||||
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
|
||||||
|
@ -1810,7 +1786,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
|
||||||
LOGFOCUS((" [Newdoc: %d FocusChanged: %d Raised: %d Flags: %x]",
|
LOGFOCUS((" [Newdoc: %d FocusChanged: %d Raised: %d Flags: %x]",
|
||||||
aIsNewDocument, aFocusChanged, aWindowRaised, aFlags));
|
aIsNewDocument, aFocusChanged, aWindowRaised, aFlags));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (aIsNewDocument) {
|
if (aIsNewDocument) {
|
||||||
// if this is a new document, update the parent chain of frames so that
|
// if this is a new document, update the parent chain of frames so that
|
||||||
|
|
|
@ -246,9 +246,7 @@ class nsIScriptTimeoutHandler;
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gDOMLeakPRLog;
|
static PRLogModuleInfo* gDOMLeakPRLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
@ -1212,11 +1210,9 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDOMLeakPRLog)
|
if (gDOMLeakPRLog)
|
||||||
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
|
||||||
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
|
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
|
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
|
||||||
NS_ASSERTION(!sWindowsById->Get(mWindowID),
|
NS_ASSERTION(!sWindowsById->Get(mWindowID),
|
||||||
|
@ -1248,10 +1244,8 @@ nsGlobalWindow::Init()
|
||||||
NS_ASSERTION(gEntropyCollector,
|
NS_ASSERTION(gEntropyCollector,
|
||||||
"gEntropyCollector should have been initialized!");
|
"gEntropyCollector should have been initialized!");
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
gDOMLeakPRLog = PR_NewLogModule("DOMLeak");
|
gDOMLeakPRLog = PR_NewLogModule("DOMLeak");
|
||||||
NS_ASSERTION(gDOMLeakPRLog, "gDOMLeakPRLog should have been initialized!");
|
NS_ASSERTION(gDOMLeakPRLog, "gDOMLeakPRLog should have been initialized!");
|
||||||
#endif
|
|
||||||
|
|
||||||
sWindowsById = new WindowByIdTable();
|
sWindowsById = new WindowByIdTable();
|
||||||
}
|
}
|
||||||
|
@ -1306,11 +1300,9 @@ nsGlobalWindow::~nsGlobalWindow()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDOMLeakPRLog)
|
if (gDOMLeakPRLog)
|
||||||
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
|
||||||
("DOMWINDOW %p destroyed", this));
|
("DOMWINDOW %p destroyed", this));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (IsOuterWindow()) {
|
if (IsOuterWindow()) {
|
||||||
JSObject *proxy = GetWrapperPreserveColor();
|
JSObject *proxy = GetWrapperPreserveColor();
|
||||||
|
@ -2812,7 +2804,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
|
||||||
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
|
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
|
||||||
MOZ_ASSERT(aDocument);
|
MOZ_ASSERT(aDocument);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
nsIURI *uri = aDocument->GetDocumentURI();
|
nsIURI *uri = aDocument->GetDocumentURI();
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
|
@ -2820,7 +2811,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
|
||||||
uri->GetSpec(spec);
|
uri->GetSpec(spec);
|
||||||
PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get());
|
PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mDoc = aDocument;
|
mDoc = aDocument;
|
||||||
ClearDocumentDependentSlots(aCx);
|
ClearDocumentDependentSlots(aCx);
|
||||||
|
@ -10568,11 +10558,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSessionStorage) {
|
if (mSessionStorage) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
|
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
bool canAccess = mSessionStorage->CanAccess(principal);
|
bool canAccess = mSessionStorage->CanAccess(principal);
|
||||||
NS_ASSERTION(canAccess,
|
NS_ASSERTION(canAccess,
|
||||||
"This window owned sessionStorage "
|
"This window owned sessionStorage "
|
||||||
|
@ -10621,11 +10609,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
|
||||||
mSessionStorage = static_cast<DOMStorage*>(storage.get());
|
mSessionStorage = static_cast<DOMStorage*>(storage.get());
|
||||||
MOZ_ASSERT(mSessionStorage);
|
MOZ_ASSERT(mSessionStorage);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
|
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!mSessionStorage) {
|
if (!mSessionStorage) {
|
||||||
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||||
|
@ -10633,11 +10619,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
|
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return mSessionStorage;
|
return mSessionStorage;
|
||||||
}
|
}
|
||||||
|
@ -11553,12 +11537,10 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
|
||||||
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
|
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
|
||||||
this, mSessionStorage.get(), changingStorage.get());
|
this, mSessionStorage.get(), changingStorage.get());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
fireMozStorageChanged = mSessionStorage == changingStorage;
|
fireMozStorageChanged = mSessionStorage == changingStorage;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -36,9 +36,7 @@ using mozilla::dom::NodeInfo;
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gNodeInfoManagerLeakPRLog;
|
static PRLogModuleInfo* gNodeInfoManagerLeakPRLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
PLHashNumber
|
PLHashNumber
|
||||||
nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
|
nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
|
||||||
|
@ -117,14 +115,12 @@ nsNodeInfoManager::nsNodeInfoManager()
|
||||||
{
|
{
|
||||||
nsLayoutStatics::AddRef();
|
nsLayoutStatics::AddRef();
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gNodeInfoManagerLeakPRLog)
|
if (!gNodeInfoManagerLeakPRLog)
|
||||||
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
|
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
|
||||||
|
|
||||||
if (gNodeInfoManagerLeakPRLog)
|
if (gNodeInfoManagerLeakPRLog)
|
||||||
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
||||||
("NODEINFOMANAGER %p created", this));
|
("NODEINFOMANAGER %p created", this));
|
||||||
#endif
|
|
||||||
|
|
||||||
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
|
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
|
||||||
NodeInfoInnerKeyCompare,
|
NodeInfoInnerKeyCompare,
|
||||||
|
@ -142,11 +138,9 @@ nsNodeInfoManager::~nsNodeInfoManager()
|
||||||
|
|
||||||
mBindingManager = nullptr;
|
mBindingManager = nullptr;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gNodeInfoManagerLeakPRLog)
|
if (gNodeInfoManagerLeakPRLog)
|
||||||
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
||||||
("NODEINFOMANAGER %p destroyed", this));
|
("NODEINFOMANAGER %p destroyed", this));
|
||||||
#endif
|
|
||||||
|
|
||||||
nsLayoutStatics::Release();
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
@ -201,11 +195,9 @@ nsNodeInfoManager::Init(nsIDocument *aDocument)
|
||||||
|
|
||||||
mDocument = aDocument;
|
mDocument = aDocument;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (gNodeInfoManagerLeakPRLog)
|
if (gNodeInfoManagerLeakPRLog)
|
||||||
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
|
||||||
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
|
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
|
||||||
#endif
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,6 @@ static const char *kPrefJavaMIME = "plugin.java.mime";
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo*
|
static PRLogModuleInfo*
|
||||||
GetObjectLog()
|
GetObjectLog()
|
||||||
{
|
{
|
||||||
|
@ -115,7 +114,6 @@ GetObjectLog()
|
||||||
sLog = PR_NewLogModule("objlc");
|
sLog = PR_NewLogModule("objlc");
|
||||||
return sLog;
|
return sLog;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LOG(args) PR_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
|
#define LOG(args) PR_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
|
||||||
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
|
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)
|
||||||
|
|
|
@ -54,9 +54,7 @@
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/unused.h"
|
#include "mozilla/unused.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gCspPRLog;
|
static PRLogModuleInfo* gCspPRLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
@ -109,10 +107,8 @@ nsScriptLoader::nsScriptLoader(nsIDocument *aDocument)
|
||||||
mBlockingDOMContentLoaded(false)
|
mBlockingDOMContentLoaded(false)
|
||||||
{
|
{
|
||||||
// enable logging for CSP
|
// enable logging for CSP
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gCspPRLog)
|
if (!gCspPRLog)
|
||||||
gCspPRLog = PR_NewLogModule("CSP");
|
gCspPRLog = PR_NewLogModule("CSP");
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsScriptLoader::~nsScriptLoader()
|
nsScriptLoader::~nsScriptLoader()
|
||||||
|
|
|
@ -17,12 +17,8 @@
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetCameraLog();
|
extern PRLogModuleInfo* GetCameraLog();
|
||||||
#define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
|
#define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
|
||||||
#else
|
|
||||||
#define DOM_CAMERA_LOG( type, ... )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
|
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
|
||||||
|
|
||||||
|
@ -42,16 +38,12 @@ enum {
|
||||||
* DOM_CAMERA_LOGR() can be called before 'gCameraLog' is set, so
|
* DOM_CAMERA_LOGR() can be called before 'gCameraLog' is set, so
|
||||||
* we need to handle this one a little differently.
|
* we need to handle this one a little differently.
|
||||||
*/
|
*/
|
||||||
#ifdef PR_LOGGING
|
|
||||||
#define DOM_CAMERA_LOGR( ... ) \
|
#define DOM_CAMERA_LOGR( ... ) \
|
||||||
do { \
|
do { \
|
||||||
if (GetCameraLog()) { \
|
if (GetCameraLog()) { \
|
||||||
DOM_CAMERA_LOG( DOM_CAMERA_LOG_REFERENCES, __VA_ARGS__ ); \
|
DOM_CAMERA_LOG( DOM_CAMERA_LOG_REFERENCES, __VA_ARGS__ ); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
|
||||||
#define DOM_CAMERA_LOGR( ... )
|
|
||||||
#endif
|
|
||||||
#define DOM_CAMERA_LOGT( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_TRACE, __VA_ARGS__ )
|
#define DOM_CAMERA_LOGT( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_TRACE, __VA_ARGS__ )
|
||||||
#define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ )
|
#define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ )
|
||||||
#define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ )
|
#define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ )
|
||||||
|
|
|
@ -92,7 +92,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
const char* state[] = { "uninitialized", "closed", "open", "failed" };
|
const char* state[] = { "uninitialized", "closed", "open", "failed" };
|
||||||
MOZ_ASSERT(aNewState >= 0);
|
MOZ_ASSERT(aNewState >= 0);
|
||||||
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
|
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
|
||||||
|
@ -101,7 +100,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
|
||||||
} else {
|
} else {
|
||||||
DOM_CAMERA_LOGE("OnHardwareStateChange: got invalid HardwareState value %d\n", aNewState);
|
DOM_CAMERA_LOGE("OnHardwareStateChange: got invalid HardwareState value %d\n", aNewState);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mHardwareState = aNewState;
|
mHardwareState = aNewState;
|
||||||
mHardwareStateChangeReason = aReason;
|
mHardwareStateChangeReason = aReason;
|
||||||
|
@ -221,7 +219,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
const char* state[] = { "stopped", "paused", "started" };
|
const char* state[] = { "stopped", "paused", "started" };
|
||||||
MOZ_ASSERT(aNewState >= 0);
|
MOZ_ASSERT(aNewState >= 0);
|
||||||
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
|
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
|
||||||
|
@ -229,7 +226,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
|
||||||
} else {
|
} else {
|
||||||
DOM_CAMERA_LOGE("OnPreviewStateChange: got unknown PreviewState value %d\n", aNewState);
|
DOM_CAMERA_LOGE("OnPreviewStateChange: got unknown PreviewState value %d\n", aNewState);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mPreviewState = aNewState;
|
mPreviewState = aNewState;
|
||||||
|
|
||||||
|
@ -280,7 +276,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
|
||||||
// the Camera Thread.
|
// the Camera Thread.
|
||||||
RwLockAutoEnterRead lock(mListenerLock);
|
RwLockAutoEnterRead lock(mListenerLock);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
const char* context[] = {
|
const char* context[] = {
|
||||||
"StartCamera",
|
"StartCamera",
|
||||||
"StopCamera",
|
"StopCamera",
|
||||||
|
@ -305,7 +300,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
|
||||||
DOM_CAMERA_LOGE("CameraControlImpl::OnUserError : aContext=%d, aError=0x%x\n",
|
DOM_CAMERA_LOGE("CameraControlImpl::OnUserError : aContext=%d, aError=0x%x\n",
|
||||||
aContext, aError);
|
aContext, aError);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
|
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
|
||||||
CameraControlListener* l = mListeners[i];
|
CameraControlListener* l = mListeners[i];
|
||||||
|
@ -321,7 +315,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
|
||||||
// the Camera Thread.
|
// the Camera Thread.
|
||||||
RwLockAutoEnterRead lock(mListenerLock);
|
RwLockAutoEnterRead lock(mListenerLock);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
const char* context[] = {
|
const char* context[] = {
|
||||||
"Camera Service"
|
"Camera Service"
|
||||||
};
|
};
|
||||||
|
@ -332,7 +325,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
|
||||||
DOM_CAMERA_LOGE("CameraControlImpl::OnSystemError : aContext=%d, aError=0x%x\n",
|
DOM_CAMERA_LOGE("CameraControlImpl::OnSystemError : aContext=%d, aError=0x%x\n",
|
||||||
aContext, aError);
|
aContext, aError);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
|
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
|
||||||
CameraControlListener* l = mListeners[i];
|
CameraControlListener* l = mListeners[i];
|
||||||
|
|
|
@ -2246,12 +2246,7 @@ OnSystemError(nsGonkCameraControl* gc,
|
||||||
CameraControlListener::SystemContext aWhere,
|
CameraControlListener::SystemContext aWhere,
|
||||||
int32_t aArg1, int32_t aArg2)
|
int32_t aArg1, int32_t aArg2)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
DOM_CAMERA_LOGE("OnSystemError : aWhere=%d, aArg1=%d, aArg2=%d\n", aWhere, aArg1, aArg2);
|
DOM_CAMERA_LOGE("OnSystemError : aWhere=%d, aArg1=%d, aArg2=%d\n", aWhere, aArg1, aArg2);
|
||||||
#else
|
|
||||||
unused << aArg1;
|
|
||||||
unused << aArg2;
|
|
||||||
#endif
|
|
||||||
gc->OnSystemError(aWhere, NS_ERROR_FAILURE);
|
gc->OnSystemError(aWhere, NS_ERROR_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ namespace mozilla {
|
||||||
using namespace dom;
|
using namespace dom;
|
||||||
using namespace widget;
|
using namespace widget;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
/**
|
/**
|
||||||
* When a method is called, log its arguments and/or related static variables
|
* When a method is called, log its arguments and/or related static variables
|
||||||
* with PR_LOG_ALWAYS. However, if it puts too many logs like
|
* with PR_LOG_ALWAYS. However, if it puts too many logs like
|
||||||
|
@ -177,7 +176,6 @@ GetNotifyIMEMessageName(IMEMessage aMessage)
|
||||||
return "unacceptable IME notification message";
|
return "unacceptable IME notification message";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // #ifdef PR_LOGGING
|
|
||||||
|
|
||||||
nsIContent* IMEStateManager::sContent = nullptr;
|
nsIContent* IMEStateManager::sContent = nullptr;
|
||||||
nsPresContext* IMEStateManager::sPresContext = nullptr;
|
nsPresContext* IMEStateManager::sPresContext = nullptr;
|
||||||
|
@ -194,11 +192,9 @@ TextCompositionArray* IMEStateManager::sTextCompositions = nullptr;
|
||||||
void
|
void
|
||||||
IMEStateManager::Init()
|
IMEStateManager::Init()
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!sISMLog) {
|
if (!sISMLog) {
|
||||||
sISMLog = PR_NewLogModule("IMEStateManager");
|
sISMLog = PR_NewLogModule("IMEStateManager");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@ -232,7 +228,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
|
||||||
// there should be only one composition per presContext object.
|
// there should be only one composition per presContext object.
|
||||||
sTextCompositions->ElementAt(i)->Destroy();
|
sTextCompositions->ElementAt(i)->Destroy();
|
||||||
sTextCompositions->RemoveElementAt(i);
|
sTextCompositions->RemoveElementAt(i);
|
||||||
#if defined DEBUG || PR_LOGGING
|
|
||||||
if (sTextCompositions->IndexOf(aPresContext) !=
|
if (sTextCompositions->IndexOf(aPresContext) !=
|
||||||
TextCompositionArray::NoIndex) {
|
TextCompositionArray::NoIndex) {
|
||||||
PR_LOG(sISMLog, PR_LOG_ERROR,
|
PR_LOG(sISMLog, PR_LOG_ERROR,
|
||||||
|
@ -240,7 +235,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
|
||||||
"TextComposition instance from the array"));
|
"TextComposition instance from the array"));
|
||||||
MOZ_CRASH("Failed to remove TextComposition instance from the array");
|
MOZ_CRASH("Failed to remove TextComposition instance from the array");
|
||||||
}
|
}
|
||||||
#endif // #if defined DEBUG || PR_LOGGING
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,7 +507,6 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
||||||
bool consumed =
|
bool consumed =
|
||||||
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
|
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsAutoString eventType;
|
nsAutoString eventType;
|
||||||
aMouseEvent->GetType(eventType);
|
aMouseEvent->GetType(eventType);
|
||||||
PR_LOG(sISMLog, PR_LOG_ALWAYS,
|
PR_LOG(sISMLog, PR_LOG_ALWAYS,
|
||||||
|
@ -521,7 +514,6 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
|
||||||
"mouse event (type=%s, button=%d) is %s",
|
"mouse event (type=%s, button=%d) is %s",
|
||||||
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
|
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
|
||||||
consumed ? "consumed" : "not consumed"));
|
consumed ? "consumed" : "not consumed"));
|
||||||
#endif
|
|
||||||
|
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,15 +92,10 @@
|
||||||
#include "nsRange.h"
|
#include "nsRange.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gMediaElementLog;
|
static PRLogModuleInfo* gMediaElementLog;
|
||||||
static PRLogModuleInfo* gMediaElementEventsLog;
|
static PRLogModuleInfo* gMediaElementEventsLog;
|
||||||
#define LOG(type, msg) PR_LOG(gMediaElementLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gMediaElementLog, type, msg)
|
||||||
#define LOG_EVENT(type, msg) PR_LOG(gMediaElementEventsLog, type, msg)
|
#define LOG_EVENT(type, msg) PR_LOG(gMediaElementEventsLog, type, msg)
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#define LOG_EVENT(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nsIContentSecurityPolicy.h"
|
#include "nsIContentSecurityPolicy.h"
|
||||||
|
|
||||||
|
@ -2094,14 +2089,12 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||||
mDisableVideo(false),
|
mDisableVideo(false),
|
||||||
mElementInTreeState(ELEMENT_NOT_INTREE)
|
mElementInTreeState(ELEMENT_NOT_INTREE)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaElementLog) {
|
if (!gMediaElementLog) {
|
||||||
gMediaElementLog = PR_NewLogModule("nsMediaElement");
|
gMediaElementLog = PR_NewLogModule("nsMediaElement");
|
||||||
}
|
}
|
||||||
if (!gMediaElementEventsLog) {
|
if (!gMediaElementEventsLog) {
|
||||||
gMediaElementEventsLog = PR_NewLogModule("nsMediaElementEvents");
|
gMediaElementEventsLog = PR_NewLogModule("nsMediaElementEvents");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mAudioChannel = AudioChannelService::GetDefaultAudioChannel();
|
mAudioChannel = AudioChannelService::GetDefaultAudioChannel();
|
||||||
|
|
||||||
|
@ -3597,7 +3590,6 @@ HTMLMediaElement::UpdateReadyStateInternal()
|
||||||
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA);
|
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static const char* const gReadyStateToString[] = {
|
static const char* const gReadyStateToString[] = {
|
||||||
"HAVE_NOTHING",
|
"HAVE_NOTHING",
|
||||||
"HAVE_METADATA",
|
"HAVE_METADATA",
|
||||||
|
@ -3605,7 +3597,6 @@ static const char* const gReadyStateToString[] = {
|
||||||
"HAVE_FUTURE_DATA",
|
"HAVE_FUTURE_DATA",
|
||||||
"HAVE_ENOUGH_DATA"
|
"HAVE_ENOUGH_DATA"
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
|
void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
|
||||||
{
|
{
|
||||||
|
@ -3657,14 +3648,12 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static const char* const gNetworkStateToString[] = {
|
static const char* const gNetworkStateToString[] = {
|
||||||
"EMPTY",
|
"EMPTY",
|
||||||
"IDLE",
|
"IDLE",
|
||||||
"LOADING",
|
"LOADING",
|
||||||
"NO_SOURCE"
|
"NO_SOURCE"
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
|
void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,12 +40,8 @@
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsVideoFrame.h"
|
#include "nsVideoFrame.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static PRLogModuleInfo* gTrackElementLog;
|
static PRLogModuleInfo* gTrackElementLog;
|
||||||
#define LOG(type, msg) PR_LOG(gTrackElementLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gTrackElementLog, type, msg)
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
|
// Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
|
||||||
// we can return an UnknownElement instead when pref'd off.
|
// we can return an UnknownElement instead when pref'd off.
|
||||||
|
@ -80,11 +76,9 @@ static MOZ_CONSTEXPR const char* kKindTableDefaultString = kKindTable->tag;
|
||||||
HTMLTrackElement::HTMLTrackElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
HTMLTrackElement::HTMLTrackElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
||||||
: nsGenericHTMLElement(aNodeInfo)
|
: nsGenericHTMLElement(aNodeInfo)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gTrackElementLog) {
|
if (!gTrackElementLog) {
|
||||||
gTrackElementLog = PR_NewLogModule("nsTrackElement");
|
gTrackElementLog = PR_NewLogModule("nsTrackElement");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLTrackElement::~HTMLTrackElement()
|
HTMLTrackElement::~HTMLTrackElement()
|
||||||
|
|
|
@ -69,8 +69,7 @@
|
||||||
fmt "\n", \
|
fmt "\n", \
|
||||||
NameWithComma().get(), \
|
NameWithComma().get(), \
|
||||||
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__)
|
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
#elif defined(PR_LOGGING)
|
|
||||||
static PRLogModuleInfo*
|
static PRLogModuleInfo*
|
||||||
GetPPMLog()
|
GetPPMLog()
|
||||||
{
|
{
|
||||||
|
@ -87,9 +86,6 @@
|
||||||
("ProcessPriorityManager[%schild-id=%" PRIu64 ", pid=%d] - " fmt, \
|
("ProcessPriorityManager[%schild-id=%" PRIu64 ", pid=%d] - " fmt, \
|
||||||
NameWithComma().get(), \
|
NameWithComma().get(), \
|
||||||
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__))
|
static_cast<uint64_t>(ChildID()), Pid(), ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(fmt, ...)
|
|
||||||
#define LOGP(fmt, ...)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
|
@ -10,16 +10,11 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define SINK_LOG(msg, ...) \
|
#define SINK_LOG(msg, ...) \
|
||||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
||||||
#define SINK_LOG_V(msg, ...) \
|
#define SINK_LOG_V(msg, ...) \
|
||||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define SINK_LOG(msg, ...)
|
|
||||||
#define SINK_LOG_V(msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AudioSink::OnAudioEndTimeUpdateTask::OnAudioEndTimeUpdateTask(
|
AudioSink::OnAudioEndTimeUpdateTask::OnAudioEndTimeUpdateTask(
|
||||||
MediaDecoderStateMachine* aStateMachine)
|
MediaDecoderStateMachine* aStateMachine)
|
||||||
|
|
|
@ -28,13 +28,9 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gAudioStreamLog = nullptr;
|
PRLogModuleInfo* gAudioStreamLog = nullptr;
|
||||||
// For simple logs
|
// For simple logs
|
||||||
#define LOG(x) PR_LOG(gAudioStreamLog, PR_LOG_DEBUG, x)
|
#define LOG(x) PR_LOG(gAudioStreamLog, PR_LOG_DEBUG, x)
|
||||||
#else
|
|
||||||
#define LOG(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When MOZ_DUMP_AUDIO is set in the environment (to anything),
|
* When MOZ_DUMP_AUDIO is set in the environment (to anything),
|
||||||
|
@ -1071,11 +1067,8 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
|
||||||
// we start getting callbacks.
|
// we start getting callbacks.
|
||||||
// Simple version - contract on first callback only.
|
// Simple version - contract on first callback only.
|
||||||
if (mLatencyRequest == LowLatency) {
|
if (mLatencyRequest == LowLatency) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
uint32_t old_len = mBuffer.Length();
|
uint32_t old_len = mBuffer.Length();
|
||||||
#endif
|
|
||||||
available = mBuffer.ContractTo(FramesToBytes(aFrames));
|
available = mBuffer.ContractTo(FramesToBytes(aFrames));
|
||||||
#ifdef PR_LOGGING
|
|
||||||
TimeStamp now = TimeStamp::Now();
|
TimeStamp now = TimeStamp::Now();
|
||||||
if (!mStartTime.IsNull()) {
|
if (!mStartTime.IsNull()) {
|
||||||
int64_t timeMs = (now - mStartTime).ToMilliseconds();
|
int64_t timeMs = (now - mStartTime).ToMilliseconds();
|
||||||
|
@ -1093,7 +1086,6 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
|
||||||
mReadPoint, BytesToFrames(old_len - available), mOutRate));
|
mReadPoint, BytesToFrames(old_len - available), mOutRate));
|
||||||
mReadPoint += BytesToFrames(old_len - available);
|
mReadPoint += BytesToFrames(old_len - available);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
mState = RUNNING;
|
mState = RUNNING;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,9 +126,7 @@ bool CubebLatencyPrefSet()
|
||||||
|
|
||||||
void InitLibrary()
|
void InitLibrary()
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
gAudioStreamLog = PR_NewLogModule("AudioStream");
|
gAudioStreamLog = PR_NewLogModule("AudioStream");
|
||||||
#endif
|
|
||||||
PrefChanged(PREF_VOLUME_SCALE, nullptr);
|
PrefChanged(PREF_VOLUME_SCALE, nullptr);
|
||||||
Preferences::RegisterCallback(PrefChanged, PREF_VOLUME_SCALE);
|
Preferences::RegisterCallback(PrefChanged, PREF_VOLUME_SCALE);
|
||||||
PrefChanged(PREF_CUBEB_LATENCY, nullptr);
|
PrefChanged(PREF_CUBEB_LATENCY, nullptr);
|
||||||
|
|
|
@ -10,12 +10,8 @@
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
||||||
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
||||||
#else
|
|
||||||
#define STREAM_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// We don't use NSPR log here because we want this interleaved with adb logcat
|
// We don't use NSPR log here because we want this interleaved with adb logcat
|
||||||
// on Android/B2G
|
// on Android/B2G
|
||||||
|
|
|
@ -24,12 +24,8 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaCacheLog;
|
PRLogModuleInfo* gMediaCacheLog;
|
||||||
#define CACHE_LOG(type, msg) PR_LOG(gMediaCacheLog, type, msg)
|
#define CACHE_LOG(type, msg) PR_LOG(gMediaCacheLog, type, msg)
|
||||||
#else
|
|
||||||
#define CACHE_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Readahead blocks for non-seekable streams will be limited to this
|
// Readahead blocks for non-seekable streams will be limited to this
|
||||||
// fraction of the cache space. We don't normally evict such blocks
|
// fraction of the cache space. We don't normally evict such blocks
|
||||||
|
@ -587,11 +583,9 @@ MediaCache::Init()
|
||||||
rv = mFileCache->Open(fileDesc);
|
rv = mFileCache->Open(fileDesc);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaCacheLog) {
|
if (!gMediaCacheLog) {
|
||||||
gMediaCacheLog = PR_NewLogModule("MediaCache");
|
gMediaCacheLog = PR_NewLogModule("MediaCache");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
MediaCacheFlusher::Init();
|
MediaCacheFlusher::Init();
|
||||||
|
|
||||||
|
|
|
@ -52,13 +52,9 @@ static const int64_t CAN_PLAY_THROUGH_MARGIN = 1;
|
||||||
// avoid redefined macro in unified build
|
// avoid redefined macro in unified build
|
||||||
#undef DECODER_LOG
|
#undef DECODER_LOG
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaDecoderLog;
|
PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define DECODER_LOG(x, ...) \
|
#define DECODER_LOG(x, ...) \
|
||||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, this, ##__VA_ARGS__))
|
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, this, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define DECODER_LOG(x, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char* const gPlayStateStr[] = {
|
static const char* const gPlayStateStr[] = {
|
||||||
"START",
|
"START",
|
||||||
|
|
|
@ -20,13 +20,9 @@ namespace mozilla {
|
||||||
// Un-comment to enable logging of seek bisections.
|
// Un-comment to enable logging of seek bisections.
|
||||||
//#define SEEK_LOGGING
|
//#define SEEK_LOGGING
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define DECODER_LOG(x, ...) \
|
#define DECODER_LOG(x, ...) \
|
||||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
|
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define DECODER_LOG(x, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Same workaround as MediaDecoderStateMachine.cpp.
|
// Same workaround as MediaDecoderStateMachine.cpp.
|
||||||
#define DECODER_WARN_HELPER(a, b) NS_WARNING b
|
#define DECODER_WARN_HELPER(a, b) NS_WARNING b
|
||||||
|
|
|
@ -54,7 +54,6 @@ using namespace mozilla::gfx;
|
||||||
#undef DECODER_LOG
|
#undef DECODER_LOG
|
||||||
#undef VERBOSE_LOG
|
#undef VERBOSE_LOG
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
extern PRLogModuleInfo* gMediaSampleLog;
|
extern PRLogModuleInfo* gMediaSampleLog;
|
||||||
#define LOG(m, l, x, ...) \
|
#define LOG(m, l, x, ...) \
|
||||||
|
@ -65,11 +64,6 @@ extern PRLogModuleInfo* gMediaSampleLog;
|
||||||
LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__)
|
LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__)
|
||||||
#define SAMPLE_LOG(x, ...) \
|
#define SAMPLE_LOG(x, ...) \
|
||||||
LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
|
LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define DECODER_LOG(x, ...)
|
|
||||||
#define VERBOSE_LOG(x, ...)
|
|
||||||
#define SAMPLE_LOG(x, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Somehow MSVC doesn't correctly delete the comma before ##__VA_ARGS__
|
// Somehow MSVC doesn't correctly delete the comma before ##__VA_ARGS__
|
||||||
// when __VA_ARGS__ expands to nothing. This is a workaround for it.
|
// when __VA_ARGS__ expands to nothing. This is a workaround for it.
|
||||||
|
@ -2915,17 +2909,13 @@ void MediaDecoderStateMachine::AdvanceFrame()
|
||||||
nsRefPtr<VideoData> currentFrame;
|
nsRefPtr<VideoData> currentFrame;
|
||||||
if (VideoQueue().GetSize() > 0) {
|
if (VideoQueue().GetSize() > 0) {
|
||||||
VideoData* frame = VideoQueue().PeekFront();
|
VideoData* frame = VideoQueue().PeekFront();
|
||||||
#ifdef PR_LOGGING
|
|
||||||
int32_t droppedFrames = 0;
|
int32_t droppedFrames = 0;
|
||||||
#endif
|
|
||||||
while (IsRealTime() || clock_time >= frame->mTime) {
|
while (IsRealTime() || clock_time >= frame->mTime) {
|
||||||
mVideoFrameEndTime = frame->GetEndTime();
|
mVideoFrameEndTime = frame->GetEndTime();
|
||||||
if (currentFrame) {
|
if (currentFrame) {
|
||||||
mDecoder->NotifyDecodedFrames(0, 0, 1);
|
mDecoder->NotifyDecodedFrames(0, 0, 1);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
VERBOSE_LOG("discarding video frame mTime=%lld clock_time=%lld (%d so far)",
|
VERBOSE_LOG("discarding video frame mTime=%lld clock_time=%lld (%d so far)",
|
||||||
currentFrame->mTime, clock_time, ++droppedFrames);
|
currentFrame->mTime, clock_time, ++droppedFrames);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
currentFrame = frame;
|
currentFrame = frame;
|
||||||
nsRefPtr<VideoData> releaseMe = PopVideo();
|
nsRefPtr<VideoData> releaseMe = PopVideo();
|
||||||
|
@ -3249,12 +3239,10 @@ void MediaDecoderStateMachine::StartBuffering()
|
||||||
SetState(DECODER_STATE_BUFFERING);
|
SetState(DECODER_STATE_BUFFERING);
|
||||||
DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs",
|
DECODER_LOG("Changed state from DECODING to BUFFERING, decoded for %.3lfs",
|
||||||
decodeDuration.ToSeconds());
|
decodeDuration.ToSeconds());
|
||||||
#ifdef PR_LOGGING
|
|
||||||
MediaDecoder::Statistics stats = mDecoder->GetStatistics();
|
MediaDecoder::Statistics stats = mDecoder->GetStatistics();
|
||||||
DECODER_LOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s",
|
DECODER_LOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s",
|
||||||
stats.mPlaybackRate/1024, stats.mPlaybackRateReliable ? "" : " (unreliable)",
|
stats.mPlaybackRate/1024, stats.mPlaybackRateReliable ? "" : " (unreliable)",
|
||||||
stats.mDownloadRate/1024, stats.mDownloadRateReliable ? "" : " (unreliable)");
|
stats.mDownloadRate/1024, stats.mDownloadRateReliable ? "" : " (unreliable)");
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaDecoderStateMachine::SetPlayStartTime(const TimeStamp& aTimeStamp)
|
void MediaDecoderStateMachine::SetPlayStartTime(const TimeStamp& aTimeStamp)
|
||||||
|
|
|
@ -103,7 +103,6 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo*
|
PRLogModuleInfo*
|
||||||
GetMediaManagerLog()
|
GetMediaManagerLog()
|
||||||
{
|
{
|
||||||
|
@ -113,9 +112,6 @@ GetMediaManagerLog()
|
||||||
return sLog;
|
return sLog;
|
||||||
}
|
}
|
||||||
#define LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
|
#define LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
|
||||||
#else
|
|
||||||
#define LOG(msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using dom::MediaStreamConstraints;
|
using dom::MediaStreamConstraints;
|
||||||
using dom::MediaTrackConstraintSet;
|
using dom::MediaTrackConstraintSet;
|
||||||
|
|
|
@ -48,12 +48,8 @@ struct MediaStreamConstraints;
|
||||||
struct MediaTrackConstraintSet;
|
struct MediaTrackConstraintSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaManagerLog();
|
extern PRLogModuleInfo* GetMediaManagerLog();
|
||||||
#define MM_LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
|
#define MM_LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
|
||||||
#else
|
|
||||||
#define MM_LOG(msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an implementation of MediaStreamListener. This is used
|
* This class is an implementation of MediaStreamListener. This is used
|
||||||
|
|
|
@ -31,12 +31,8 @@
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaRecorderLog;
|
PRLogModuleInfo* gMediaRecorderLog;
|
||||||
#define LOG(type, msg) PR_LOG(gMediaRecorderLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gMediaRecorderLog, type, msg)
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
@ -759,11 +755,9 @@ MediaRecorder::MediaRecorder(DOMMediaStream& aSourceMediaStream,
|
||||||
MOZ_ASSERT(aOwnerWindow);
|
MOZ_ASSERT(aOwnerWindow);
|
||||||
MOZ_ASSERT(aOwnerWindow->IsInnerWindow());
|
MOZ_ASSERT(aOwnerWindow->IsInnerWindow());
|
||||||
mDOMStream = &aSourceMediaStream;
|
mDOMStream = &aSourceMediaStream;
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaRecorderLog) {
|
if (!gMediaRecorderLog) {
|
||||||
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
|
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
RegisterActivityObserver();
|
RegisterActivityObserver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,11 +786,9 @@ MediaRecorder::MediaRecorder(AudioNode& aSrcAudioNode,
|
||||||
aSrcOutput);
|
aSrcOutput);
|
||||||
}
|
}
|
||||||
mAudioNode = &aSrcAudioNode;
|
mAudioNode = &aSrcAudioNode;
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaRecorderLog) {
|
if (!gMediaRecorderLog) {
|
||||||
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
|
gMediaRecorderLog = PR_NewLogModule("MediaRecorder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
RegisterActivityObserver();
|
RegisterActivityObserver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,17 +33,12 @@
|
||||||
#include "nsProxyRelease.h"
|
#include "nsProxyRelease.h"
|
||||||
#include "nsIContentPolicy.h"
|
#include "nsIContentPolicy.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaResourceLog;
|
PRLogModuleInfo* gMediaResourceLog;
|
||||||
#define RESOURCE_LOG(msg, ...) PR_LOG(gMediaResourceLog, PR_LOG_DEBUG, \
|
#define RESOURCE_LOG(msg, ...) PR_LOG(gMediaResourceLog, PR_LOG_DEBUG, \
|
||||||
(msg, ##__VA_ARGS__))
|
(msg, ##__VA_ARGS__))
|
||||||
// Debug logging macro with object pointer and class name.
|
// Debug logging macro with object pointer and class name.
|
||||||
#define CMLOG(msg, ...) \
|
#define CMLOG(msg, ...) \
|
||||||
RESOURCE_LOG("%p [ChannelMediaResource]: " msg, this, ##__VA_ARGS__)
|
RESOURCE_LOG("%p [ChannelMediaResource]: " msg, this, ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define RESOURCE_LOG(msg, ...)
|
|
||||||
#define CMLOG(msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const uint32_t HTTP_OK_CODE = 200;
|
static const uint32_t HTTP_OK_CODE = 200;
|
||||||
static const uint32_t HTTP_PARTIAL_RESPONSE_CODE = 206;
|
static const uint32_t HTTP_PARTIAL_RESPONSE_CODE = 206;
|
||||||
|
@ -85,11 +80,9 @@ ChannelMediaResource::ChannelMediaResource(MediaDecoder* aDecoder,
|
||||||
mIgnoreResume(false),
|
mIgnoreResume(false),
|
||||||
mIsTransportSeekable(true)
|
mIsTransportSeekable(true)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaResourceLog) {
|
if (!gMediaResourceLog) {
|
||||||
gMediaResourceLog = PR_NewLogModule("MediaResource");
|
gMediaResourceLog = PR_NewLogModule("MediaResource");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ChannelMediaResource::~ChannelMediaResource()
|
ChannelMediaResource::~ChannelMediaResource()
|
||||||
|
|
|
@ -13,12 +13,8 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
||||||
#else
|
|
||||||
#define DECODER_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(MediaShutdownManager, nsIObserver)
|
NS_IMPL_ISUPPORTS(MediaShutdownManager, nsIObserver)
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,8 @@ using namespace mozilla::gfx;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaStreamGraphLog;
|
PRLogModuleInfo* gMediaStreamGraphLog;
|
||||||
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
||||||
#else
|
|
||||||
#define STREAM_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #define ENABLE_LIFECYCLE_LOG
|
// #define ENABLE_LIFECYCLE_LOG
|
||||||
|
|
||||||
|
@ -2968,11 +2964,9 @@ MediaStreamGraphImpl::MediaStreamGraphImpl(bool aRealtime,
|
||||||
#endif
|
#endif
|
||||||
, mAudioChannel(static_cast<uint32_t>(aChannel))
|
, mAudioChannel(static_cast<uint32_t>(aChannel))
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaStreamGraphLog) {
|
if (!gMediaStreamGraphLog) {
|
||||||
gMediaStreamGraphLog = PR_NewLogModule("MediaStreamGraph");
|
gMediaStreamGraphLog = PR_NewLogModule("MediaStreamGraph");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mRealtime) {
|
if (mRealtime) {
|
||||||
if (aStartWithAudioDriver) {
|
if (aStartWithAudioDriver) {
|
||||||
|
|
|
@ -35,9 +35,7 @@ class nsAutoRefTraits<SpeexResamplerState> : public nsPointerRefTraits<SpeexResa
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MediaStreamGraph is a framework for synchronized audio/video processing
|
* MediaStreamGraph is a framework for synchronized audio/video processing
|
||||||
|
|
|
@ -20,17 +20,12 @@
|
||||||
#endif
|
#endif
|
||||||
using namespace mozilla::net;
|
using namespace mozilla::net;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gRtspMediaResourceLog;
|
PRLogModuleInfo* gRtspMediaResourceLog;
|
||||||
#define RTSP_LOG(msg, ...) PR_LOG(gRtspMediaResourceLog, PR_LOG_DEBUG, \
|
#define RTSP_LOG(msg, ...) PR_LOG(gRtspMediaResourceLog, PR_LOG_DEBUG, \
|
||||||
(msg, ##__VA_ARGS__))
|
(msg, ##__VA_ARGS__))
|
||||||
// Debug logging macro with object pointer and class name.
|
// Debug logging macro with object pointer and class name.
|
||||||
#define RTSPMLOG(msg, ...) \
|
#define RTSPMLOG(msg, ...) \
|
||||||
RTSP_LOG("%p [RtspMediaResource]: " msg, this, ##__VA_ARGS__)
|
RTSP_LOG("%p [RtspMediaResource]: " msg, this, ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define RTSP_LOG(msg, ...)
|
|
||||||
#define RTSPMLOG(msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
@ -509,12 +504,10 @@ RtspMediaResource::RtspMediaResource(MediaDecoder* aDecoder,
|
||||||
MOZ_ASSERT(mMediaStreamController);
|
MOZ_ASSERT(mMediaStreamController);
|
||||||
mListener = new Listener(this);
|
mListener = new Listener(this);
|
||||||
mMediaStreamController->AsyncOpen(mListener);
|
mMediaStreamController->AsyncOpen(mListener);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gRtspMediaResourceLog) {
|
if (!gRtspMediaResourceLog) {
|
||||||
gRtspMediaResourceLog = PR_NewLogModule("RtspMediaResource");
|
gRtspMediaResourceLog = PR_NewLogModule("RtspMediaResource");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RtspMediaResource::~RtspMediaResource()
|
RtspMediaResource::~RtspMediaResource()
|
||||||
|
|
|
@ -9,12 +9,8 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
extern PRLogModuleInfo* gMediaStreamGraphLog;
|
||||||
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
#define STREAM_LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
|
||||||
#else
|
|
||||||
#define STREAM_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void
|
void
|
||||||
|
|
|
@ -42,21 +42,15 @@ namespace mozilla {
|
||||||
#undef STREAM_LOG
|
#undef STREAM_LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gTrackUnionStreamLog;
|
PRLogModuleInfo* gTrackUnionStreamLog;
|
||||||
#define STREAM_LOG(type, msg) PR_LOG(gTrackUnionStreamLog, type, msg)
|
#define STREAM_LOG(type, msg) PR_LOG(gTrackUnionStreamLog, type, msg)
|
||||||
#else
|
|
||||||
#define STREAM_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
|
TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) :
|
||||||
ProcessedMediaStream(aWrapper)
|
ProcessedMediaStream(aWrapper)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gTrackUnionStreamLog) {
|
if (!gTrackUnionStreamLog) {
|
||||||
gTrackUnionStreamLog = PR_NewLogModule("TrackUnionStream");
|
gTrackUnionStreamLog = PR_NewLogModule("TrackUnionStream");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackUnionStream::RemoveInput(MediaInputPort* aPort)
|
void TrackUnionStream::RemoveInput(MediaInputPort* aPort)
|
||||||
|
|
|
@ -28,22 +28,16 @@ NS_INTERFACE_MAP_END
|
||||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener)
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener)
|
||||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener)
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener)
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gTextTrackLog;
|
PRLogModuleInfo* gTextTrackLog;
|
||||||
# define VTT_LOG(...) PR_LOG(gTextTrackLog, PR_LOG_DEBUG, (__VA_ARGS__))
|
# define VTT_LOG(...) PR_LOG(gTextTrackLog, PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
# define VTT_LOG(msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
|
WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
|
||||||
: mElement(aElement)
|
: mElement(aElement)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mElement, "Must pass an element to the callback");
|
MOZ_ASSERT(mElement, "Must pass an element to the callback");
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gTextTrackLog) {
|
if (!gTextTrackLog) {
|
||||||
gTextTrackLog = PR_NewLogModule("TextTrack");
|
gTextTrackLog = PR_NewLogModule("TextTrack");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
VTT_LOG("WebVTTListener created.");
|
VTT_LOG("WebVTTListener created.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,16 +21,10 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define LOGE(...) PR_LOG(gMediaDecoderLog, PR_LOG_ERROR, (__VA_ARGS__))
|
#define LOGE(...) PR_LOG(gMediaDecoderLog, PR_LOG_ERROR, (__VA_ARGS__))
|
||||||
#define LOGW(...) PR_LOG(gMediaDecoderLog, PR_LOG_WARNING, (__VA_ARGS__))
|
#define LOGW(...) PR_LOG(gMediaDecoderLog, PR_LOG_WARNING, (__VA_ARGS__))
|
||||||
#define LOGD(...) PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOGD(...) PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOGE(...)
|
|
||||||
#define LOGW(...)
|
|
||||||
#define LOGD(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PROPERTY_ID_FORMAT "%c%c%c%c"
|
#define PROPERTY_ID_FORMAT "%c%c%c%c"
|
||||||
#define PROPERTY_ID_PRINT(x) ((x) >> 24), \
|
#define PROPERTY_ID_PRINT(x) ((x) >> 24), \
|
||||||
|
|
|
@ -23,12 +23,8 @@ using namespace mozilla::media;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDirectShowLog();
|
PRLogModuleInfo* GetDirectShowLog();
|
||||||
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult)
|
AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult)
|
||||||
: BaseFilter(aObjectName, CLSID_MozAudioSinkFilter),
|
: BaseFilter(aObjectName, CLSID_MozAudioSinkFilter),
|
||||||
|
|
|
@ -15,12 +15,8 @@ using namespace mozilla::media;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDirectShowLog();
|
PRLogModuleInfo* GetDirectShowLog();
|
||||||
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName,
|
AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName,
|
||||||
AudioSinkFilter* aFilter,
|
AudioSinkFilter* aFilter,
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
PRLogModuleInfo*
|
PRLogModuleInfo*
|
||||||
GetDirectShowLog() {
|
GetDirectShowLog() {
|
||||||
static PRLogModuleInfo* log = nullptr;
|
static PRLogModuleInfo* log = nullptr;
|
||||||
|
@ -30,10 +28,6 @@ GetDirectShowLog() {
|
||||||
|
|
||||||
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
|
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder)
|
DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder)
|
||||||
: MediaDecoderReader(aDecoder),
|
: MediaDecoderReader(aDecoder),
|
||||||
mMP3FrameParser(aDecoder->GetResource()->GetLength()),
|
mMP3FrameParser(aDecoder->GetResource()->GetLength()),
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#if defined(PR_LOGGING)
|
|
||||||
|
|
||||||
// Create a table which maps GUIDs to a string representation of the GUID.
|
// Create a table which maps GUIDs to a string representation of the GUID.
|
||||||
// This is useful for debugging purposes, for logging the GUIDs of media types.
|
// This is useful for debugging purposes, for logging the GUIDs of media types.
|
||||||
// This is only available when logging is enabled, i.e. not in release builds.
|
// This is only available when logging is enabled, i.e. not in release builds.
|
||||||
|
@ -48,7 +46,6 @@ GetDirectShowGuidName(const GUID& aGuid)
|
||||||
}
|
}
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
#endif // PR_LOGGING
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RemoveGraphFromRunningObjectTable(DWORD aRotRegister)
|
RemoveGraphFromRunningObjectTable(DWORD aRotRegister)
|
||||||
|
|
|
@ -112,11 +112,8 @@ RefTimeToSeconds(const REFERENCE_TIME aRefTime)
|
||||||
return double(aRefTime) / 10000000;
|
return double(aRefTime) / 10000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(PR_LOGGING)
|
|
||||||
const char*
|
const char*
|
||||||
GetDirectShowGuidName(const GUID& aGuid);
|
GetDirectShowGuidName(const GUID& aGuid);
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,8 @@ using namespace mozilla::media;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDirectShowLog();
|
PRLogModuleInfo* GetDirectShowLog();
|
||||||
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SampleSink::SampleSink()
|
SampleSink::SampleSink()
|
||||||
: mMonitor("SampleSink"),
|
: mMonitor("SampleSink"),
|
||||||
|
@ -69,13 +65,11 @@ SampleSink::Receive(IMediaSample* aSample)
|
||||||
mon.Wait();
|
mon.Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
REFERENCE_TIME start = 0, end = 0;
|
REFERENCE_TIME start = 0, end = 0;
|
||||||
HRESULT hr = aSample->GetMediaTime(&start, &end);
|
HRESULT hr = aSample->GetMediaTime(&start, &end);
|
||||||
LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
|
LOG("SampleSink::Receive() [%4.2lf-%4.2lf]",
|
||||||
(double)RefTimeToUsecs(start) / USECS_PER_S,
|
(double)RefTimeToUsecs(start) / USECS_PER_S,
|
||||||
(double)RefTimeToUsecs(end) / USECS_PER_S);
|
(double)RefTimeToUsecs(end) / USECS_PER_S);
|
||||||
#endif
|
|
||||||
|
|
||||||
mSample = aSample;
|
mSample = aSample;
|
||||||
// Notify the signal, to awaken the consumer thread in WaitForSample()
|
// Notify the signal, to awaken the consumer thread in WaitForSample()
|
||||||
|
@ -106,13 +100,11 @@ SampleSink::Extract(RefPtr<IMediaSample>& aOutSample)
|
||||||
}
|
}
|
||||||
aOutSample = mSample;
|
aOutSample = mSample;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
int64_t start = 0, end = 0;
|
int64_t start = 0, end = 0;
|
||||||
mSample->GetMediaTime(&start, &end);
|
mSample->GetMediaTime(&start, &end);
|
||||||
LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",
|
LOG("SampleSink::Extract() [%4.2lf-%4.2lf]",
|
||||||
(double)RefTimeToUsecs(start) / USECS_PER_S,
|
(double)RefTimeToUsecs(start) / USECS_PER_S,
|
||||||
(double)RefTimeToUsecs(end) / USECS_PER_S);
|
(double)RefTimeToUsecs(end) / USECS_PER_S);
|
||||||
#endif
|
|
||||||
|
|
||||||
mSample = nullptr;
|
mSample = nullptr;
|
||||||
// Notify the signal, to awaken the producer thread in Receive()
|
// Notify the signal, to awaken the producer thread in Receive()
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace mozilla {
|
||||||
// Define to trace what's on...
|
// Define to trace what's on...
|
||||||
//#define DEBUG_SOURCE_TRACE 1
|
//#define DEBUG_SOURCE_TRACE 1
|
||||||
|
|
||||||
#if defined(PR_LOGGING) && defined (DEBUG_SOURCE_TRACE)
|
#if defined (DEBUG_SOURCE_TRACE)
|
||||||
PRLogModuleInfo* GetDirectShowLog();
|
PRLogModuleInfo* GetDirectShowLog();
|
||||||
#define DIRECTSHOW_LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define DIRECTSHOW_LOG(...) PR_LOG(GetDirectShowLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -51,7 +51,6 @@ CDMCaps::AutoLock::~AutoLock()
|
||||||
mData.Unlock();
|
mData.Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static void
|
static void
|
||||||
TestCap(uint64_t aFlag,
|
TestCap(uint64_t aFlag,
|
||||||
uint64_t aCaps,
|
uint64_t aCaps,
|
||||||
|
@ -77,7 +76,6 @@ CapsToString(uint64_t aCaps)
|
||||||
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeVideo"), capsStr);
|
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeVideo"), capsStr);
|
||||||
return capsStr;
|
return capsStr;
|
||||||
}
|
}
|
||||||
#endif // PR_LOGGING
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CDMCaps::AutoLock::SetCaps(uint64_t aCaps)
|
CDMCaps::AutoLock::SetCaps(uint64_t aCaps)
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
PRLogModuleInfo* GetEMELog() {
|
PRLogModuleInfo* GetEMELog() {
|
||||||
static PRLogModuleInfo* log = nullptr;
|
static PRLogModuleInfo* log = nullptr;
|
||||||
if (!log) {
|
if (!log) {
|
||||||
|
@ -26,8 +24,6 @@ PRLogModuleInfo* GetEMEVerboseLog() {
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ContainsOnlyDigits(const nsAString& aString)
|
ContainsOnlyDigits(const nsAString& aString)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,28 +12,15 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifndef EME_LOG
|
||||||
|
PRLogModuleInfo* GetEMELog();
|
||||||
#ifndef EME_LOG
|
#define EME_LOG(...) PR_LOG(GetEMELog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
PRLogModuleInfo* GetEMELog();
|
#endif
|
||||||
#define EME_LOG(...) PR_LOG(GetEMELog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EME_VERBOSE_LOG
|
|
||||||
PRLogModuleInfo* GetEMEVerboseLog();
|
|
||||||
#define EME_VERBOSE_LOG(...) PR_LOG(GetEMEVerboseLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
|
||||||
#else
|
|
||||||
#ifndef EME_LOG
|
|
||||||
#define EME_LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EME_VERBOSE_LOG
|
|
||||||
#define EME_VERBOSE_LOG(...)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#ifndef EME_VERBOSE_LOG
|
||||||
|
PRLogModuleInfo* GetEMEVerboseLog();
|
||||||
|
#define EME_VERBOSE_LOG(...) PR_LOG(GetEMEVerboseLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifndef EME_LOG
|
#ifndef EME_LOG
|
||||||
#define EME_LOG(...)
|
#define EME_LOG(...)
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,8 +28,7 @@ namespace mozilla {
|
||||||
#ifndef EME_VERBOSE_LOG
|
#ifndef EME_VERBOSE_LOG
|
||||||
#define EME_VERBOSE_LOG(...)
|
#define EME_VERBOSE_LOG(...)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#endif // PR_LOGGING
|
|
||||||
|
|
||||||
#define NO_CDM_VERSION -1
|
#define NO_CDM_VERSION -1
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,6 @@ MediaKeySession::UpdateKeyStatusMap()
|
||||||
|
|
||||||
mKeyStatusMap->Update(keyStatuses);
|
mKeyStatusMap->Update(keyStatuses);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsAutoCString message(
|
nsAutoCString message(
|
||||||
nsPrintfCString("MediaKeySession[%p,'%s'] key statuses change {",
|
nsPrintfCString("MediaKeySession[%p,'%s'] key statuses change {",
|
||||||
this, NS_ConvertUTF16toUTF8(mSessionId).get()));
|
this, NS_ConvertUTF16toUTF8(mSessionId).get()));
|
||||||
|
@ -155,7 +154,6 @@ MediaKeySession::UpdateKeyStatusMap()
|
||||||
}
|
}
|
||||||
message.Append(" }");
|
message.Append(" }");
|
||||||
EME_LOG(message.get());
|
EME_LOG(message.get());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaKeyStatusMap*
|
MediaKeyStatusMap*
|
||||||
|
@ -193,7 +191,6 @@ MediaKeySession::GenerateRequest(const nsAString& aInitDataType,
|
||||||
return promise.forget();
|
return promise.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
// Convert initData to base64 for easier logging.
|
// Convert initData to base64 for easier logging.
|
||||||
// Note: UpdateSession() Move()s the data out of the array, so we have
|
// Note: UpdateSession() Move()s the data out of the array, so we have
|
||||||
// to copy it here.
|
// to copy it here.
|
||||||
|
@ -203,7 +200,6 @@ MediaKeySession::GenerateRequest(const nsAString& aInitDataType,
|
||||||
if (NS_FAILED(Base64Encode(rawInitData, base64InitData))) {
|
if (NS_FAILED(Base64Encode(rawInitData, base64InitData))) {
|
||||||
NS_WARNING("Failed to base64 encode initData for logging");
|
NS_WARNING("Failed to base64 encode initData for logging");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
PromiseId pid = mKeys->StorePromise(promise);
|
PromiseId pid = mKeys->StorePromise(promise);
|
||||||
mKeys->GetCDMProxy()->CreateSession(Token(),
|
mKeys->GetCDMProxy()->CreateSession(Token(),
|
||||||
|
@ -280,7 +276,6 @@ MediaKeySession::Update(const ArrayBufferViewOrArrayBuffer& aResponse, ErrorResu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
// Convert response to base64 for easier logging.
|
// Convert response to base64 for easier logging.
|
||||||
// Note: UpdateSession() Move()s the data out of the array, so we have
|
// Note: UpdateSession() Move()s the data out of the array, so we have
|
||||||
// to copy it here.
|
// to copy it here.
|
||||||
|
@ -290,7 +285,6 @@ MediaKeySession::Update(const ArrayBufferViewOrArrayBuffer& aResponse, ErrorResu
|
||||||
if (NS_FAILED(Base64Encode(rawResponse, base64Response))) {
|
if (NS_FAILED(Base64Encode(rawResponse, base64Response))) {
|
||||||
NS_WARNING("Failed to base64 encode response for logging");
|
NS_WARNING("Failed to base64 encode response for logging");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
PromiseId pid = mKeys->StorePromise(promise);
|
PromiseId pid = mKeys->StorePromise(promise);
|
||||||
mKeys->GetCDMProxy()->UpdateSession(mSessionId,
|
mKeys->GetCDMProxy()->UpdateSession(mSessionId,
|
||||||
|
@ -382,7 +376,6 @@ void
|
||||||
MediaKeySession::DispatchKeyMessage(MediaKeyMessageType aMessageType,
|
MediaKeySession::DispatchKeyMessage(MediaKeyMessageType aMessageType,
|
||||||
const nsTArray<uint8_t>& aMessage)
|
const nsTArray<uint8_t>& aMessage)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsAutoCString base64MsgData;
|
nsAutoCString base64MsgData;
|
||||||
nsDependentCSubstring rawMsgData(reinterpret_cast<const char*>(aMessage.Elements()),
|
nsDependentCSubstring rawMsgData(reinterpret_cast<const char*>(aMessage.Elements()),
|
||||||
aMessage.Length());
|
aMessage.Length());
|
||||||
|
@ -393,7 +386,6 @@ MediaKeySession::DispatchKeyMessage(MediaKeyMessageType aMessageType,
|
||||||
this, NS_ConvertUTF16toUTF8(mSessionId).get(),
|
this, NS_ConvertUTF16toUTF8(mSessionId).get(),
|
||||||
MediaKeyMessageTypeValues::strings[uint32_t(aMessageType)].value,
|
MediaKeyMessageTypeValues::strings[uint32_t(aMessageType)].value,
|
||||||
base64MsgData.get());
|
base64MsgData.get());
|
||||||
#endif
|
|
||||||
|
|
||||||
nsRefPtr<MediaKeyMessageEvent> event(
|
nsRefPtr<MediaKeyMessageEvent> event(
|
||||||
MediaKeyMessageEvent::Constructor(this, aMessageType, aMessage));
|
MediaKeyMessageEvent::Constructor(this, aMessageType, aMessage));
|
||||||
|
|
|
@ -31,12 +31,8 @@
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gMediaEncoderLog;
|
PRLogModuleInfo* gMediaEncoderLog;
|
||||||
#define LOG(type, msg) PR_LOG(gMediaEncoderLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gMediaEncoderLog, type, msg)
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
@ -79,11 +75,9 @@ MediaEncoder::NotifyEvent(MediaStreamGraph* aGraph,
|
||||||
already_AddRefed<MediaEncoder>
|
already_AddRefed<MediaEncoder>
|
||||||
MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes)
|
MediaEncoder::CreateEncoder(const nsAString& aMIMEType, uint8_t aTrackTypes)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gMediaEncoderLog) {
|
if (!gMediaEncoderLog) {
|
||||||
gMediaEncoderLog = PR_NewLogModule("MediaEncoder");
|
gMediaEncoderLog = PR_NewLogModule("MediaEncoder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
PROFILER_LABEL("MediaEncoder", "CreateEncoder",
|
PROFILER_LABEL("MediaEncoder", "CreateEncoder",
|
||||||
js::ProfileEntry::Category::OTHER);
|
js::ProfileEntry::Category::OTHER);
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,8 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gTrackEncoderLog;
|
PRLogModuleInfo* gTrackEncoderLog;
|
||||||
#define TRACK_LOG(type, msg) PR_LOG(gTrackEncoderLog, type, msg)
|
#define TRACK_LOG(type, msg) PR_LOG(gTrackEncoderLog, type, msg)
|
||||||
#else
|
|
||||||
#define TRACK_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const int DEFAULT_CHANNELS = 1;
|
static const int DEFAULT_CHANNELS = 1;
|
||||||
static const int DEFAULT_SAMPLING_RATE = 16000;
|
static const int DEFAULT_SAMPLING_RATE = 16000;
|
||||||
|
@ -38,16 +34,12 @@ TrackEncoder::TrackEncoder()
|
||||||
, mInitialized(false)
|
, mInitialized(false)
|
||||||
, mEndOfStream(false)
|
, mEndOfStream(false)
|
||||||
, mCanceled(false)
|
, mCanceled(false)
|
||||||
#ifdef PR_LOGGING
|
|
||||||
, mAudioInitCounter(0)
|
, mAudioInitCounter(0)
|
||||||
, mVideoInitCounter(0)
|
, mVideoInitCounter(0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gTrackEncoderLog) {
|
if (!gTrackEncoderLog) {
|
||||||
gTrackEncoderLog = PR_NewLogModule("TrackEncoder");
|
gTrackEncoderLog = PR_NewLogModule("TrackEncoder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -65,10 +57,8 @@ AudioTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
|
||||||
|
|
||||||
// Check and initialize parameters for codec encoder.
|
// Check and initialize parameters for codec encoder.
|
||||||
if (!mInitialized) {
|
if (!mInitialized) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
mAudioInitCounter++;
|
mAudioInitCounter++;
|
||||||
TRACK_LOG(PR_LOG_DEBUG, ("Init the audio encoder %d times", mAudioInitCounter));
|
TRACK_LOG(PR_LOG_DEBUG, ("Init the audio encoder %d times", mAudioInitCounter));
|
||||||
#endif
|
|
||||||
AudioSegment::ChunkIterator iter(const_cast<AudioSegment&>(audio));
|
AudioSegment::ChunkIterator iter(const_cast<AudioSegment&>(audio));
|
||||||
while (!iter.IsEnded()) {
|
while (!iter.IsEnded()) {
|
||||||
AudioChunk chunk = *iter;
|
AudioChunk chunk = *iter;
|
||||||
|
@ -193,10 +183,8 @@ VideoTrackEncoder::NotifyQueuedTrackChanges(MediaStreamGraph* aGraph,
|
||||||
|
|
||||||
// Check and initialize parameters for codec encoder.
|
// Check and initialize parameters for codec encoder.
|
||||||
if (!mInitialized) {
|
if (!mInitialized) {
|
||||||
#ifdef PR_LOGGING
|
|
||||||
mVideoInitCounter++;
|
mVideoInitCounter++;
|
||||||
TRACK_LOG(PR_LOG_DEBUG, ("Init the video encoder %d times", mVideoInitCounter));
|
TRACK_LOG(PR_LOG_DEBUG, ("Init the video encoder %d times", mVideoInitCounter));
|
||||||
#endif
|
|
||||||
VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(video));
|
VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(video));
|
||||||
while (!iter.IsEnded()) {
|
while (!iter.IsEnded()) {
|
||||||
VideoChunk chunk = *iter;
|
VideoChunk chunk = *iter;
|
||||||
|
|
|
@ -129,11 +129,9 @@ protected:
|
||||||
*/
|
*/
|
||||||
bool mCanceled;
|
bool mCanceled;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
// How many times we have tried to initialize the encoder.
|
// How many times we have tried to initialize the encoder.
|
||||||
uint32_t mAudioInitCounter;
|
uint32_t mAudioInitCounter;
|
||||||
uint32_t mVideoInitCounter;
|
uint32_t mVideoInitCounter;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AudioTrackEncoder : public TrackEncoder
|
class AudioTrackEncoder : public TrackEncoder
|
||||||
|
|
|
@ -15,14 +15,10 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gVP8TrackEncoderLog;
|
PRLogModuleInfo* gVP8TrackEncoderLog;
|
||||||
#define VP8LOG(msg, ...) PR_LOG(gVP8TrackEncoderLog, PR_LOG_DEBUG, \
|
#define VP8LOG(msg, ...) PR_LOG(gVP8TrackEncoderLog, PR_LOG_DEBUG, \
|
||||||
(msg, ##__VA_ARGS__))
|
(msg, ##__VA_ARGS__))
|
||||||
// Debug logging macro with object pointer and class name.
|
// Debug logging macro with object pointer and class name.
|
||||||
#else
|
|
||||||
#define VP8LOG(msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEFAULT_BITRATE 2500 // in kbit/s
|
#define DEFAULT_BITRATE 2500 // in kbit/s
|
||||||
#define DEFAULT_ENCODE_FRAMERATE 30
|
#define DEFAULT_ENCODE_FRAMERATE 30
|
||||||
|
@ -38,11 +34,9 @@ VP8TrackEncoder::VP8TrackEncoder()
|
||||||
, mVPXImageWrapper(new vpx_image_t())
|
, mVPXImageWrapper(new vpx_image_t())
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(VP8TrackEncoder);
|
MOZ_COUNT_CTOR(VP8TrackEncoder);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gVP8TrackEncoderLog) {
|
if (!gVP8TrackEncoderLog) {
|
||||||
gVP8TrackEncoderLog = PR_NewLogModule("VP8TrackEncoder");
|
gVP8TrackEncoderLog = PR_NewLogModule("VP8TrackEncoder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VP8TrackEncoder::~VP8TrackEncoder()
|
VP8TrackEncoder::~VP8TrackEncoder()
|
||||||
|
|
|
@ -17,23 +17,17 @@ static const float BASE_QUALITY = 0.4f;
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gVorbisTrackEncoderLog;
|
PRLogModuleInfo* gVorbisTrackEncoderLog;
|
||||||
#define VORBISLOG(msg, ...) PR_LOG(gVorbisTrackEncoderLog, PR_LOG_DEBUG, \
|
#define VORBISLOG(msg, ...) PR_LOG(gVorbisTrackEncoderLog, PR_LOG_DEBUG, \
|
||||||
(msg, ##__VA_ARGS__))
|
(msg, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define VORBISLOG(msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VorbisTrackEncoder::VorbisTrackEncoder()
|
VorbisTrackEncoder::VorbisTrackEncoder()
|
||||||
: AudioTrackEncoder()
|
: AudioTrackEncoder()
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(VorbisTrackEncoder);
|
MOZ_COUNT_CTOR(VorbisTrackEncoder);
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gVorbisTrackEncoderLog) {
|
if (!gVorbisTrackEncoderLog) {
|
||||||
gVorbisTrackEncoderLog = PR_NewLogModule("VorbisTrackEncoder");
|
gVorbisTrackEncoderLog = PR_NewLogModule("VorbisTrackEncoder");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VorbisTrackEncoder::~VorbisTrackEncoder()
|
VorbisTrackEncoder::~VorbisTrackEncoder()
|
||||||
|
|
|
@ -34,7 +34,6 @@ using mozilla::layers::LayerManager;
|
||||||
using mozilla::layers::ImageContainer;
|
using mozilla::layers::ImageContainer;
|
||||||
using mozilla::layers::LayersBackend;
|
using mozilla::layers::LayersBackend;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog() {
|
PRLogModuleInfo* GetDemuxerLog() {
|
||||||
static PRLogModuleInfo* log = nullptr;
|
static PRLogModuleInfo* log = nullptr;
|
||||||
if (!log) {
|
if (!log) {
|
||||||
|
@ -44,10 +43,6 @@ PRLogModuleInfo* GetDemuxerLog() {
|
||||||
}
|
}
|
||||||
#define LOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define LOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define VLOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define VLOG(arg, ...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, ("MP4Reader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#define VLOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mp4_demuxer;
|
using namespace mp4_demuxer;
|
||||||
|
|
||||||
|
@ -56,7 +51,6 @@ namespace mozilla {
|
||||||
// Uncomment to enable verbose per-sample logging.
|
// Uncomment to enable verbose per-sample logging.
|
||||||
//#define LOG_SAMPLE_DECODE 1
|
//#define LOG_SAMPLE_DECODE 1
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
static const char*
|
static const char*
|
||||||
TrackTypeToStr(TrackInfo::TrackType aTrack)
|
TrackTypeToStr(TrackInfo::TrackType aTrack)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +65,6 @@ TrackTypeToStr(TrackInfo::TrackType aTrack)
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AccumulateSPSTelemetry(const MediaByteBuffer* aExtradata)
|
AccumulateSPSTelemetry(const MediaByteBuffer* aExtradata)
|
||||||
|
|
|
@ -12,12 +12,8 @@
|
||||||
#include "AppleATDecoder.h"
|
#include "AppleATDecoder.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
#define FourCC2Str(n) ((char[5]){(char)(n >> 24), (char)(n >> 16), (char)(n >> 8), (char)(n), 0})
|
#define FourCC2Str(n) ((char[5]){(char)(n >> 24), (char)(n >> 16), (char)(n >> 8), (char)(n), 0})
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
|
@ -12,12 +12,8 @@
|
||||||
#include "nsCocoaFeatures.h"
|
#include "nsCocoaFeatures.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog() {
|
PRLogModuleInfo* GetAppleMediaLog() {
|
||||||
static PRLogModuleInfo* log = nullptr;
|
static PRLogModuleInfo* log = nullptr;
|
||||||
if (!log) {
|
if (!log) {
|
||||||
|
@ -23,7 +22,6 @@ PRLogModuleInfo* GetAppleMediaLog() {
|
||||||
}
|
}
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,9 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
//#define LOG_MEDIA_SHA1
|
//#define LOG_MEDIA_SHA1
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,8 @@
|
||||||
#include "MainThreadUtils.h"
|
#include "MainThreadUtils.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,9 @@
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
//#define LOG_MEDIA_SHA1
|
//#define LOG_MEDIA_SHA1
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LOG_MEDIA_SHA1
|
#ifdef LOG_MEDIA_SHA1
|
||||||
#include "mozilla/SHA1.h"
|
#include "mozilla/SHA1.h"
|
||||||
|
|
|
@ -11,12 +11,8 @@
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetAppleMediaLog();
|
PRLogModuleInfo* GetAppleMediaLog();
|
||||||
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,7 @@
|
||||||
#ifndef __FFmpegLog_h__
|
#ifndef __FFmpegLog_h__
|
||||||
#define __FFmpegLog_h__
|
#define __FFmpegLog_h__
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetFFmpegDecoderLog();
|
extern PRLogModuleInfo* GetFFmpegDecoderLog();
|
||||||
#define FFMPEG_LOG(...) PR_LOG(GetFFmpegDecoderLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define FFMPEG_LOG(...) PR_LOG(GetFFmpegDecoderLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define FFMPEG_LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __FFmpegLog_h__
|
#endif // __FFmpegLog_h__
|
||||||
|
|
|
@ -25,12 +25,8 @@
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define GADM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkAudioDecoderManager", __VA_ARGS__)
|
#define GADM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkAudioDecoderManager", __VA_ARGS__)
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
#define READ_OUTPUT_BUFFER_TIMEOUT_US 3000
|
#define READ_OUTPUT_BUFFER_TIMEOUT_US 3000
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
|
@ -14,12 +14,8 @@
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__)
|
#define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__)
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
|
|
|
@ -31,12 +31,8 @@
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define GVDM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkVideoDecoderManager", __VA_ARGS__)
|
#define GVDM_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkVideoDecoderManager", __VA_ARGS__)
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
using namespace android;
|
using namespace android;
|
||||||
typedef android::MediaCodecProxy MediaCodecProxy;
|
typedef android::MediaCodecProxy MediaCodecProxy;
|
||||||
|
|
|
@ -9,13 +9,8 @@
|
||||||
#include "WMFUtils.h"
|
#include "WMFUtils.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,8 @@
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,8 @@
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,8 @@
|
||||||
#include "IMFYCbCrImage.h"
|
#include "IMFYCbCrImage.h"
|
||||||
#include "mozilla/WindowsVersion.h"
|
#include "mozilla/WindowsVersion.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetDemuxerLog();
|
PRLogModuleInfo* GetDemuxerLog();
|
||||||
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using mozilla::layers::Image;
|
using mozilla::layers::Image;
|
||||||
using mozilla::layers::IMFYCbCrImage;
|
using mozilla::layers::IMFYCbCrImage;
|
||||||
|
|
|
@ -17,15 +17,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace gmp {
|
namespace gmp {
|
||||||
|
|
||||||
|
|
|
@ -45,14 +45,9 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#undef LOGD
|
#undef LOGD
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
|
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
|
||||||
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__)
|
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPChild[pid=%d] " x, (int)base::GetCurrentProcId(), ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define LOG(level, x, ...)
|
|
||||||
#define LOGD(x, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace gmp {
|
namespace gmp {
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -41,14 +41,9 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#undef LOGD
|
#undef LOGD
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
|
#define LOG(level, x, ...) PR_LOG(GetGMPLog(), (level), (x, ##__VA_ARGS__))
|
||||||
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__)
|
#define LOGD(x, ...) LOG(PR_LOG_DEBUG, "GMPParent[%p|childPid=%d] " x, this, mChildPid, ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
#define LOG(level, x, ...)
|
|
||||||
#define LOGD(x, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace gmp {
|
namespace gmp {
|
||||||
|
|
||||||
|
@ -62,9 +57,7 @@ GMPParent::GMPParent()
|
||||||
, mGMPContentChildCount(0)
|
, mGMPContentChildCount(0)
|
||||||
, mAsyncShutdownRequired(false)
|
, mAsyncShutdownRequired(false)
|
||||||
, mAsyncShutdownInProgress(false)
|
, mAsyncShutdownInProgress(false)
|
||||||
#ifdef PR_LOGGING
|
|
||||||
, mChildPid(0)
|
, mChildPid(0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
LOGD("GMPParent ctor");
|
LOGD("GMPParent ctor");
|
||||||
mPluginId = GeckoChildProcessHost::GetUniqueID();
|
mPluginId = GeckoChildProcessHost::GetUniqueID();
|
||||||
|
@ -145,9 +138,7 @@ GMPParent::LoadProcess()
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
mChildPid = base::GetProcId(mProcess->GetChildProcessHandle());
|
mChildPid = base::GetProcId(mProcess->GetChildProcessHandle());
|
||||||
#endif
|
|
||||||
LOGD("%s: Launched new child process", __FUNCTION__);
|
LOGD("%s: Launched new child process", __FUNCTION__);
|
||||||
|
|
||||||
bool opened = Open(mProcess->GetChannel(),
|
bool opened = Open(mProcess->GetChannel(),
|
||||||
|
|
|
@ -217,9 +217,7 @@ private:
|
||||||
bool mAsyncShutdownRequired;
|
bool mAsyncShutdownRequired;
|
||||||
bool mAsyncShutdownInProgress;
|
bool mAsyncShutdownInProgress;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
int mChildPid;
|
int mChildPid;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace gmp
|
} // namespace gmp
|
||||||
|
|
|
@ -41,7 +41,6 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo*
|
PRLogModuleInfo*
|
||||||
GetGMPLog()
|
GetGMPLog()
|
||||||
{
|
{
|
||||||
|
@ -53,10 +52,6 @@ GetGMPLog()
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(leve1, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -12,13 +12,8 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(leve1, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -40,13 +40,8 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(leve1, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
@ -305,10 +300,8 @@ GeckoMediaPluginServiceParent::GetContentParentFrom(const nsACString& aNodeId,
|
||||||
{
|
{
|
||||||
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(aNodeId, aAPI, aTags);
|
nsRefPtr<GMPParent> gmp = SelectPluginForAPI(aNodeId, aAPI, aTags);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsCString api = aTags[0];
|
nsCString api = aTags[0];
|
||||||
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
|
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gmp) {
|
if (!gmp) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1439,10 +1432,8 @@ GMPServiceParent::RecvLoadGMP(const nsCString& aNodeId,
|
||||||
{
|
{
|
||||||
nsRefPtr<GMPParent> gmp = mService->SelectPluginForAPI(aNodeId, aAPI, aTags);
|
nsRefPtr<GMPParent> gmp = mService->SelectPluginForAPI(aNodeId, aAPI, aTags);
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
nsCString api = aTags[0];
|
nsCString api = aTags[0];
|
||||||
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
|
LOGD(("%s: %p returning %p for api %s", __FUNCTION__, (void *)this, (void *)gmp, api.get()));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gmp || !gmp->EnsureProcessLoaded(aId)) {
|
if (!gmp || !gmp->EnsureProcessLoaded(aId)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -26,15 +26,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -13,15 +13,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -21,15 +21,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace gmp {
|
namespace gmp {
|
||||||
|
|
||||||
|
|
|
@ -23,15 +23,10 @@ namespace mozilla {
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetGMPLog();
|
extern PRLogModuleInfo* GetGMPLog();
|
||||||
|
|
||||||
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
#define LOGD(msg) PR_LOG(GetGMPLog(), PR_LOG_DEBUG, msg)
|
||||||
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
#define LOG(level, msg) PR_LOG(GetGMPLog(), (level), msg)
|
||||||
#else
|
|
||||||
#define LOGD(msg)
|
|
||||||
#define LOG(level, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __CLASS__
|
#ifdef __CLASS__
|
||||||
#undef __CLASS__
|
#undef __CLASS__
|
||||||
|
|
|
@ -30,13 +30,9 @@ using namespace layers;
|
||||||
// Un-comment to enable logging of seek bisections.
|
// Un-comment to enable logging of seek bisections.
|
||||||
//#define SEEK_LOGGING
|
//#define SEEK_LOGGING
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define LOG(type, msg, ...) \
|
#define LOG(type, msg, ...) \
|
||||||
PR_LOG(gMediaDecoderLog, type, ("GStreamerReader(%p) " msg, this, ##__VA_ARGS__))
|
PR_LOG(gMediaDecoderLog, type, ("GStreamerReader(%p) " msg, this, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define LOG(type, msg, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
static const unsigned int MAX_CHANNELS = 4;
|
static const unsigned int MAX_CHANNELS = 4;
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
PRLogModuleInfo* GetICLog()
|
PRLogModuleInfo* GetICLog()
|
||||||
{
|
{
|
||||||
static PRLogModuleInfo* log = nullptr;
|
static PRLogModuleInfo* log = nullptr;
|
||||||
|
@ -29,8 +27,6 @@ PRLogModuleInfo* GetICLog()
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(ImageCapture, DOMEventTargetHelper,
|
NS_IMPL_CYCLE_COLLECTION_INHERITED(ImageCapture, DOMEventTargetHelper,
|
||||||
|
|
|
@ -13,21 +13,11 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
|
|
||||||
#ifndef IC_LOG
|
#ifndef IC_LOG
|
||||||
PRLogModuleInfo* GetICLog();
|
PRLogModuleInfo* GetICLog();
|
||||||
#define IC_LOG(...) PR_LOG(GetICLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
#define IC_LOG(...) PR_LOG(GetICLog(), PR_LOG_DEBUG, (__VA_ARGS__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifndef IC_LOG
|
|
||||||
#define IC_LOG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // PR_LOGGING
|
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class Blob;
|
class Blob;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include "SourceBufferResource.h"
|
#include "SourceBufferResource.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
|
|
||||||
/* Polyfill __func__ on MSVC to pass to the log. */
|
/* Polyfill __func__ on MSVC to pass to the log. */
|
||||||
|
@ -27,9 +26,6 @@ extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
#define STRINGIFY(x) #x
|
#define STRINGIFY(x) #x
|
||||||
#define TOSTRING(x) STRINGIFY(x)
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
#define MSE_DEBUG(name, arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(name, arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, (TOSTRING(name) "(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
struct JSContext;
|
struct JSContext;
|
||||||
class JSObject;
|
class JSObject;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetMediaSourceLog()
|
PRLogModuleInfo* GetMediaSourceLog()
|
||||||
{
|
{
|
||||||
static PRLogModuleInfo* sLogModule;
|
static PRLogModuleInfo* sLogModule;
|
||||||
|
@ -57,10 +56,6 @@ PRLogModuleInfo* GetMediaSourceAPILog()
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("MediaSource(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#define MSE_API(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Arbitrary limit.
|
// Arbitrary limit.
|
||||||
static const unsigned int MAX_SOURCE_BUFFERS = 16;
|
static const unsigned int MAX_SOURCE_BUFFERS = 16;
|
||||||
|
|
|
@ -16,15 +16,10 @@
|
||||||
#include "SourceBufferDecoder.h"
|
#include "SourceBufferDecoder.h"
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceDecoder(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#define MSE_DEBUGV(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,10 @@
|
||||||
#include "MP4Reader.h"
|
#include "MP4Reader.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("MediaSourceReader(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#define MSE_DEBUGV(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// When a stream hits EOS it needs to decide what other stream to switch to. Due
|
// When a stream hits EOS it needs to decide what other stream to switch to. Due
|
||||||
// to inaccuracies is determining buffer end frames (Bug 1065207) and rounding
|
// to inaccuracies is determining buffer end frames (Bug 1065207) and rounding
|
||||||
|
|
|
@ -11,13 +11,9 @@
|
||||||
#include "mozilla/Monitor.h"
|
#include "mozilla/Monitor.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("MediaSourceResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define UNIMPLEMENTED() MSE_DEBUG("UNIMPLEMENTED FUNCTION at %s:%d", __FILE__, __LINE__)
|
#define UNIMPLEMENTED() MSE_DEBUG("UNIMPLEMENTED FUNCTION at %s:%d", __FILE__, __LINE__)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "MediaData.h"
|
#include "MediaData.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetSourceBufferResourceLog();
|
extern PRLogModuleInfo* GetSourceBufferResourceLog();
|
||||||
|
|
||||||
/* Polyfill __func__ on MSVC to pass to the log. */
|
/* Polyfill __func__ on MSVC to pass to the log. */
|
||||||
|
@ -18,10 +17,6 @@ extern PRLogModuleInfo* GetSourceBufferResourceLog();
|
||||||
|
|
||||||
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("ResourceQueue(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define SBR_DEBUG(...)
|
|
||||||
#define SBR_DEBUGV(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -26,18 +26,12 @@
|
||||||
struct JSContext;
|
struct JSContext;
|
||||||
class JSObject;
|
class JSObject;
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
extern PRLogModuleInfo* GetMediaSourceAPILog();
|
extern PRLogModuleInfo* GetMediaSourceAPILog();
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUGV(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG + 1, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#define MSE_DEBUGV(...)
|
|
||||||
#define MSE_API(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "MediaDecoderReader.h"
|
#include "MediaDecoderReader.h"
|
||||||
#include "mozilla/dom/TimeRanges.h"
|
#include "mozilla/dom/TimeRanges.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
/* Polyfill __func__ on MSVC to pass to the log. */
|
/* Polyfill __func__ on MSVC to pass to the log. */
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -19,9 +18,6 @@ extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferDecoder(%p:%s)::%s: " arg, this, mResource->GetContentType().get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -16,16 +16,11 @@
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
extern PRLogModuleInfo* GetMediaSourceAPILog();
|
extern PRLogModuleInfo* GetMediaSourceAPILog();
|
||||||
|
|
||||||
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_API(arg, ...) PR_LOG(GetMediaSourceAPILog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("SourceBufferList(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_API(...)
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct JSContext;
|
struct JSContext;
|
||||||
class JSObject;
|
class JSObject;
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
#include "MediaData.h"
|
#include "MediaData.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* GetSourceBufferResourceLog()
|
PRLogModuleInfo* GetSourceBufferResourceLog()
|
||||||
{
|
{
|
||||||
static PRLogModuleInfo* sLogModule;
|
static PRLogModuleInfo* sLogModule;
|
||||||
|
@ -25,10 +24,6 @@ PRLogModuleInfo* GetSourceBufferResourceLog()
|
||||||
|
|
||||||
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define SBR_DEBUG(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define SBR_DEBUGV(arg, ...) PR_LOG(GetSourceBufferResourceLog(), PR_LOG_DEBUG+1, ("SourceBufferResource(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define SBR_DEBUG(...)
|
|
||||||
#define SBR_DEBUGV(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,9 @@
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* GetMediaSourceLog();
|
extern PRLogModuleInfo* GetMediaSourceLog();
|
||||||
|
|
||||||
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("TrackBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
#define MSE_DEBUG(arg, ...) PR_LOG(GetMediaSourceLog(), PR_LOG_DEBUG, ("TrackBuffer(%p:%s)::%s: " arg, this, mType.get(), __func__, ##__VA_ARGS__))
|
||||||
#else
|
|
||||||
#define MSE_DEBUG(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Time in seconds to substract from the current time when deciding the
|
// Time in seconds to substract from the current time when deciding the
|
||||||
// time point to evict data before in a decoder. This is used to help
|
// time point to evict data before in a decoder. This is used to help
|
||||||
|
|
|
@ -32,12 +32,8 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Decoder base class for Ogg-encapsulated streams. */
|
/** Decoder base class for Ogg-encapsulated streams. */
|
||||||
OggCodecState*
|
OggCodecState*
|
||||||
|
|
|
@ -37,7 +37,6 @@ namespace mozilla {
|
||||||
// Un-comment to enable logging of seek bisections.
|
// Un-comment to enable logging of seek bisections.
|
||||||
//#define SEEK_LOGGING
|
//#define SEEK_LOGGING
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
#define LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
||||||
#ifdef SEEK_LOGGING
|
#ifdef SEEK_LOGGING
|
||||||
|
@ -45,10 +44,6 @@ extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#else
|
#else
|
||||||
#define SEEK_LOG(type, msg)
|
#define SEEK_LOG(type, msg)
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#define LOG(type, msg)
|
|
||||||
#define SEEK_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The number of microseconds of "fuzz" we use in a bisection search over
|
// The number of microseconds of "fuzz" we use in a bisection search over
|
||||||
// HTTP. When we're seeking with fuzz, we'll stop the search if a bisection
|
// HTTP. When we're seeking with fuzz, we'll stop the search if a bisection
|
||||||
|
|
|
@ -24,12 +24,8 @@ extern "C" {
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||||
#define OPUS_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
#define OPUS_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
|
||||||
#else
|
|
||||||
#define OPUS_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OpusParser::OpusParser():
|
OpusParser::OpusParser():
|
||||||
mRate(0),
|
mRate(0),
|
||||||
|
|
|
@ -42,13 +42,9 @@ using namespace android;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo* gAudioOffloadPlayerLog;
|
PRLogModuleInfo* gAudioOffloadPlayerLog;
|
||||||
#define AUDIO_OFFLOAD_LOG(type, msg) \
|
#define AUDIO_OFFLOAD_LOG(type, msg) \
|
||||||
PR_LOG(gAudioOffloadPlayerLog, type, msg)
|
PR_LOG(gAudioOffloadPlayerLog, type, msg)
|
||||||
#else
|
|
||||||
#define AUDIO_OFFLOAD_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// maximum time in paused state when offloading audio decompression.
|
// maximum time in paused state when offloading audio decompression.
|
||||||
// When elapsed, the GonkAudioSink is destroyed to allow the audio DSP to power down.
|
// When elapsed, the GonkAudioSink is destroyed to allow the audio DSP to power down.
|
||||||
|
@ -67,11 +63,9 @@ AudioOffloadPlayer::AudioOffloadPlayer(MediaOmxCommonDecoder* aObserver) :
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gAudioOffloadPlayerLog) {
|
if (!gAudioOffloadPlayerLog) {
|
||||||
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
|
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CHECK(aObserver);
|
CHECK(aObserver);
|
||||||
#if ANDROID_VERSION >= 21
|
#if ANDROID_VERSION >= 21
|
||||||
|
|
|
@ -22,13 +22,9 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
extern PRLogModuleInfo* gAudioOffloadPlayerLog;
|
extern PRLogModuleInfo* gAudioOffloadPlayerLog;
|
||||||
#define AUDIO_OFFLOAD_LOG(type, msg) \
|
#define AUDIO_OFFLOAD_LOG(type, msg) \
|
||||||
PR_LOG(gAudioOffloadPlayerLog, type, msg)
|
PR_LOG(gAudioOffloadPlayerLog, type, msg)
|
||||||
#else
|
|
||||||
#define AUDIO_OFFLOAD_LOG(type, msg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
|
@ -39,11 +35,9 @@ AudioOutput::AudioOutput(int aSessionId, int aUid) :
|
||||||
mUid(aUid),
|
mUid(aUid),
|
||||||
mSessionId(aSessionId)
|
mSessionId(aSessionId)
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gAudioOffloadPlayerLog) {
|
if (!gAudioOffloadPlayerLog) {
|
||||||
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
|
gAudioOffloadPlayerLog = PR_NewLogModule("AudioOffloadPlayer");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutput::~AudioOutput()
|
AudioOutput::~AudioOutput()
|
||||||
|
|
|
@ -10,12 +10,8 @@
|
||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
|
||||||
PRLogModuleInfo *gI420ColorConverterHelperLog;
|
PRLogModuleInfo *gI420ColorConverterHelperLog;
|
||||||
#define LOG(msg...) PR_LOG(gI420ColorConverterHelperLog, PR_LOG_WARNING, (msg))
|
#define LOG(msg...) PR_LOG(gI420ColorConverterHelperLog, PR_LOG_WARNING, (msg))
|
||||||
#else
|
|
||||||
#define LOG(x...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
@ -23,11 +19,9 @@ I420ColorConverterHelper::I420ColorConverterHelper()
|
||||||
: mHandle(nullptr)
|
: mHandle(nullptr)
|
||||||
, mConverter({nullptr, nullptr, nullptr, nullptr, nullptr})
|
, mConverter({nullptr, nullptr, nullptr, nullptr, nullptr})
|
||||||
{
|
{
|
||||||
#ifdef PR_LOGGING
|
|
||||||
if (!gI420ColorConverterHelperLog) {
|
if (!gI420ColorConverterHelperLog) {
|
||||||
gI420ColorConverterHelperLog = PR_NewLogModule("I420ColorConverterHelper");
|
gI420ColorConverterHelperLog = PR_NewLogModule("I420ColorConverterHelper");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
I420ColorConverterHelper::~I420ColorConverterHelper()
|
I420ColorConverterHelper::~I420ColorConverterHelper()
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче