summaryrefslogtreecommitdiff
path: root/dom/media/MediaFormatReader.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-04-21 02:18:57 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-04-21 02:18:57 -0500
commit9b03443b6a227c09e62fa393d4a413005691f8ad (patch)
tree83ca0d8978735cdf8741342a248eec38c0b17c78 /dom/media/MediaFormatReader.cpp
parent0c7843d82b2ac8d73c0a6fb69865d086fc1f81b2 (diff)
downloadaura-central-9b03443b6a227c09e62fa393d4a413005691f8ad.tar.gz
Issue #25 - Part 13: Remove EME from dom/media and HTMLMediaElement.webidl
Diffstat (limited to 'dom/media/MediaFormatReader.cpp')
-rw-r--r--dom/media/MediaFormatReader.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp
index 98ba57a6e..b9289e82a 100644
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -3,10 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifdef MOZ_EME
-#include "mozilla/CDMProxy.h"
-#endif
-
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h"
@@ -351,12 +347,7 @@ MediaFormatReader::DecoderFactory::DoCreateDecoder(TrackType aTrack)
if (!mOwner->mPlatform) {
mOwner->mPlatform = new PDMFactory();
if (mOwner->IsEncrypted()) {
-#ifdef MOZ_EME
- MOZ_ASSERT(mOwner->mCDMProxy);
- mOwner->mPlatform->SetCDMProxy(mOwner->mCDMProxy);
-#else
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, "EME not supported");
-#endif
}
}
@@ -586,54 +577,10 @@ MediaFormatReader::InitInternal()
return NS_OK;
}
-#ifdef MOZ_EME
-class DispatchKeyNeededEvent : public Runnable {
-public:
- DispatchKeyNeededEvent(AbstractMediaDecoder* aDecoder,
- nsTArray<uint8_t>& aInitData,
- const nsString& aInitDataType)
- : mDecoder(aDecoder)
- , mInitData(aInitData)
- , mInitDataType(aInitDataType)
- {
- }
- NS_IMETHOD Run() override {
- // Note: Null check the owner, as the decoder could have been shutdown
- // since this event was dispatched.
- MediaDecoderOwner* owner = mDecoder->GetOwner();
- if (owner) {
- owner->DispatchEncrypted(mInitData, mInitDataType);
- }
- mDecoder = nullptr;
- return NS_OK;
- }
-private:
- RefPtr<AbstractMediaDecoder> mDecoder;
- nsTArray<uint8_t> mInitData;
- nsString mInitDataType;
-};
-
-void
-MediaFormatReader::SetCDMProxy(CDMProxy* aProxy)
-{
- RefPtr<CDMProxy> proxy = aProxy;
- RefPtr<MediaFormatReader> self = this;
- nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
- MOZ_ASSERT(self->OnTaskQueue());
- self->mCDMProxy = proxy;
- });
- OwnerThread()->Dispatch(r.forget());
-}
-#endif // MOZ_EME
-
bool
MediaFormatReader::IsWaitingOnCDMResource() {
MOZ_ASSERT(OnTaskQueue());
-#ifdef MOZ_EME
- return IsEncrypted() && !mCDMProxy;
-#else
return false;
-#endif
}
RefPtr<MediaDecoderReader::MetadataPromise>
@@ -740,13 +687,6 @@ MediaFormatReader::OnDemuxerInitDone(nsresult)
UniquePtr<EncryptionInfo> crypto = mDemuxer->GetCrypto();
if (mDecoder && crypto && crypto->IsEncrypted()) {
-#ifdef MOZ_EME
- // Try and dispatch 'encrypted'. Won't go if ready state still HAVE_NOTHING.
- for (uint32_t i = 0; i < crypto->mInitDatas.Length(); i++) {
- NS_DispatchToMainThread(
- new DispatchKeyNeededEvent(mDecoder, crypto->mInitDatas[i].mInitData, crypto->mInitDatas[i].mType));
- }
-#endif
mInfo.mCrypto = *crypto;
}