Revert "Issue #2301 - Make Gecko Media Plugins optional when not building EME or WebRTC"

This reverts commit 9e7d1492e6.
This commit is contained in:
roytam1 2023-09-18 21:32:06 +08:00
commit 119feb053c
54 changed files with 30 additions and 314 deletions

View file

@ -59,9 +59,7 @@
#include "mozilla/BasePrincipal.h"
#include "mozilla/WebBrowserPersistDocumentChild.h"
#include "imgLoader.h"
#ifdef MOZ_GMP
#include "GMPServiceChild.h"
#endif
#include "mozilla/Unused.h"
@ -163,9 +161,7 @@
#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/widget/PuppetBidiKeyboard.h"
#include "mozilla/mozSpellChecker.h"
#ifdef MOZ_GMP
#include "GMPServiceChild.h"
#endif
#include "gfxPlatform.h"
#include "nscore.h" // for NS_FREE_PERMANENT_DATA
@ -175,9 +171,7 @@ using namespace mozilla::dom::ipc;
using namespace mozilla::dom::workers;
using namespace mozilla::media;
using namespace mozilla::embedding;
#ifdef MOZ_GMP
using namespace mozilla::gmp;
#endif
using namespace mozilla::hal_sandbox;
using namespace mozilla::ipc;
using namespace mozilla::layers;
@ -1129,7 +1123,6 @@ ContentChild::AllocPContentBridgeParent(mozilla::ipc::Transport* aTransport,
return mLastBridge;
}
#ifdef MOZ_GMP
PGMPServiceChild*
ContentChild::AllocPGMPServiceChild(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess)
@ -1143,7 +1136,6 @@ ContentChild::RecvGMPsChanged(nsTArray<GMPCapabilityData>&& capabilities)
GeckoMediaPluginServiceChild::UpdateGMPCapabilities(Move(capabilities));
return true;
}
#endif
bool
ContentChild::RecvInitRendering(Endpoint<PCompositorBridgeChild>&& aCompositor,

View file

@ -140,14 +140,12 @@ public:
AllocPContentBridgeChild(mozilla::ipc::Transport* transport,
base::ProcessId otherProcess) override;
#ifdef MOZ_GMP
PGMPServiceChild*
AllocPGMPServiceChild(mozilla::ipc::Transport* transport,
base::ProcessId otherProcess) override;
bool
RecvGMPsChanged(nsTArray<GMPCapabilityData>&& capabilities) override;
#endif
bool
RecvInitRendering(

View file

@ -21,9 +21,7 @@
#include "AppProcessChecker.h"
#include "AudioChannelService.h"
#include "BlobParent.h"
#ifdef MOZ_GMP
#include "GMPServiceParent.h"
#endif
#include "HandlerServiceParent.h"
#include "IHistory.h"
#include "imgIContainer.h"
@ -233,9 +231,7 @@ using namespace mozilla::dom::power;
using namespace mozilla::media;
using namespace mozilla::embedding;
using namespace mozilla::gfx;
#ifdef MOZ_GMP
using namespace mozilla::gmp;
#endif
using namespace mozilla::hal;
using namespace mozilla::ipc;
using namespace mozilla::layers;
@ -871,13 +867,11 @@ static nsIDocShell* GetOpenerDocShellHelper(Element* aFrameElement)
return docShell;
}
#ifdef MOZ_GMP
bool
ContentParent::RecvCreateGMPService()
{
return PGMPService::Open(this);
}
#endif
bool
ContentParent::RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID)
@ -1281,10 +1275,8 @@ ContentParent::Init()
}
#endif
#ifdef MOZ_GMP
RefPtr<GeckoMediaPluginServiceParent> gmps(GeckoMediaPluginServiceParent::GetSingleton());
gmps->UpdateContentProcessGMPCapabilities();
#endif
}
void
@ -2559,14 +2551,12 @@ ContentParent::Observe(nsISupports* aSubject,
return NS_OK;
}
#ifdef MOZ_GMP
PGMPServiceParent*
ContentParent::AllocPGMPServiceParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess)
{
return GMPServiceParent::Create(aTransport, aOtherProcess);
}
#endif
PBackgroundParent*
ContentParent::AllocPBackgroundParent(Transport* aTransport,

View file

@ -237,9 +237,7 @@ public:
virtual bool RecvBridgeToChildProcess(const ContentParentId& aCpId) override;
#ifdef MOZ_GMP
virtual bool RecvCreateGMPService() override;
#endif
virtual bool RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv,
uint32_t* aRunID) override;
@ -672,11 +670,9 @@ private:
TabParent* aTopLevel, const TabId& aTabId,
uint64_t* aId);
#ifdef MOZ_GMP
PGMPServiceParent*
AllocPGMPServiceParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess) override;
#endif
PBackgroundParent*
AllocPBackgroundParent(Transport* aTransport, ProcessId aOtherProcess)

View file

@ -26,14 +26,10 @@ include protocol PNecko;
// bridging PContent and PGMP. As soon as it registers the bridge between
// PContent and PPluginModule it seems to think that PContent's parent and
// child live in the same process!
#ifdef MOZ_GMP
include protocol PGMPContent;
include protocol PGMPService;
include protocol PPluginModule;
include protocol PGMP;
#else
include protocol PPluginModule;
#endif
include protocol PPrinting;
include protocol PSendStream;
include protocol POfflineCacheUpdate;
@ -215,7 +211,6 @@ struct BlobURLRegistrationData
Principal principal;
};
#ifdef MOZ_GMP
struct GMPAPITags
{
nsCString api;
@ -228,16 +223,13 @@ struct GMPCapabilityData
nsCString version;
GMPAPITags[] capabilities;
};
#endif
nested(upto inside_cpow) sync protocol PContent
{
parent spawns PPluginModule;
parent opens PProcessHangMonitor;
#ifdef MOZ_GMP
parent opens PGMPService;
#endif
child opens PBackground;
manages PBlob;
@ -524,9 +516,8 @@ child:
async BlobURLUnregistration(nsCString aURI);
#ifdef MOZ_GMP
async GMPsChanged(GMPCapabilityData[] capabilities);
#endif
parent:
/**
@ -559,9 +550,7 @@ parent:
returns (ContentParentId cpId, bool isForApp, bool isForBrowser, TabId tabId);
sync BridgeToChildProcess(ContentParentId cpId);
#ifdef MOZ_GMP
async CreateGMPService();
#endif
/**
* This call connects the content process to a plugin process. While this

View file

@ -73,7 +73,7 @@ SOURCES += [
'ProcessHangMonitor.cpp',
]
PREPROCESSED_IPDL_SOURCES += [
IPDL_SOURCES += [
'BlobTypes.ipdlh',
'DOMTypes.ipdlh',
'PBlob.ipdl',

View file

@ -22,7 +22,6 @@ suffixes_label=Suffixes
learn_more_label=Learn More
# GMP Plugins
#ifdef MOZ_GMP
gmp_license_info=License information
gmp_privacy_info=Privacy Information
@ -33,4 +32,3 @@ eme-adobe_name=Primetime Content Decryption Module provided by Adobe Systems, In
eme-adobe_description=Play back protected web video.
widevine_description=Widevine Content Decryption Module provided by Google Inc.
#endif

View file

@ -15,7 +15,7 @@
locale/@AB_CD@/global/global.dtd (%chrome/global.dtd)
locale/@AB_CD@/global/appstrings.properties (%chrome/appstrings.properties)
locale/@AB_CD@/global/global-strres.properties (%chrome/global-strres.properties)
* locale/@AB_CD@/global/plugins.properties (%chrome/plugins.properties)
locale/@AB_CD@/global/plugins.properties (%chrome/plugins.properties)
locale/@AB_CD@/global/nsWebBrowserPersist.properties (%chrome/nsWebBrowserPersist.properties)
locale/@AB_CD@/global/xslt/xslt.properties (%chrome/xslt/xslt.properties)
locale/@AB_CD@/global/dom/dom.properties (%chrome/dom/dom.properties)

View file

@ -16,9 +16,7 @@
#include "nsDataHashtable.h"
#include "nsThreadUtils.h"
#ifdef MOZ_GMP
class GMPCrashHelper;
#endif
namespace mozilla
{
@ -112,9 +110,7 @@ public:
// Set by Reader if the current audio track can be offloaded
virtual void SetPlatformCanOffloadAudio(bool aCanOffloadAudio) {}
#ifdef MOZ_GMP
virtual already_AddRefed<GMPCrashHelper> GetCrashHelper() { return nullptr; }
#endif
// Stack based class to assist in notifying the frame statistics of
// parsed and decoded frames. Use inside video demux & decode functions

View file

@ -845,7 +845,6 @@ DecoderDoctorDiagnostics::GetDescription() const
if (mFFmpegFailedToLoad) {
s += ", Linux platform decoder failed to load";
}
#ifdef MOZ_GMP
if (mGMPPDMFailedToStartup) {
s += ", GMP PDM failed to startup";
} else if (!mGMP.IsEmpty()) {
@ -853,7 +852,6 @@ DecoderDoctorDiagnostics::GetDescription() const
s += mGMP;
s += "'";
}
#endif
break;
case eMediaKeySystemAccessRequest:
s = "key system='";

View file

@ -78,18 +78,14 @@ public:
void SetFFmpegFailedToLoad() { mFFmpegFailedToLoad = true; }
bool DidFFmpegFailToLoad() const { return mFFmpegFailedToLoad; }
#ifdef MOZ_GMP
void SetGMPPDMFailedToStartup() { mGMPPDMFailedToStartup = true; }
bool DidGMPPDMFailToStartup() const { return mGMPPDMFailedToStartup; }
#endif
void SetVideoNotSupported() { mVideoNotSupported = true; }
void SetAudioNotSupported() { mAudioNotSupported = true; }
#ifdef MOZ_GMP
void SetGMP(const nsACString& aGMP) { mGMP = aGMP; }
const nsACString& GMP() const { return mGMP; }
#endif
const nsAString& KeySystem() const { return mKeySystem; }
bool IsKeySystemSupported() const { return mIsKeySystemSupported; }
@ -123,14 +119,10 @@ private:
bool mWMFFailedToLoad = false;
bool mFFmpegFailedToLoad = false;
#ifdef MOZ_GMP
bool mGMPPDMFailedToStartup = false;
#endif
bool mVideoNotSupported = false;
bool mAudioNotSupported = false;
#ifdef MOZ_GMP
nsCString mGMP;
#endif
nsString mKeySystem;
bool mIsKeySystemSupported = false;

View file

@ -29,9 +29,7 @@
#include "mozilla/dom/VideoTrack.h"
#include "mozilla/dom/VideoTrackList.h"
#include "nsPrintfCString.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
#include "Layers.h"
#include "mozilla/layers/ShadowLayers.h"
@ -931,7 +929,6 @@ MediaDecoder::OwnerHasError() const
return mOwner->HasError();
}
#ifdef MOZ_GMP
class MediaElementGMPCrashHelper : public GMPCrashHelper
{
public:
@ -959,7 +956,6 @@ MediaDecoder::GetCrashHelper()
return mOwner->GetMediaElement() ?
MakeAndAddRef<MediaElementGMPCrashHelper>(mOwner->GetMediaElement()) : nullptr;
}
#endif
bool
MediaDecoder::IsEnded() const

View file

@ -242,9 +242,7 @@ public:
// Must be called before Shutdown().
bool OwnerHasError() const;
#ifdef MOZ_GMP
already_AddRefed<GMPCrashHelper> GetCrashHelper() override;
#endif
protected:
// Updates the media duration. This is called while the media is being

View file

@ -365,9 +365,7 @@ MediaFormatReader::DecoderFactory::DoCreateDecoder(TrackType aTrack)
: *ownerData.mOriginalInfo->GetAsAudioInfo(),
ownerData.mTaskQueue,
ownerData.mCallback.get(),
#ifdef MOZ_GMP
mOwner->mCrashHelper,
#endif
ownerData.mIsBlankDecode,
&result
});
@ -385,9 +383,7 @@ MediaFormatReader::DecoderFactory::DoCreateDecoder(TrackType aTrack)
ownerData.mCallback.get(),
mOwner->mKnowsCompositor,
mOwner->GetImageContainer(),
#ifdef MOZ_GMP
mOwner->mCrashHelper,
#endif
ownerData.mIsBlankDecode,
&result
});
@ -580,11 +576,9 @@ MediaFormatReader::InitInternal()
mVideo.mTaskQueue =
new TaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER));
#ifdef MOZ_GMP
// Note: GMPCrashHelper must be created on main thread, as it may use
// weak references, which aren't threadsafe.
mCrashHelper = mDecoder->GetCrashHelper();
#endif
return NS_OK;
}

View file

@ -585,9 +585,7 @@ private:
RefPtr<CDMProxy> mCDMProxy;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mCrashHelper;
#endif
void SetBlankDecode(TrackType aTrack, bool aIsBlankDecode);

View file

@ -35,9 +35,7 @@ static StripAtomic<Type> Get##Name##PrefDefault() { return Default; } \
PrefTemplate<Type, Get##Name##PrefDefault, Get##Name##PrefName> mPref##Name
// Custom Definitions.
#ifdef MOZ_GMP
#define GMP_DEFAULT_ASYNC_SHUTDOWN_TIMEOUT 3000
#endif
#define SUSPEND_BACKGROUND_VIDEO_DELAY_MS 10000
#define TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE "media.webspeech.test.fake_recognition_service"
@ -98,13 +96,9 @@ private:
// PlatformDecoderModule
DECL_MEDIA_PREF("media.apple.forcevda", AppleForceVDA, bool, false);
#ifdef MOZ_GMP
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
@ -130,11 +124,9 @@ private:
DECL_MEDIA_PREF("media.decoder.fuzzing.enabled", PDMFuzzingEnabled, bool, false);
DECL_MEDIA_PREF("media.decoder.fuzzing.video-output-minimum-interval-ms", PDMFuzzingInterval, uint32_t, 0);
DECL_MEDIA_PREF("media.decoder.fuzzing.dont-delay-inputexhausted", PDMFuzzingDelayInputExhausted, bool, true);
#ifdef MOZ_GMP
DECL_MEDIA_PREF("media.gmp.decoder.enabled", PDMGMPEnabled, bool, true);
DECL_MEDIA_PREF("media.gmp.decoder.aac", GMPAACPreferred, uint32_t, 0);
DECL_MEDIA_PREF("media.gmp.decoder.h264", GMPH264Preferred, uint32_t, 0);
#endif
// MediaDecoderStateMachine
DECL_MEDIA_PREF("media.suspend-bkgnd-video.enabled", MDSMSuspendBackgroundVideoEnabled, bool, false);

View file

@ -10,6 +10,9 @@ UNIFIED_SOURCES += [
'TestAudioMixer.cpp',
'TestAudioPacketizer.cpp',
'TestAudioSegment.cpp',
'TestGMPCrossOrigin.cpp',
'TestGMPRemoveAndDelete.cpp',
'TestGMPUtils.cpp',
'TestIntervalSet.cpp',
'TestMediaDataDecoder.cpp',
'TestMediaEventSource.cpp',
@ -24,13 +27,6 @@ UNIFIED_SOURCES += [
'TestWebMBuffered.cpp',
]
if CONFIG['MOZ_GMP']:
UNIFIED_SOURCES += [
'TestGMPCrossOrigin.cpp',
'TestGMPRemoveAndDelete.cpp',
'TestGMPUtils.cpp',
]
if CONFIG['MOZ_WEBM_ENCODER']:
UNIFIED_SOURCES += [
'TestVideoTrackEncoder.cpp',
@ -63,15 +59,11 @@ LOCAL_INCLUDES += [
'/dom/media',
'/dom/media/encoder',
'/dom/media/fmp4',
'/dom/media/gmp',
'/security/certverifier',
'/security/pkix/include',
]
if CONFIG['MOZ_GMP']:
LOCAL_INCLUDES += [
'/dom/media/gmp',
]
FINAL_LIBRARY = 'xul-gtest'
if CONFIG['GNU_CXX']:

View file

@ -21,6 +21,9 @@ with Files('GetUserMedia*'):
DIRS += [
'encoder',
'flac',
'gmp',
'gmp-plugin',
'gmp-plugin-openh264',
'imagecapture',
'ipc',
'mediasink',
@ -47,13 +50,6 @@ if CONFIG['MOZ_WEBRTC']:
if CONFIG['MOZ_EME']:
DIRS += ['eme']
if CONFIG['MOZ_GMP']:
DIRS += [
'gmp',
'gmp-plugin',
'gmp-plugin-openh264',
]
TEST_DIRS += [
'gtest',
]

View file

@ -18,9 +18,7 @@
#ifdef MOZ_APPLEMEDIA
#include "AppleDecoderModule.h"
#endif
#ifdef MOZ_GMP
#include "GMPDecoderModule.h"
#endif
#include "mozilla/CDMProxy.h"
#include "mozilla/ClearOnShutdown.h"
@ -223,11 +221,9 @@ PDMFactory::CreateDecoder(const CreateDecoderParams& aParams)
if (mFFmpegFailedToLoad) {
diagnostics->SetFFmpegFailedToLoad();
}
#ifdef MOZ_GMP
if (mGMPPDMFailedToStartup) {
diagnostics->SetGMPPDMFailedToStartup();
}
#endif
}
for (auto& current : mCurrentPDMs) {
@ -397,14 +393,12 @@ PDMFactory::CreatePDMs()
m = new AgnosticDecoderModule();
StartupPDM(m);
#ifdef MOZ_GMP
if (MediaPrefs::PDMGMPEnabled()) {
m = new GMPDecoderModule();
mGMPPDMFailedToStartup = !StartupPDM(m);
} else {
mGMPPDMFailedToStartup = false;
}
#endif
}
void
@ -437,11 +431,9 @@ PDMFactory::GetDecoder(const TrackInfo& aTrackInfo,
if (mFFmpegFailedToLoad) {
aDiagnostics->SetFFmpegFailedToLoad();
}
#ifdef MOZ_GMP
if (mGMPPDMFailedToStartup) {
aDiagnostics->SetGMPPDMFailedToStartup();
}
#endif
}
RefPtr<PlatformDecoderModule> pdm;

View file

@ -70,9 +70,7 @@ private:
bool mWMFFailedToLoad = false;
bool mFFmpegFailedToLoad = false;
#ifdef MOZ_GMP
bool mGMPPDMFailedToStartup = false;
#endif
void EnsureInit() const;
template<class T> friend class StaticAutoPtr;

View file

@ -16,9 +16,7 @@
#include "mozilla/layers/KnowsCompositor.h"
#include "nsTArray.h"
#include "mozilla/RefPtr.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
#include <queue>
#include "MediaResult.h"
@ -40,9 +38,7 @@ class RemoteDecoderModule;
class MediaDataDecoder;
class MediaDataDecoderCallback;
class TaskQueue;
#ifdef MOZ_EME
class CDMProxy;
#endif
static LazyLogModule sPDMLog("PlatformDecoderModule");
@ -85,9 +81,7 @@ struct MOZ_STACK_CLASS CreateDecoderParams final {
layers::ImageContainer* mImageContainer = nullptr;
MediaResult* mError = nullptr;
RefPtr<layers::KnowsCompositor> mKnowsCompositor;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mCrashHelper;
#endif
bool mUseBlankDecoder = false;
private:
@ -96,9 +90,7 @@ private:
void Set(DecoderDoctorDiagnostics* aDiagnostics) { mDiagnostics = aDiagnostics; }
void Set(layers::ImageContainer* aImageContainer) { mImageContainer = aImageContainer; }
void Set(MediaResult* aError) { mError = aError; }
#ifdef MOZ_GMP
void Set(GMPCrashHelper* aCrashHelper) { mCrashHelper = aCrashHelper; }
#endif
void Set(bool aUseBlankDecoder) { mUseBlankDecoder = aUseBlankDecoder; }
void Set(layers::KnowsCompositor* aKnowsCompositor) { mKnowsCompositor = aKnowsCompositor; }
template <typename T1, typename T2, typename... Ts>

View file

@ -29,15 +29,13 @@ UNIFIED_SOURCES += [
]
DIRS += [
'agnostic/gmp',
'omx'
]
if CONFIG['MOZ_EME']:
DIRS += ['agnostic/eme']
if CONFIG['MOZ_GMP']:
DIRS += ['agnostic/gmp']
if CONFIG['MOZ_WMF']:
DIRS += [ 'wmf' ];

View file

@ -25,9 +25,7 @@
#include "IMFYCbCrImage.h"
#include "mozilla/WindowsVersion.h"
#include "nsPrintfCString.h"
#ifdef MOZ_GMP
#include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place.
#endif
#include "MP4Decoder.h"
#include "VPXDecoder.h"
#include "mozilla/SyncRunnable.h"
@ -68,23 +66,6 @@ const CLSID CLSID_WebmMfVpxDec =
namespace mozilla {
#ifndef MOZ_GMP
// Utility function only used when not building GMP
// XXXMC: Perhaps make this available globally?
void
SplitAt(const char* aDelims,
const nsACString& aInput,
nsTArray<nsCString>& aOutTokens)
{
nsAutoCString str(aInput);
char* end = str.BeginWriting();
const char* start = nullptr;
while (!!(start = NS_strtok(aDelims, &end))) {
aOutTokens.AppendElement(nsCString(start));
}
}
#endif
LayersBackend
GetCompositorBackendType(layers::KnowsCompositor* aKnowsCompositor)
{

View file

@ -25,9 +25,7 @@ H264Converter::H264Converter(PlatformDecoderModule* aPDM,
, mTaskQueue(aParams.mTaskQueue)
, mCallback(aParams.mCallback)
, mDecoder(nullptr)
#ifdef MOZ_GMP
, mGMPCrashHelper(aParams.mCrashHelper)
#endif
, mNeedAVCC(aPDM->DecoderNeedsConversion(aParams.mConfig)
== PlatformDecoderModule::ConversionRequired::kNeedAVCC)
, mLastError(NS_OK)
@ -203,12 +201,8 @@ H264Converter::CreateDecoder(DecoderDoctorDiagnostics* aDiagnostics)
mCallback,
aDiagnostics,
mImageContainer,
#ifdef MOZ_GMP
mKnowsCompositor,
mGMPCrashHelper
#else
mKnowsCompositor
#endif
});
if (!mDecoder) {

View file

@ -62,9 +62,7 @@ private:
MediaDataDecoderCallback* mCallback;
RefPtr<MediaDataDecoder> mDecoder;
MozPromiseRequestHolder<InitPromise> mInitPromiseRequest;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mGMPCrashHelper;
#endif
bool mNeedAVCC;
nsresult mLastError;
bool mNeedKeyframe = true;

View file

@ -425,9 +425,7 @@ support-files =
dirac.ogg^headers^
dynamic_redirect.sjs
dynamic_resource.sjs
#ifdef MOZ_EME
eme.js
#endif
file_access_controls.html
flac-s24.flac
flac-s24.flac^headers^
@ -684,7 +682,6 @@ tags=capturestream
[test_decoder_disable.html]
[test_defaultMuted.html]
[test_delay_load.html]
#ifdef MOZ_EME
[test_eme_session_callable_value.html]
[test_eme_canvas_blocked.html]
skip-if = toolkit == 'android' # bug 1149374
@ -715,16 +712,13 @@ tags=msg capturestream
skip-if = toolkit == 'android' # bug 1149374
[test_eme_waitingforkey.html]
skip-if = toolkit == 'android' # bug 1149374
#endif
[test_empty_resource.html]
[test_error_in_video_document.html]
[test_error_on_404.html]
[test_fastSeek.html]
[test_fastSeek-forwards.html]
#ifdef MOZ_GMP
[test_gmp_playback.html]
skip-if = (os != 'win' || os_version == '5.1') # Only gmp-clearkey on Windows Vista and later decodes
#endif
[test_imagecapture.html]
[test_info_leak.html]
[test_invalid_reject.html]

View file

@ -7,23 +7,15 @@
#include "nsISupports.h"
#include "MediaResource.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
namespace mozilla {
NS_IMPL_ISUPPORTS0(BufferDecoder)
#ifdef MOZ_GMP
BufferDecoder::BufferDecoder(MediaResource* aResource, GMPCrashHelper* aCrashHelper)
#else
BufferDecoder::BufferDecoder(MediaResource* aResource)
#endif
: mResource(aResource)
#ifdef MOZ_GMP
, mCrashHelper(aCrashHelper)
#endif
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(BufferDecoder);
@ -75,12 +67,10 @@ BufferDecoder::GetOwner() const
return nullptr;
}
#ifdef MOZ_GMP
already_AddRefed<GMPCrashHelper>
BufferDecoder::GetCrashHelper()
{
return do_AddRef(mCrashHelper);
}
#endif
} // namespace mozilla

View file

@ -23,11 +23,7 @@ class BufferDecoder final : public AbstractMediaDecoder
public:
// This class holds a weak pointer to MediaResource. It's the responsibility
// of the caller to manage the memory of the MediaResource object.
#ifdef MOZ_GMP
explicit BufferDecoder(MediaResource* aResource, GMPCrashHelper* aCrashHelper);
#else
explicit BufferDecoder(MediaResource* aResource);
#endif
NS_DECL_THREADSAFE_ISUPPORTS
@ -43,17 +39,13 @@ public:
MediaDecoderOwner* GetOwner() const final override;
#ifdef MOZ_GMP
already_AddRefed<GMPCrashHelper> GetCrashHelper() override;
#endif
private:
virtual ~BufferDecoder();
RefPtr<TaskQueue> mTaskQueueIdentity;
RefPtr<MediaResource> mResource;
#ifdef MOZ_GMP
RefPtr<GMPCrashHelper> mCrashHelper;
#endif
};
} // namespace mozilla

View file

@ -24,9 +24,7 @@
#include "WebAudioUtils.h"
#include "mozilla/dom/Promise.h"
#include "nsPrintfCString.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
namespace mozilla {
@ -182,7 +180,6 @@ MediaDecodeTask::Run()
return NS_OK;
}
#ifdef MOZ_GMP
class BufferDecoderGMPCrashHelper : public GMPCrashHelper
{
public:
@ -200,7 +197,6 @@ public:
private:
nsWeakPtr mParent;
};
#endif
bool
MediaDecodeTask::CreateReader()
@ -219,12 +215,8 @@ MediaDecodeTask::CreateReader()
mLength, principal, mContentType);
MOZ_ASSERT(!mBufferDecoder);
#ifdef MOZ_GMP
mBufferDecoder = new BufferDecoder(resource,
new BufferDecoderGMPCrashHelper(mDecodeJob.mContext->GetParentObject()));
#else
mBufferDecoder = new BufferDecoder(resource);
#endif
// If you change this list to add support for new decoders, please consider
// updating HTMLMediaElement::CreateDecoder as well.