Bug 1161984 - Get rid of IsWaitingMediaResources() in MP4Reader. r=jya

This commit is contained in:
Alfredo Yang 2015-05-13 00:02:00 -04:00
Родитель e20f8e396f
Коммит a2681e3ad6
5 изменённых файлов: 1 добавлений и 33 удалений

Просмотреть файл

@ -386,7 +386,7 @@ MP4Reader::ReadMetadata(MediaInfo* aInfo,
// an encrypted stream and we need to wait for a CDM to be set, we don't
// need to reinit the demuxer.
mDemuxerInitialized = true;
} else if (mPlatform && !IsWaitingMediaResources()) {
} else if (mPlatform) {
*aInfo = mInfo;
*aTags = nullptr;
NS_ENSURE_TRUE(EnsureDecodersSetup(), NS_ERROR_FAILURE);
@ -464,11 +464,6 @@ MP4Reader::EnsureDecodersSetup()
// a CDM, we can detect that and notify chrome and show some UI
// explaining that we failed due to EME being disabled.
nsRefPtr<CDMProxy> proxy;
if (IsWaitingMediaResources()) {
return true;
}
MOZ_ASSERT(!IsWaitingMediaResources());
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
proxy = mDecoder->GetCDMProxy();
@ -530,8 +525,6 @@ MP4Reader::EnsureDecodersSetup()
NS_ENSURE_SUCCESS(rv, false);
}
NotifyResourcesStatusChanged();
return true;
}
@ -1129,19 +1122,11 @@ void MP4Reader::ReleaseMediaResources()
}
}
void MP4Reader::NotifyResourcesStatusChanged()
{
if (mDecoder) {
mDecoder->NotifyWaitingForResourcesStatusChanged();
}
}
void
MP4Reader::SetIdle()
{
if (mSharedDecoderManager && mVideo.mDecoder) {
mSharedDecoderManager->SetIdle(mVideo.mDecoder);
NotifyResourcesStatusChanged();
}
}

Просмотреть файл

@ -124,7 +124,6 @@ private:
void UpdateIndex();
bool IsSupportedAudioMimeType(const nsACString& aMimeType);
bool IsSupportedVideoMimeType(const nsACString& aMimeType);
void NotifyResourcesStatusChanged();
virtual bool IsWaitingOnCDMResource() override;
Microseconds GetNextKeyframeTime();
@ -156,9 +155,6 @@ private:
virtual void DrainComplete() override {
mReader->DrainComplete(mType);
}
virtual void NotifyResourcesStatusChanged() override {
mReader->NotifyResourcesStatusChanged();
}
virtual void ReleaseMediaResources() override {
mReader->ReleaseMediaResources();
}

Просмотреть файл

@ -179,8 +179,6 @@ public:
virtual void DrainComplete() = 0;
virtual void NotifyResourcesStatusChanged() {};
virtual void ReleaseMediaResources() {};
virtual bool OnReaderTaskQueue() = 0;

Просмотреть файл

@ -44,13 +44,6 @@ public:
mManager->DrainComplete();
}
}
virtual void NotifyResourcesStatusChanged() override
{
if (mManager->mActiveCallback) {
AssertHaveActiveProxy();
mManager->mActiveCallback->NotifyResourcesStatusChanged();
}
}
virtual void ReleaseMediaResources() override
{
if (mManager->mActiveCallback) {

Просмотреть файл

@ -106,10 +106,6 @@ public:
mProxyCallback->DrainComplete();
}
virtual void NotifyResourcesStatusChanged() override {
mProxyCallback->NotifyResourcesStatusChanged();
}
virtual void ReleaseMediaResources() override {
mProxyCallback->ReleaseMediaResources();
}