dom/media: more eme fixes

This commit is contained in:
roytam1 2023-09-14 16:57:56 +08:00
commit 58a39ca8cb
9 changed files with 72 additions and 10 deletions

View file

@ -7,7 +7,9 @@
#define MediaDecoder_h_
#include "mozilla/Atomics.h"
#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
#endif
#include "mozilla/MozPromise.h"
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/StateMirroring.h"
@ -433,6 +435,7 @@ 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
@ -440,6 +443,7 @@ private:
RefPtr<CDMProxyPromise> RequestCDMProxy() const;
void SetCDMProxy(CDMProxy* aProxy);
#endif
static bool IsOggEnabled();
static bool IsOpusEnabled();
@ -590,8 +594,10 @@ 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