Commit 9bfa9de2 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1821480. r=media-playback-reviewers,alwu a=RyanVM

parent cb206c10
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,8 +6,12 @@
#ifndef GMPCallbackBase_h_
#define GMPCallbackBase_h_

#include "nsISupportsImpl.h"

class GMPCallbackBase {
 public:
  NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING

  virtual ~GMPCallbackBase() = default;

  // The GMP code will call this if the codec crashes or shuts down.  It's
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class GMPVideoDecoderParent final : public PGMPVideoDecoderParent,
  bool mIsAwaitingResetComplete;
  bool mIsAwaitingDrainComplete;
  RefPtr<GMPContentParent> mPlugin;
  GMPVideoDecoderCallbackProxy* mCallback;
  RefPtr<GMPVideoDecoderCallbackProxy> mCallback;
  GMPVideoHostImpl mVideoHost;
  const uint32_t mPluginId;
  int32_t mFrameCount;
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ class GMPVideoEncoderParent : public GMPVideoEncoderProxy,
  bool mShuttingDown;
  bool mActorDestroyed;
  RefPtr<GMPContentParent> mPlugin;
  GMPVideoEncoderCallbackProxy* mCallback;
  RefPtr<GMPVideoEncoderCallbackProxy> mCallback;
  GMPVideoHostImpl mVideoHost;
  const uint32_t mPluginId;
};
+3 −1
Original line number Diff line number Diff line
@@ -22,10 +22,12 @@ DDLoggedTypeCustomNameAndBase(RemoteMediaDataDecoder, RemoteMediaDataDecoder,
// to a 'real' decoder in the GPU or RDD process.
// All requests get forwarded to a *DecoderChild instance that
// operates solely on the provided manager and abstract manager threads.
class RemoteMediaDataDecoder
class RemoteMediaDataDecoder final
    : public MediaDataDecoder,
      public DecoderDoctorLifeLogger<RemoteMediaDataDecoder> {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RemoteMediaDataDecoder, final);

  explicit RemoteMediaDataDecoder(RemoteDecoderChild* aChild);

  // MediaDataDecoder
+5 −2
Original line number Diff line number Diff line
@@ -120,13 +120,14 @@ class SingleAllocPolicy : public AllocPolicyImpl {
  MozPromiseRequestHolder<Promise> mTokenRequest;
};

class AllocationWrapper : public MediaDataDecoder {
class AllocationWrapper final : public MediaDataDecoder {
  using Token = AllocPolicy::Token;

 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AllocationWrapper, final);

  AllocationWrapper(already_AddRefed<MediaDataDecoder> aDecoder,
                    already_AddRefed<Token> aToken);
  ~AllocationWrapper();

  RefPtr<InitPromise> Init() override { return mDecoder->Init(); }
  RefPtr<DecodePromise> Decode(MediaRawData* aSample) override {
@@ -171,6 +172,8 @@ class AllocationWrapper : public MediaDataDecoder {
      const CreateDecoderParams& aParams, AllocPolicy* aPolicy = nullptr);

 private:
  ~AllocationWrapper();

  RefPtr<MediaDataDecoder> mDecoder;
  RefPtr<Token> mToken;
};
Loading