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

@ -25,7 +25,9 @@
#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"
@ -66,6 +68,23 @@ 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)
{