summaryrefslogtreecommitdiff
path: root/dom/media
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-10-17 12:56:22 +0200
committerMoonchild <moonchild@palemoon.org>2023-10-17 16:37:41 +0200
commit08406731e57a357418190043eaa83e5d27c11dd0 (patch)
treefd34b63b0ae134e7fcef0dac433edff861740f0c /dom/media
parent60b4d804bd8f29582df32db7e862e1e91b221e69 (diff)
downloaduxp-08406731e57a357418190043eaa83e5d27c11dd0.tar.gz
Issue #2346 - Remove MOZ_EME conditional code
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/AbstractMediaDecoder.h3
-rw-r--r--dom/media/MediaDecoder.cpp24
-rw-r--r--dom/media/MediaDecoder.h19
-rw-r--r--dom/media/MediaDecoderOwner.h8
-rw-r--r--dom/media/MediaDecoderReader.h7
-rw-r--r--dom/media/MediaDecoderReaderWrapper.h4
-rw-r--r--dom/media/MediaDecoderStateMachine.cpp37
-rw-r--r--dom/media/MediaDecoderStateMachine.h7
-rw-r--r--dom/media/MediaFormatReader.cpp61
-rw-r--r--dom/media/MediaFormatReader.h16
-rw-r--r--dom/media/MediaPrefs.h3
-rw-r--r--dom/media/fmp4/MP4Decoder.cpp3
-rw-r--r--dom/media/gmp/GMPChild.cpp9
-rw-r--r--dom/media/gmp/GMPDecryptorParent.cpp8
-rw-r--r--dom/media/gmp/GMPDecryptorProxy.h8
-rw-r--r--dom/media/gmp/GMPParent.cpp56
-rw-r--r--dom/media/gmp/moz.build15
-rw-r--r--dom/media/gtest/MockMediaDecoderOwner.h4
-rw-r--r--dom/media/mediasource/TrackBuffersManager.cpp36
-rw-r--r--dom/media/moz.build3
-rw-r--r--dom/media/platforms/PDMFactory.cpp14
-rw-r--r--dom/media/platforms/PDMFactory.h13
-rw-r--r--dom/media/platforms/PlatformDecoderModule.h3
-rw-r--r--dom/media/platforms/moz.build3
-rwxr-xr-xdom/media/webaudio/AudioContext.cpp7
25 files changed, 2 insertions, 369 deletions
diff --git a/dom/media/AbstractMediaDecoder.h b/dom/media/AbstractMediaDecoder.h
index c6aa997553..108f7a57f7 100644
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -32,9 +32,6 @@ class MediaResource;
class ReentrantMonitor;
class VideoFrameContainer;
class MediaDecoderOwner;
-#ifdef MOZ_EME
-class CDMProxy;
-#endif
typedef nsDataHashtable<nsCStringHashKey, nsCString> MetadataTags;
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index 87454a4686..921ec6bfbf 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -388,9 +388,6 @@ 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)
@@ -475,10 +472,6 @@ MediaDecoder::Shutdown()
mResourceCallback->Disconnect();
-#ifdef MOZ_EME
- mCDMProxyPromiseHolder.RejectIfExists(true, __func__);
-#endif
-
DiscardOngoingSeekIfExists();
// This changes the decoder state to SHUTDOWN and does other things
@@ -1551,23 +1544,6 @@ 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()
{
diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h
index 95f211e1c5..d54ba30de5 100644
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -8,10 +8,6 @@
#include "mozilla/Atomics.h"
-#ifdef MOZ_EME
-#include "mozilla/CDMProxy.h"
-#endif
-
#include "mozilla/MozPromise.h"
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/StateMirroring.h"
@@ -437,16 +433,6 @@ private:
MediaDecoderOwner* GetOwner() const override;
-#ifdef MOZ_EME
- typedef MozPromise<RefPtr<CDMProxy>, bool /* aIgnored */, /* IsExclusive = */ true> CDMProxyPromise;
-
- // Resolved when a CDMProxy is available and the capabilities are known or
- // rejected when this decoder is about to shut down.
- RefPtr<CDMProxyPromise> RequestCDMProxy() const;
-
- void SetCDMProxy(CDMProxy* aProxy);
-#endif
-
static bool IsOggEnabled();
static bool IsOpusEnabled();
static bool IsWaveEnabled();
@@ -596,11 +582,6 @@ private:
RefPtr<ResourceCallback> mResourceCallback;
-#ifdef MOZ_EME
- MozPromiseHolder<CDMProxyPromise> mCDMProxyPromiseHolder;
- RefPtr<CDMProxyPromise> mCDMProxyPromise;
-#endif
-
protected:
// The promise resolving/rejection is queued as a "micro-task" which will be
// handled immediately after the current JS task and before any pending JS
diff --git a/dom/media/MediaDecoderOwner.h b/dom/media/MediaDecoderOwner.h
index 9be4be3d0b..50a29d0951 100644
--- a/dom/media/MediaDecoderOwner.h
+++ b/dom/media/MediaDecoderOwner.h
@@ -141,14 +141,6 @@ public:
// The decoder owner should call Shutdown() on the decoder and drop the
// reference to the decoder to prevent further calls into the decoder.
virtual void NotifyXPCOMShutdown() = 0;
-
-#ifdef MOZ_EME
- // Dispatches a "encrypted" event to the HTMLMediaElement, with the
- // provided init data. Actual dispatch may be delayed until HAVE_METADATA.
- // Main thread only.
- virtual void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
- const nsAString& aInitDataType) = 0;
-#endif
};
} // namespace mozilla
diff --git a/dom/media/MediaDecoderReader.h b/dom/media/MediaDecoderReader.h
index dd406ed90e..3a3e2ceb82 100644
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -24,9 +24,6 @@
namespace mozilla {
-#ifdef MOZ_EME
-class CDMProxy;
-#endif
class MediaDecoderReader;
struct WaitForDataRejectValue
@@ -188,10 +185,6 @@ public:
// when to call SetIdle().
virtual void SetIdle() {}
-#ifdef MOZ_EME
- virtual void SetCDMProxy(CDMProxy* aProxy) {}
-#endif
-
// Tell the reader that the data decoded are not for direct playback, so it
// can accept more files, in particular those which have more channels than
// available in the audio output.
diff --git a/dom/media/MediaDecoderReaderWrapper.h b/dom/media/MediaDecoderReaderWrapper.h
index a0f845538e..c85c93d44f 100644
--- a/dom/media/MediaDecoderReaderWrapper.h
+++ b/dom/media/MediaDecoderReaderWrapper.h
@@ -112,10 +112,6 @@ public:
return mReader->CanonicalBuffered();
}
-#ifdef MOZ_EME
- void SetCDMProxy(CDMProxy* aProxy) { mReader->SetCDMProxy(aProxy); }
-#endif
-
void SetVideoBlankDecode(bool aIsBlankDecode);
private:
diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp
index b84a76d624..218bddc4ac 100644
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1238,11 +1238,7 @@ DecodeMetadataState::OnMetadataRead(MetadataHolder* aMetadata)
// thus get the metadata). We could fix this if we could compute the start
// time by demuxing without necessaring decoding.
bool waitingForCDM =
-#ifdef MOZ_EME
- mMaster->Info().IsEncrypted() && !mMaster->mCDMProxy;
-#else
false;
-#endif
mMaster->mNotifyMetadataBeforeFirstFrame =
mMaster->mDuration.Ref().isSome() || waitingForCDM;
@@ -1266,9 +1262,6 @@ DormantState::HandlePlayStateChanged(MediaDecoder::PlayState aPlayState)
{
if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
// Exit dormant when the user wants to play.
-#ifdef MOZ_EME
- MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
-#endif
MOZ_ASSERT(mMaster->mSentFirstFrameLoadedEvent);
SetState<SeekingState>(Move(mPendingSeek), EventVisibility::Suppressed);
}
@@ -1581,10 +1574,6 @@ ShutdownState::Enter()
// dispose of the timer.
master->mVideoDecodeSuspendTimer.Reset();
-#ifdef MOZ_EME
- master->mCDMProxyPromise.DisconnectIfExists();
-#endif
-
if (master->IsPlaying()) {
master->StopPlayback();
}
@@ -2137,13 +2126,6 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder)
mMediaSink = CreateMediaSink(mAudioCaptured);
-#ifdef MOZ_EME
- mCDMProxyPromise.Begin(aDecoder->RequestCDMProxy()->Then(
- OwnerThread(), __func__, this,
- &MediaDecoderStateMachine::OnCDMProxyReady,
- &MediaDecoderStateMachine::OnCDMProxyNotReady));
-#endif
-
nsresult rv = mReader->Init();
NS_ENSURE_SUCCESS(rv, rv);
@@ -3118,25 +3100,6 @@ void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult)
DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, __func__));
}
-#ifdef MOZ_EME
-void
-MediaDecoderStateMachine::OnCDMProxyReady(RefPtr<CDMProxy> aProxy)
-{
- MOZ_ASSERT(OnTaskQueue());
- mCDMProxyPromise.Complete();
- mCDMProxy = aProxy;
- mReader->SetCDMProxy(aProxy);
- mStateObj->HandleCDMProxyReady();
-}
-
-void
-MediaDecoderStateMachine::OnCDMProxyNotReady()
-{
- MOZ_ASSERT(OnTaskQueue());
- mCDMProxyPromise.Complete();
-}
-#endif
-
void
MediaDecoderStateMachine::SetAudioCaptured(bool aCaptured)
{
diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h
index 29da56e57d..6391c85740 100644
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -767,13 +767,6 @@ private:
// Playback will not start when audio is offloading.
bool mAudioOffloading;
-#ifdef MOZ_EME
- void OnCDMProxyReady(RefPtr<CDMProxy> aProxy);
- void OnCDMProxyNotReady();
- RefPtr<CDMProxy> mCDMProxy;
- MozPromiseRequestHolder<MediaDecoder::CDMProxyPromise> mCDMProxyPromise;
-#endif
-
private:
// The buffered range. Mirrored from the decoder thread.
Mirror<media::TimeIntervals> mBuffered;
diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp
index a658298e2d..2bdd2621ac 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
}
}
@@ -592,54 +583,11 @@ 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
+ /* EME stub */
return false;
-#endif
}
RefPtr<MediaDecoderReader::MetadataPromise>
@@ -746,13 +694,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;
}
diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h
index ccd43f0e6a..4e084f4158 100644
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -19,10 +19,6 @@
namespace mozilla {
-#ifdef MOZ_EME
-class CDMProxy;
-#endif
-
class MediaFormatReader final : public MediaDecoderReader
{
typedef TrackInfo::TrackType TrackType;
@@ -92,10 +88,6 @@ public:
return mTrackDemuxersMayBlock;
}
-#ifdef MOZ_EME
- void SetCDMProxy(CDMProxy* aProxy) override;
-#endif
-
// Returns a string describing the state of the decoder data.
// Used for debugging purposes.
void GetMozDebugReaderData(nsAString& aString);
@@ -587,14 +579,6 @@ private:
RefPtr<VideoFrameContainer> mVideoFrameContainer;
layers::ImageContainer* GetImageContainer();
-#ifdef MOZ_EME
- RefPtr<CDMProxy> mCDMProxy;
-#endif
-
-#ifdef MOZ_GMP
- RefPtr<GMPCrashHelper> mCrashHelper;
-#endif
-
void SetBlankDecode(TrackType aTrack, bool aIsBlankDecode);
class DecoderFactory;
diff --git a/dom/media/MediaPrefs.h b/dom/media/MediaPrefs.h
index 675518ba62..40d0971d80 100644
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -102,9 +102,6 @@ private:
DECL_MEDIA_PREF("media.gmp.insecure.allow", GMPAllowInsecure, bool, false);
DECL_MEDIA_PREF("media.gmp.async-shutdown-timeout", GMPAsyncShutdownTimeout, uint32_t, GMP_DEFAULT_ASYNC_SHUTDOWN_TIMEOUT);
#endif
-#ifdef MOZ_EME
- DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
-#endif
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
#ifdef MOZ_FFMPEG
diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp
index 3cfe5b1374..ed212992c0 100644
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -9,9 +9,6 @@
#include "MP4Demuxer.h"
#include "mozilla/Preferences.h"
#include "nsCharSeparatedTokenizer.h"
-#ifdef MOZ_EME
-#include "mozilla/CDMProxy.h"
-#endif
#include "mozilla/Logging.h"
#include "mozilla/SharedThreadPool.h"
#include "nsMimeTypes.h"
diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp
index fa6f2f4c83..0bf9d44036 100644
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -22,9 +22,6 @@
#include "GMPUtils.h"
#include "prio.h"
#include "base/task.h"
-#ifdef MOZ_EME
-#include "widevine-adapter/WidevineAdapter.h"
-#endif
using namespace mozilla::ipc;
@@ -256,13 +253,7 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
return false;
}
-#ifdef MOZ_EME
- bool isWidevine = aAdapter.EqualsLiteral("widevine");
-
- GMPAdapter* adapter = (isWidevine) ? new WidevineAdapter() : nullptr;
-#else
GMPAdapter* adapter = nullptr;
-#endif
if (!mGMPLoader->Load(libPath.get(),
libPath.Length(),
mNodeId.BeginWriting(),
diff --git a/dom/media/gmp/GMPDecryptorParent.cpp b/dom/media/gmp/GMPDecryptorParent.cpp
index 56474e9736..410868c33b 100644
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -45,13 +45,7 @@ GMPDecryptorParent::~GMPDecryptorParent()
bool
GMPDecryptorParent::RecvSetDecryptorId(const uint32_t& aId)
{
-#ifdef MOZ_EME
- if (!mIsOpen) {
- NS_WARNING("Trying to use a dead GMP decrypter!");
- return false;
- }
- mCallback->SetDecryptorId(aId);
-#endif
+ /* EME stub */
return true;
}
diff --git a/dom/media/gmp/GMPDecryptorProxy.h b/dom/media/gmp/GMPDecryptorProxy.h
index ed16755f89..f9e34a45fd 100644
--- a/dom/media/gmp/GMPDecryptorProxy.h
+++ b/dom/media/gmp/GMPDecryptorProxy.h
@@ -6,9 +6,6 @@
#ifndef GMPDecryptorProxy_h_
#define GMPDecryptorProxy_h_
-#ifdef MOZ_EME
-#include "mozilla/DecryptorProxyCallback.h"
-#endif
#include "GMPCallbackBase.h"
#include "gmp-decryption.h"
#include "nsString.h"
@@ -17,12 +14,7 @@ namespace mozilla {
class CryptoSample;
} // namespace mozilla
-#ifdef MOZ_EME
-class GMPDecryptorProxyCallback : public DecryptorProxyCallback,
- public GMPCallbackBase {
-#else
class GMPDecryptorProxyCallback : public GMPCallbackBase {
-#endif
public:
virtual ~GMPDecryptorProxyCallback() {}
diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp
index e6f7972649..c4a7a84a09 100644
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -28,11 +28,6 @@ using mozilla::ipc::GeckoChildProcessHost;
#include "WMFDecoderModule.h"
#endif
-#ifdef MOZ_EME
-#include "mozilla/dom/WidevineCDMManifestBinding.h"
-#include "widevine-adapter/WidevineAdapter.h"
-#endif
-
namespace mozilla {
#undef LOG
@@ -654,18 +649,7 @@ GMPParent::ReadGMPMetaData()
return ReadGMPInfoFile(infoFile);
}
-#ifdef MOZ_EME
- // Maybe this is the Widevine adapted plugin?
- nsCOMPtr<nsIFile> manifestFile;
- rv = mDirectory->Clone(getter_AddRefs(manifestFile));
- if (NS_FAILED(rv)) {
- return GenericPromise::CreateAndReject(rv, __func__);
- }
- manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json"));
- return ReadChromiumManifestFile(manifestFile);
-#else
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
-#endif
}
RefPtr<GenericPromise>
@@ -758,48 +742,8 @@ GMPParent::ReadChromiumManifestFile(nsIFile* aFile)
RefPtr<GenericPromise>
GMPParent::ParseChromiumManifest(nsString aJSON)
{
-#ifdef MOZ_EME
- LOGD("%s: for '%s'", __FUNCTION__, NS_LossyConvertUTF16toASCII(aJSON).get());
-
- MOZ_ASSERT(NS_IsMainThread());
- mozilla::dom::WidevineCDMManifest m;
- if (!m.Init(aJSON)) {
- return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
- }
-
- nsresult ignored; // Note: ToInteger returns 0 on failure.
- if (!WidevineAdapter::Supports(m.mX_cdm_module_versions.ToInteger(&ignored),
- m.mX_cdm_interface_versions.ToInteger(&ignored),
- m.mX_cdm_host_versions.ToInteger(&ignored))) {
- return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
- }
-
- mDisplayName = NS_ConvertUTF16toUTF8(m.mName);
- mDescription = NS_ConvertUTF16toUTF8(m.mDescription);
- mVersion = NS_ConvertUTF16toUTF8(m.mVersion);
-
- GMPCapability video(NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER));
- video.mAPITags.AppendElement(NS_LITERAL_CSTRING("h264"));
- video.mAPITags.AppendElement(NS_LITERAL_CSTRING("vp8"));
- video.mAPITags.AppendElement(NS_LITERAL_CSTRING("vp9"));
- video.mAPITags.AppendElement(kEMEKeySystemWidevine);
- mCapabilities.AppendElement(Move(video));
-
- GMPCapability decrypt(NS_LITERAL_CSTRING(GMP_API_DECRYPTOR));
- decrypt.mAPITags.AppendElement(kEMEKeySystemWidevine);
- mCapabilities.AppendElement(Move(decrypt));
-
- MOZ_ASSERT(mName.EqualsLiteral("widevinecdm"));
- mAdapter = NS_LITERAL_STRING("widevine");
-#ifdef XP_WIN
- mLibs = NS_LITERAL_CSTRING("dxva2.dll");
-#endif
-
- return GenericPromise::CreateAndResolve(true, __func__);
-#else // !MOZ_EME
MOZ_ASSERT_UNREACHABLE("don't call me if EME isn't enabled");
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
-#endif // !MOZ_EME
}
bool
diff --git a/dom/media/gmp/moz.build b/dom/media/gmp/moz.build
index c4da2573fb..82d091168d 100644
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -70,12 +70,6 @@ EXPORTS += [
'GMPVideoPlaneImpl.h',
]
-if CONFIG['MOZ_EME']:
- EXPORTS += [
- 'GMPCDMCallbackProxy.h',
- 'GMPCDMProxy.h',
- ]
-
UNIFIED_SOURCES += [
'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp',
@@ -111,17 +105,8 @@ UNIFIED_SOURCES += [
'GMPVideoPlaneImpl.cpp',
]
-if CONFIG['MOZ_EME']:
- UNIFIED_SOURCES += [
- 'GMPCDMCallbackProxy.cpp',
- 'GMPCDMProxy.cpp',
- ]
-
DIRS += ['rlz']
-if CONFIG['MOZ_EME']:
- DIRS += ['widevine-adapter']
-
IPDL_SOURCES += [
'GMPTypes.ipdlh',
'PGMP.ipdl',
diff --git a/dom/media/gtest/MockMediaDecoderOwner.h b/dom/media/gtest/MockMediaDecoderOwner.h
index 1009ca30a1..64d7290187 100644
--- a/dom/media/gtest/MockMediaDecoderOwner.h
+++ b/dom/media/gtest/MockMediaDecoderOwner.h
@@ -34,10 +34,6 @@ public:
void DownloadProgressed() override {}
void UpdateReadyState() override {}
void FirstFrameLoaded() override {}
-#ifdef MOZ_EME
- void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
- const nsAString& aInitDataType) override {}
-#endif
bool IsActive() const override { return true; }
bool IsHidden() const override { return false; }
void DownloadSuspended() override {}
diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp
index 022bb5bd10..907ee40e8f 100644
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -58,34 +58,6 @@ AppendStateToStr(SourceBufferAttributes::AppendState aState)
static Atomic<uint32_t> sStreamSourceID(0u);
-#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;
-};
-#endif // MOZ_EME
-
TrackBuffersManager::TrackBuffersManager(MediaSourceDecoder* aParentDecoder,
const nsACString& aType)
: mInputBuffer(new MediaByteBuffer)
@@ -1101,14 +1073,6 @@ TrackBuffersManager::OnDemuxerInitDone(nsresult)
UniquePtr<EncryptionInfo> crypto = mInputDemuxer->GetCrypto();
if (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(mParentDecoder, crypto->mInitDatas[i].mInitData,
- crypto->mInitDatas[i].mType));
- }
-#endif
info.mCrypto = *crypto;
// We clear our crypto init data array, so the MediaFormatReader will
// not emit an encrypted event for the same init data again.
diff --git a/dom/media/moz.build b/dom/media/moz.build
index ef018d4a75..ca3cdac1ca 100644
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -44,9 +44,6 @@ if CONFIG['MOZ_FMP4']:
if CONFIG['MOZ_WEBRTC']:
DIRS += ['bridge']
-if CONFIG['MOZ_EME']:
- DIRS += ['eme']
-
if CONFIG['MOZ_GMP']:
DIRS += [
'gmp',
diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp
index 029b88cecb..389b151994 100644
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -35,11 +35,6 @@
#include "AgnosticDecoderModule.h"
-#ifdef MOZ_EME
-#include "mozilla/CDMProxy.h"
-#include "EMEDecoderModule.h"
-#endif
-
#include "DecoderDoctorDiagnostics.h"
#include "MP4Decoder.h"
@@ -444,13 +439,4 @@ PDMFactory::GetDecoder(const TrackInfo& aTrackInfo,
return pdm.forget();
}
-#ifdef MOZ_EME
-void
-PDMFactory::SetCDMProxy(CDMProxy* aProxy)
-{
- RefPtr<PDMFactory> m = new PDMFactory();
- mEMEPDM = new EMEDecoderModule(aProxy, m);
-}
-#endif
-
} // namespace mozilla
diff --git a/dom/media/platforms/PDMFactory.h b/dom/media/platforms/PDMFactory.h
index 186c05ca4e..e288efadd0 100644
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -10,10 +10,6 @@
#include "mozilla/Function.h"
#include "mozilla/StaticMutex.h"
-#ifdef MOZ_EME
-class CDMProxy;
-#endif
-
namespace mozilla {
class DecoderDoctorDiagnostics;
@@ -39,15 +35,6 @@ public:
bool Supports(const TrackInfo& aTrackInfo,
DecoderDoctorDiagnostics* aDiagnostics) const;
-#ifdef MOZ_EME
- // Creates a PlatformDecoderModule that uses a CDMProxy to decrypt or
- // decrypt-and-decode EME encrypted content. If the CDM only decrypts and
- // does not decode, we create a PDM and use that to create MediaDataDecoders
- // that we use on on aTaskQueue to decode the decrypted stream.
- // This is called on the decode task queue.
- void SetCDMProxy(CDMProxy* aProxy);
-#endif
-
static const int kYUV400 = 0;
static const int kYUV420 = 1;
static const int kYUV422 = 2;
diff --git a/dom/media/platforms/PlatformDecoderModule.h b/dom/media/platforms/PlatformDecoderModule.h
index f2abe4b7f7..63b4e00d5c 100644
--- a/dom/media/platforms/PlatformDecoderModule.h
+++ b/dom/media/platforms/PlatformDecoderModule.h
@@ -39,9 +39,6 @@ class RemoteDecoderModule;
class MediaDataDecoder;
class MediaDataDecoderCallback;
class TaskQueue;
-#ifdef MOZ_EME
-class CDMProxy;
-#endif
static LazyLogModule sPDMLog("PlatformDecoderModule");
diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
index 09d9afa4d2..d4dc579b19 100644
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -32,9 +32,6 @@ DIRS += [
'omx'
]
-if CONFIG['MOZ_EME']:
- DIRS += ['agnostic/eme']
-
if CONFIG['MOZ_GMP']:
DIRS += ['agnostic/gmp']
diff --git a/dom/media/webaudio/AudioContext.cpp b/dom/media/webaudio/AudioContext.cpp
index 44285735be..9539133a4f 100755
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -372,13 +372,6 @@ AudioContext::CreateMediaElementSource(HTMLMediaElement& aMediaElement,
return nullptr;
}
-#ifdef MOZ_EME
- if (aMediaElement.ContainsRestrictedContent()) {
- aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
- return nullptr;
- }
-#endif
-
if (CheckClosed(aRv)) {
return nullptr;
}