зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1611622 - Add some logging to MediaBufferDecoder.cpp. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D70894
This commit is contained in:
Родитель
1e20b5d27c
Коммит
60a6cea746
|
@ -31,6 +31,7 @@
|
||||||
#include "WebAudioUtils.h"
|
#include "WebAudioUtils.h"
|
||||||
#include "mozilla/dom/Promise.h"
|
#include "mozilla/dom/Promise.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
#include "mozilla/Logging.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "AudioNodeEngine.h"
|
#include "AudioNodeEngine.h"
|
||||||
|
|
||||||
|
@ -38,6 +39,9 @@ namespace mozilla {
|
||||||
|
|
||||||
extern LazyLogModule gMediaDecoderLog;
|
extern LazyLogModule gMediaDecoderLog;
|
||||||
|
|
||||||
|
#define LOG(x, ...) \
|
||||||
|
MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, (x, ##__VA_ARGS__))
|
||||||
|
|
||||||
using namespace dom;
|
using namespace dom;
|
||||||
|
|
||||||
class ReportResultTask final : public Runnable {
|
class ReportResultTask final : public Runnable {
|
||||||
|
@ -242,6 +246,7 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
|
||||||
if (!!mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack)) {
|
if (!!mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack)) {
|
||||||
mTrackDemuxer = mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
|
mTrackDemuxer = mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
|
||||||
if (!mTrackDemuxer) {
|
if (!mTrackDemuxer) {
|
||||||
|
LOG("MediaDecodeTask: Could not get a track demuxer.");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -256,6 +261,7 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_FAILED(CreateDecoder(*mMediaInfo.mAudio.GetAsAudioInfo()))) {
|
if (NS_FAILED(CreateDecoder(*mMediaInfo.mAudio.GetAsAudioInfo()))) {
|
||||||
|
LOG("MediaDecodeTask: Could not create a decoder.");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -265,6 +271,7 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
|
||||||
void MediaDecodeTask::OnInitDemuxerFailed(const MediaResult& aError) {
|
void MediaDecodeTask::OnInitDemuxerFailed(const MediaResult& aError) {
|
||||||
MOZ_ASSERT(OnPDecoderTaskQueue());
|
MOZ_ASSERT(OnPDecoderTaskQueue());
|
||||||
|
|
||||||
|
LOG("MediaDecodeTask: Could not initialize the demuxer.");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +315,7 @@ void MediaDecodeTask::OnInitDecoderFailed() {
|
||||||
MOZ_ASSERT(OnPDecoderTaskQueue());
|
MOZ_ASSERT(OnPDecoderTaskQueue());
|
||||||
|
|
||||||
ShutdownDecoder();
|
ShutdownDecoder();
|
||||||
|
LOG("MediaDecodeTask: Could not initialize the decoder");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,6 +344,7 @@ void MediaDecodeTask::OnAudioDemuxFailed(const MediaResult& aError) {
|
||||||
DoDecode();
|
DoDecode();
|
||||||
} else {
|
} else {
|
||||||
ShutdownDecoder();
|
ShutdownDecoder();
|
||||||
|
LOG("MediaDecodeTask: Audio demux failed");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -394,6 +403,7 @@ void MediaDecodeTask::OnAudioDecodeFailed(const MediaResult& aError) {
|
||||||
MOZ_ASSERT(OnPDecoderTaskQueue());
|
MOZ_ASSERT(OnPDecoderTaskQueue());
|
||||||
|
|
||||||
ShutdownDecoder();
|
ShutdownDecoder();
|
||||||
|
LOG("MediaDecodeTask: decode audio failed.");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,6 +437,7 @@ void MediaDecodeTask::OnAudioDrainFailed(const MediaResult& aError) {
|
||||||
MOZ_ASSERT(OnPDecoderTaskQueue());
|
MOZ_ASSERT(OnPDecoderTaskQueue());
|
||||||
|
|
||||||
ShutdownDecoder();
|
ShutdownDecoder();
|
||||||
|
LOG("MediaDecodeTask: Drain audio failed");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,6 +463,8 @@ void MediaDecodeTask::FinishDecode() {
|
||||||
uint32_t sampleRate = mMediaInfo.mAudio.mRate;
|
uint32_t sampleRate = mMediaInfo.mAudio.mRate;
|
||||||
|
|
||||||
if (!frameCount || !channelCount || !sampleRate) {
|
if (!frameCount || !channelCount || !sampleRate) {
|
||||||
|
LOG("MediaDecodeTask: invalid content frame count, channel count or "
|
||||||
|
"sample-rate");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -483,6 +496,7 @@ void MediaDecodeTask::FinishDecode() {
|
||||||
ThreadSharedFloatArrayBufferList::Create(channelCount, resampledFrames,
|
ThreadSharedFloatArrayBufferList::Create(channelCount, resampledFrames,
|
||||||
fallible);
|
fallible);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
|
LOG("MediaDecodeTask: Could not create final buffer (f32)");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -495,6 +509,7 @@ void MediaDecodeTask::FinishDecode() {
|
||||||
bufferSize *= channelCount;
|
bufferSize *= channelCount;
|
||||||
RefPtr<SharedBuffer> buffer = SharedBuffer::Create(bufferSize);
|
RefPtr<SharedBuffer> buffer = SharedBuffer::Create(bufferSize);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
|
LOG("MediaDecodeTask: Could not create final buffer (i16)");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -581,6 +596,7 @@ void MediaDecodeTask::AllocateBuffer() {
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!mDecodeJob.AllocateBuffer()) {
|
if (!mDecodeJob.AllocateBuffer()) {
|
||||||
|
LOG("MediaDecodeTask: Could not allocate final buffer");
|
||||||
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче