зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1315850 - Shutdown CDMVideoDecoder. r=jya
This severs the ChromiumCDMVideoDecoder's connection with the CDM. The CDM process will shutdown when the MediaKeys also severs its connection. MozReview-Commit-ID: Aqc4y5Nxjvc --HG-- extra : rebase_source : 5a2f77ffe84f9b99b4668520c838b29a428578d3
This commit is contained in:
Родитель
dbc1c7bcdf
Коммит
4c421503a8
|
@ -626,5 +626,18 @@ ChromiumCDMParent::RecvDrainComplete()
|
||||||
mDecodePromise.ResolveIfExists(MediaDataDecoder::DecodedData(), __func__);
|
mDecodePromise.ResolveIfExists(MediaDataDecoder::DecodedData(), __func__);
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
RefPtr<ShutdownPromise>
|
||||||
|
ChromiumCDMParent::ShutdownVideoDecoder()
|
||||||
|
{
|
||||||
|
mInitVideoDecoderPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED,
|
||||||
|
__func__);
|
||||||
|
MOZ_ASSERT(mDecodePromise.IsEmpty());
|
||||||
|
MOZ_ASSERT(mFlushDecoderPromise.IsEmpty());
|
||||||
|
if (!SendDeinitializeVideoDecoder()) {
|
||||||
|
return ShutdownPromise::CreateAndResolve(true, __func__);
|
||||||
|
}
|
||||||
|
return ShutdownPromise::CreateAndResolve(true, __func__);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gmp
|
} // namespace gmp
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -73,6 +73,8 @@ public:
|
||||||
|
|
||||||
RefPtr<MediaDataDecoder::DecodePromise> Drain();
|
RefPtr<MediaDataDecoder::DecodePromise> Drain();
|
||||||
|
|
||||||
|
RefPtr<ShutdownPromise> ShutdownVideoDecoder();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~ChromiumCDMParent() {}
|
~ChromiumCDMParent() {}
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,15 @@ ChromiumCDMVideoDecoder::Drain()
|
||||||
RefPtr<ShutdownPromise>
|
RefPtr<ShutdownPromise>
|
||||||
ChromiumCDMVideoDecoder::Shutdown()
|
ChromiumCDMVideoDecoder::Shutdown()
|
||||||
{
|
{
|
||||||
return ShutdownPromise::CreateAndResolve(true, __func__);
|
if (!mCDMParent) {
|
||||||
|
// Must have failed to get the CDMParent from the ChromiumCDMProxy
|
||||||
|
// in our constructor; the MediaKeys must have shut down the CDM
|
||||||
|
// before we had a chance to start up the decoder.
|
||||||
|
return ShutdownPromise::CreateAndResolve(true, __func__);
|
||||||
|
}
|
||||||
|
RefPtr<gmp::ChromiumCDMParent> cdm = mCDMParent;
|
||||||
|
return InvokeAsync(
|
||||||
|
mGMPThread, __func__, [cdm]() { return cdm->ShutdownVideoDecoder(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
Загрузка…
Ссылка в новой задаче