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

Co-authored-by: Moonchild <moonchild@palemoon.org>
This commit is contained in:
Matheus Marinho 2023-08-31 12:07:34 -03:00 committed by roytam1
commit 9e7d1492e6
54 changed files with 314 additions and 30 deletions

View file

@ -24,7 +24,9 @@
#include "WebAudioUtils.h"
#include "mozilla/dom/Promise.h"
#include "nsPrintfCString.h"
#ifdef MOZ_GMP
#include "GMPService.h"
#endif
namespace mozilla {
@ -180,6 +182,7 @@ MediaDecodeTask::Run()
return NS_OK;
}
#ifdef MOZ_GMP
class BufferDecoderGMPCrashHelper : public GMPCrashHelper
{
public:
@ -197,6 +200,7 @@ public:
private:
nsWeakPtr mParent;
};
#endif
bool
MediaDecodeTask::CreateReader()
@ -215,8 +219,12 @@ 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.