зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1802520 - Allow disabling real-time callback tracing in configure. r=glandium,pehrsons,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D163111
This commit is contained in:
Родитель
d2aa0af52d
Коммит
37656b1b28
|
@ -16,7 +16,7 @@ mozilla::AsyncLogger gAudioCallbackTraceLogger;
|
|||
static std::atomic<int> gTracingStarted(0);
|
||||
|
||||
void StartAudioCallbackTracing() {
|
||||
#ifdef TRACING
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
int cnt = gTracingStarted.fetch_add(1, std::memory_order_seq_cst);
|
||||
if (cnt == 0) {
|
||||
// This is a noop if the logger has not been enabled.
|
||||
|
@ -26,7 +26,7 @@ void StartAudioCallbackTracing() {
|
|||
}
|
||||
|
||||
void StopAudioCallbackTracing() {
|
||||
#ifdef TRACING
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
int cnt = gTracingStarted.fetch_sub(1, std::memory_order_seq_cst);
|
||||
if (cnt == 1) {
|
||||
// This is a noop if the logger has not been enabled.
|
||||
|
@ -37,13 +37,17 @@ void StopAudioCallbackTracing() {
|
|||
|
||||
void AutoTracer::PrintEvent(const char* aName, const char* aCategory,
|
||||
const char* aComment, TracingPhase aPhase) {
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
mLogger.Log(aName, aCategory, aComment, aPhase);
|
||||
#endif
|
||||
}
|
||||
|
||||
void AutoTracer::PrintBudget(const char* aName, const char* aCategory,
|
||||
uint64_t aDuration, uint64_t aFrames,
|
||||
uint64_t aSampleRate) {
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
mLogger.LogDuration(aName, aCategory, aDuration, aFrames, aSampleRate);
|
||||
#endif
|
||||
}
|
||||
|
||||
AutoTracer::AutoTracer(AsyncLogger& aLogger, const char* aLocation,
|
||||
|
|
|
@ -30,7 +30,7 @@ extern mozilla::AsyncLogger gAudioCallbackTraceLogger;
|
|||
void StartAudioCallbackTracing();
|
||||
void StopAudioCallbackTracing();
|
||||
|
||||
#ifdef TRACING
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
# define TRACE(aName) AutoTracer trace(gAudioCallbackTraceLogger, aName);
|
||||
# define TRACE_COMMENT(aName, aFmt, ...) \
|
||||
AutoTracer trace(gAudioCallbackTraceLogger, aName, \
|
||||
|
|
|
@ -25,8 +25,6 @@ UNIFIED_SOURCES += [
|
|||
"VP8TrackEncoder.cpp",
|
||||
]
|
||||
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
|
|
@ -20,8 +20,6 @@ LOCAL_INCLUDES += [
|
|||
"/dom/media",
|
||||
]
|
||||
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
include("/ipc/chromium/chromium-config.mozbuild")
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
|
|
@ -374,7 +374,6 @@ if CONFIG["MOZ_WEBRTC"]:
|
|||
]
|
||||
|
||||
DEFINES["MOZILLA_INTERNAL_API"] = True
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
if CONFIG["MOZ_ANDROID_HLS_SUPPORT"]:
|
||||
DEFINES["MOZ_ANDROID_HLS_SUPPORT"] = True
|
||||
|
|
|
@ -138,9 +138,6 @@ if CONFIG["INTEL_ARCHITECTURE"]:
|
|||
DEFINES["USE_SSE2"] = True
|
||||
SOURCES["AudioNodeEngineSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
|
||||
|
||||
# Allow outputing trace points from Web Audio API code
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
include("/ipc/chromium/chromium-config.mozbuild")
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
|
|
@ -1324,6 +1324,7 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
MOZ_ASSERT(!aFrame.color_space(), "Unexpected use of color space");
|
||||
MOZ_ASSERT(!aFrame.has_update_rect(), "Unexpected use of update rect");
|
||||
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
if (profiler_is_active()) {
|
||||
MutexAutoLock lock(mMutex);
|
||||
nsAutoCStringN<256> ssrcsCommaSeparated;
|
||||
|
@ -1345,6 +1346,7 @@ MediaConduitErrorCode WebrtcVideoConduit::SendVideoFrame(
|
|||
TRACE_COMMENT("VideoConduit::SendVideoFrame", "t-delta=%.1fms, ssrcs=%s",
|
||||
timestampDelta / 1000.f, ssrcsCommaSeparated.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
mVideoBroadcaster.OnFrame(aFrame);
|
||||
|
||||
|
@ -1661,6 +1663,7 @@ void WebrtcVideoConduit::OnFrame(const webrtc::VideoFrame& video_frame) {
|
|||
VideoLatencyUpdate(now - timestamp);
|
||||
}
|
||||
}
|
||||
#ifdef MOZ_REAL_TIME_TRACING
|
||||
if (profiler_is_active()) {
|
||||
MutexAutoLock lock(mMutex);
|
||||
// The first frame has a delta of zero.
|
||||
|
@ -1674,6 +1677,7 @@ void WebrtcVideoConduit::OnFrame(const webrtc::VideoFrame& video_frame) {
|
|||
timestampDelta * 1000.f / webrtc::kVideoPayloadTypeFrequency,
|
||||
localRecvSsrc);
|
||||
}
|
||||
#endif
|
||||
|
||||
mRenderer->RenderVideoFrame(*video_frame.video_frame_buffer(),
|
||||
video_frame.timestamp(),
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
include("/dom/media/webrtc/third_party_build/webrtc.mozbuild")
|
||||
|
||||
# Allow outputing trace points from the libwebrtc glue code
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
"!/ipc/ipdl/_ipdlheaders",
|
||||
"/dom/media/gmp", # for GMPLog.h,
|
||||
|
|
|
@ -119,7 +119,6 @@ CXXFLAGS += [
|
|||
"-Wno-error=attributes",
|
||||
]
|
||||
|
||||
DEFINES["TRACING"] = True
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
||||
# Add libFuzzer configuration directives
|
||||
|
|
|
@ -24,6 +24,4 @@ UNIFIED_SOURCES += [
|
|||
"RtpLogger.cpp",
|
||||
]
|
||||
|
||||
DEFINES["TRACING"] = True
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
|
|
@ -761,6 +761,14 @@ set_config("MOZ_VORBIS", sample_type_is_float)
|
|||
set_define("MOZ_TREMOR", sample_type_is_s16)
|
||||
set_config("MOZ_TREMOR", sample_type_is_s16)
|
||||
|
||||
option(
|
||||
"--disable-real-time-tracing",
|
||||
help="Disable tracing of real-time audio callbacks",
|
||||
)
|
||||
|
||||
set_config("MOZ_REAL_TIME_TRACING", True, when="--enable-real-time-tracing")
|
||||
set_define("MOZ_REAL_TIME_TRACING", True, when="--enable-real-time-tracing")
|
||||
|
||||
# OpenMAX IL Decoding Support
|
||||
# ==============================================================
|
||||
option("--enable-openmax", help="Enable OpenMAX IL for video/audio decoding")
|
||||
|
|
Загрузка…
Ссылка в новой задаче