зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1164297 - tweaks to logging modules of MediaDecoderStateMachine to remove accessing to env vars. r=cpearce.
This commit is contained in:
Родитель
f4f888f4dc
Коммит
fc64b939e2
|
@ -14,12 +14,8 @@ namespace mozilla {
|
|||
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||
#define SINK_LOG(msg, ...) \
|
||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
||||
#define SINK_LOG_V(msg, ...) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (!PR_GetEnv("MOZ_QUIET")) { \
|
||||
SINK_LOG(msg, ##__VA_ARGS__); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
#define SINK_LOG_V(msg, ...) \
|
||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, ("AudioSink=%p " msg, this, ##__VA_ARGS__))
|
||||
#else
|
||||
#define SINK_LOG(msg, ...)
|
||||
#define SINK_LOG_V(msg, ...)
|
||||
|
|
|
@ -120,6 +120,7 @@ StaticRefPtr<MediaMemoryTracker> MediaMemoryTracker::sUniqueInstance;
|
|||
PRLogModuleInfo* gStateWatchingLog;
|
||||
PRLogModuleInfo* gMediaPromiseLog;
|
||||
PRLogModuleInfo* gMediaTimerLog;
|
||||
PRLogModuleInfo* gMediaSampleLog;
|
||||
|
||||
void
|
||||
MediaDecoder::InitStatics()
|
||||
|
@ -131,6 +132,7 @@ MediaDecoder::InitStatics()
|
|||
gMediaPromiseLog = PR_NewLogModule("MediaPromise");
|
||||
gStateWatchingLog = PR_NewLogModule("StateWatching");
|
||||
gMediaTimerLog = PR_NewLogModule("MediaTimer");
|
||||
gMediaSampleLog = PR_NewLogModule("MediaSample");
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(MediaMemoryTracker, nsIMemoryReporter)
|
||||
|
|
|
@ -50,25 +50,21 @@ using namespace mozilla::gfx;
|
|||
#define NS_DispatchToMainThread(...) CompileError_UseAbstractThreadDispatchInstead
|
||||
|
||||
// avoid redefined macro in unified build
|
||||
#undef LOG
|
||||
#undef DECODER_LOG
|
||||
#undef VERBOSE_LOG
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gMediaDecoderLog;
|
||||
extern PRLogModuleInfo* gMediaSampleLog;
|
||||
#define LOG(m, l, x, ...) \
|
||||
PR_LOG(m, l, ("Decoder=%p " x, mDecoder.get(), ##__VA_ARGS__))
|
||||
#define DECODER_LOG(x, ...) \
|
||||
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder.get(), ##__VA_ARGS__))
|
||||
#define VERBOSE_LOG(x, ...) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (!PR_GetEnv("MOZ_QUIET")) { \
|
||||
DECODER_LOG(x, ##__VA_ARGS__); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
#define SAMPLE_LOG(x, ...) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (PR_GetEnv("MEDIA_LOG_SAMPLES")) { \
|
||||
DECODER_LOG(x, ##__VA_ARGS__); \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
LOG(gMediaDecoderLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
|
||||
#define VERBOSE_LOG(x, ...) \
|
||||
LOG(gMediaDecoderLog, PR_LOG_DEBUG+1, x, ##__VA_ARGS__)
|
||||
#define SAMPLE_LOG(x, ...) \
|
||||
LOG(gMediaSampleLog, PR_LOG_DEBUG, x, ##__VA_ARGS__)
|
||||
#else
|
||||
#define DECODER_LOG(x, ...)
|
||||
#define VERBOSE_LOG(x, ...)
|
||||
|
@ -3457,6 +3453,7 @@ uint32_t MediaDecoderStateMachine::GetAmpleVideoFrames() const
|
|||
} // namespace mozilla
|
||||
|
||||
// avoid redefined macro in unified build
|
||||
#undef LOG
|
||||
#undef DECODER_LOG
|
||||
#undef VERBOSE_LOG
|
||||
#undef DECODER_WARN
|
||||
|
|
|
@ -1048,7 +1048,7 @@ bool WebMReader::ShouldSkipVideoFrame(int64_t aTimeThreshold)
|
|||
bool WebMReader::DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold)
|
||||
{
|
||||
if (!(aKeyframeSkip && ShouldSkipVideoFrame(aTimeThreshold))) {
|
||||
LOG(PR_LOG_DEBUG, ("Reader [%p]: set the aKeyframeSkip to false.",this));
|
||||
LOG(PR_LOG_DEBUG+1, ("Reader [%p]: set the aKeyframeSkip to false.",this));
|
||||
aKeyframeSkip = false;
|
||||
}
|
||||
return mVideoDecoder->DecodeVideoFrame(aKeyframeSkip, aTimeThreshold);
|
||||
|
|
Загрузка…
Ссылка в новой задаче