mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1236703: P1. Add debugging information for MSE to about:media plugin. r=kentuckyfriedtakahe
Add : number of frames decoded and number of frames skipped during skip to next key frame and if hardware acceleration is currently in use.
This commit is contained in:
parent
df877e4c27
commit
7e95055d1a
@ -1363,6 +1363,7 @@ MediaFormatReader::OnVideoSkipCompleted(uint32_t aSkipped)
|
||||
if (mDecoder) {
|
||||
mDecoder->NotifyDecodedFrames(aSkipped, 0, aSkipped);
|
||||
}
|
||||
mVideo.mNumSamplesSkippedTotal += aSkipped;
|
||||
MOZ_ASSERT(!mVideo.mError); // We have flushed the decoder, no frame could
|
||||
// have been decoded (and as such errored)
|
||||
NotifyDecodingRequested(TrackInfo::kVideoTrack);
|
||||
@ -1661,4 +1662,19 @@ MediaFormatReader::GetImageContainer()
|
||||
? mVideoFrameContainer->GetImageContainer() : nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
MediaFormatReader::GetMozDebugReaderData(nsAString& aString)
|
||||
{
|
||||
nsAutoCString result;
|
||||
result += nsPrintfCString("hardware video decoding: %s\n",
|
||||
VideoIsHardwareAccelerated() ? "enabled" : "disabled");
|
||||
result += nsPrintfCString("audio frames decoded: %lld (skipped:%lld)\n"
|
||||
"video frames decoded: %lld (skipped:%lld)\n",
|
||||
mAudio.mNumSamplesOutputTotal,
|
||||
mAudio.mNumSamplesSkippedTotal,
|
||||
mVideo.mNumSamplesOutputTotal,
|
||||
mVideo.mNumSamplesSkippedTotal);
|
||||
aString += NS_ConvertUTF8toUTF16(result);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -96,6 +96,10 @@ public:
|
||||
void SetCDMProxy(CDMProxy* aProxy) override;
|
||||
#endif
|
||||
|
||||
// Returns a string describing the state of the decoder data.
|
||||
// Used for debugging purposes.
|
||||
void GetMozDebugReaderData(nsAString& aString);
|
||||
|
||||
private:
|
||||
bool HasVideo() { return mVideo.mTrackDemuxer; }
|
||||
bool HasAudio() { return mAudio.mTrackDemuxer; }
|
||||
@ -226,6 +230,7 @@ private:
|
||||
, mNumSamplesInput(0)
|
||||
, mNumSamplesOutput(0)
|
||||
, mNumSamplesOutputTotal(0)
|
||||
, mNumSamplesSkippedTotal(0)
|
||||
, mSizeOfQueue(0)
|
||||
, mIsHardwareAccelerated(false)
|
||||
, mLastStreamSourceID(UINT32_MAX)
|
||||
@ -289,6 +294,7 @@ private:
|
||||
uint64_t mNumSamplesInput;
|
||||
uint64_t mNumSamplesOutput;
|
||||
uint64_t mNumSamplesOutputTotal;
|
||||
uint64_t mNumSamplesSkippedTotal;
|
||||
|
||||
// These get overriden in the templated concrete class.
|
||||
// Indicate if we have a pending promise for decoded frame.
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "MediaSourceResource.h"
|
||||
#include "MediaSourceUtils.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "MediaFormatReader.h"
|
||||
#include "MediaSourceDemuxer.h"
|
||||
#include "SourceBufferList.h"
|
||||
#include <algorithm>
|
||||
@ -47,9 +46,8 @@ MediaSourceDecoder::CreateStateMachine()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mDemuxer = new MediaSourceDemuxer();
|
||||
RefPtr<MediaFormatReader> reader =
|
||||
new MediaFormatReader(this, mDemuxer, GetVideoFrameContainer());
|
||||
return new MediaDecoderStateMachine(this, reader);
|
||||
mReader = new MediaFormatReader(this, mDemuxer, GetVideoFrameContainer());
|
||||
return new MediaDecoderStateMachine(this, mReader);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -241,6 +239,7 @@ MediaSourceDecoder::GetMediaSourceDuration()
|
||||
void
|
||||
MediaSourceDecoder::GetMozDebugReaderData(nsAString& aString)
|
||||
{
|
||||
mReader->GetMozDebugReaderData(aString);
|
||||
mDemuxer->GetMozDebugReaderData(aString);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsError.h"
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaFormatReader.h"
|
||||
|
||||
class nsIStreamListener;
|
||||
|
||||
@ -88,6 +89,7 @@ private:
|
||||
// mMediaSource.
|
||||
dom::MediaSource* mMediaSource;
|
||||
RefPtr<MediaSourceDemuxer> mDemuxer;
|
||||
RefPtr<MediaFormatReader> mReader;
|
||||
|
||||
Atomic<bool> mEnded;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user