summaryrefslogtreecommitdiff
path: root/dom/media/MediaDecoder.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-04-20 12:37:57 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-04-20 12:37:57 -0500
commit7c598437c237a3a6da4f74f611bc2f043c32abc7 (patch)
treed6352487c1d32b06928f43344d41ba1ca1b0fac7 /dom/media/MediaDecoder.cpp
parent87dabd4e0b724bb81db3eaeefa09cfd2c5545a36 (diff)
downloadaura-central-7c598437c237a3a6da4f74f611bc2f043c32abc7.tar.gz
Issue #1 - Restore EME (but not the configure logic to enable it)
Diffstat (limited to 'dom/media/MediaDecoder.cpp')
-rw-r--r--dom/media/MediaDecoder.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index ebc694b47..10b97f7e6 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -386,6 +386,9 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, mLogicalPosition(0.0)
, mDuration(std::numeric_limits<double>::quiet_NaN())
, mResourceCallback(new ResourceCallback())
+#ifdef MOZ_EME
+ , mCDMProxyPromise(mCDMProxyPromiseHolder.Ensure(__func__))
+#endif
, mIgnoreProgressData(false)
, mInfiniteStream(false)
, mOwner(aOwner)
@@ -470,6 +473,10 @@ MediaDecoder::Shutdown()
mResourceCallback->Disconnect();
+#ifdef MOZ_EME
+ mCDMProxyPromiseHolder.RejectIfExists(true, __func__);
+#endif
+
DiscardOngoingSeekIfExists();
// This changes the decoder state to SHUTDOWN and does other things
@@ -1540,6 +1547,23 @@ MediaDecoder::CanPlayThrough()
return GetStatistics().CanPlayThrough();
}
+#ifdef MOZ_EME
+RefPtr<MediaDecoder::CDMProxyPromise>
+MediaDecoder::RequestCDMProxy() const
+{
+ return mCDMProxyPromise;
+}
+
+void
+MediaDecoder::SetCDMProxy(CDMProxy* aProxy)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ MOZ_ASSERT(aProxy);
+
+ mCDMProxyPromiseHolder.ResolveIfExists(aProxy, __func__);
+}
+#endif
+
bool
MediaDecoder::IsOpusEnabled()
{