зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1236703: P2. Add methods to retrieve debugging data on plain readers. r=jwwang
This commit is contained in:
Родитель
e35b5b767d
Коммит
58d924fab9
|
@ -530,6 +530,10 @@ private:
|
|||
virtual MediaDecoderOwner::NextFrameStatus NextFrameStatus() { return mNextFrameStatus; }
|
||||
virtual MediaDecoderOwner::NextFrameStatus NextFrameBufferedStatus();
|
||||
|
||||
// Returns a string describing the state of the media player internal
|
||||
// data. Used for debugging purposes.
|
||||
virtual void GetMozDebugReaderData(nsAString& aString) {}
|
||||
|
||||
protected:
|
||||
virtual ~MediaDecoder();
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "MP4Decoder.h"
|
||||
#include "MediaDecoderStateMachine.h"
|
||||
#include "MediaFormatReader.h"
|
||||
#include "MP4Demuxer.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
|
@ -47,12 +46,12 @@ MP4Decoder::MP4Decoder(MediaDecoderOwner* aOwner)
|
|||
|
||||
MediaDecoderStateMachine* MP4Decoder::CreateStateMachine()
|
||||
{
|
||||
MediaDecoderReader* reader =
|
||||
mReader =
|
||||
new MediaFormatReader(this,
|
||||
new MP4Demuxer(GetResource()),
|
||||
GetVideoFrameContainer());
|
||||
|
||||
return new MediaDecoderStateMachine(this, reader);
|
||||
return new MediaDecoderStateMachine(this, mReader);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -227,4 +226,12 @@ MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aFail
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
MP4Decoder::GetMozDebugReaderData(nsAString& aString)
|
||||
{
|
||||
if (mReader) {
|
||||
mReader->GetMozDebugReaderData(aString);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define MP4Decoder_h_
|
||||
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaFormatReader.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -38,6 +39,11 @@ public:
|
|||
static bool IsEnabled();
|
||||
|
||||
static bool IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aReason);
|
||||
|
||||
void GetMozDebugReaderData(nsAString& aString) override;
|
||||
|
||||
private:
|
||||
RefPtr<MediaFormatReader> mReader;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -239,8 +239,10 @@ MediaSourceDecoder::GetMediaSourceDuration()
|
|||
void
|
||||
MediaSourceDecoder::GetMozDebugReaderData(nsAString& aString)
|
||||
{
|
||||
mReader->GetMozDebugReaderData(aString);
|
||||
mDemuxer->GetMozDebugReaderData(aString);
|
||||
if (mReader && mDemuxer) {
|
||||
mReader->GetMozDebugReaderData(aString);
|
||||
mDemuxer->GetMozDebugReaderData(aString);
|
||||
}
|
||||
}
|
||||
|
||||
double
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
// Returns a string describing the state of the MediaSource internal
|
||||
// buffered data. Used for debugging purposes.
|
||||
void GetMozDebugReaderData(nsAString& aString);
|
||||
void GetMozDebugReaderData(nsAString& aString) override;
|
||||
|
||||
void AddSizeOfResources(ResourceSizes* aSizes) override;
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "MediaDecoderStateMachine.h"
|
||||
#include "MediaFormatReader.h"
|
||||
#include "WebMDemuxer.h"
|
||||
#include "WebMDecoder.h"
|
||||
#include "VideoUtils.h"
|
||||
|
@ -15,9 +14,9 @@ namespace mozilla {
|
|||
|
||||
MediaDecoderStateMachine* WebMDecoder::CreateStateMachine()
|
||||
{
|
||||
RefPtr<MediaDecoderReader> reader =
|
||||
mReader =
|
||||
new MediaFormatReader(this, new WebMDemuxer(GetResource()), GetVideoFrameContainer());
|
||||
return new MediaDecoderStateMachine(this, reader);
|
||||
return new MediaDecoderStateMachine(this, mReader);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -71,5 +70,13 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
WebMDecoder::GetMozDebugReaderData(nsAString& aString)
|
||||
{
|
||||
if (mReader) {
|
||||
mReader->GetMozDebugReaderData(aString);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define WebMDecoder_h_
|
||||
|
||||
#include "MediaDecoder.h"
|
||||
#include "MediaFormatReader.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -31,6 +32,11 @@ public:
|
|||
// out params whether the codecs string contains Opus/Vorbis or VP8/VP9.
|
||||
static bool CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
|
||||
const nsAString& aCodecs);
|
||||
|
||||
void GetMozDebugReaderData(nsAString& aString) override;
|
||||
|
||||
private:
|
||||
RefPtr<MediaFormatReader> mReader;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче