dom/media/gmp/GMPContentChild.h
author Sylvestre Ledru <sledru@mozilla.com>
Mon, 19 Nov 2018 13:25:37 +0000
changeset 446960 0ceae9db9ec0be18daa1a279511ad305723185d4
parent 383452 4785e88cd39ac18713f112d00ec7d43246934aa8
child 457431 09c24f46810fa8c6ebd5879d32db87132e72a06e
permissions -rw-r--r--
Bug 1204606 - Reformat of dom/media r=jya # skip-blame Differential Revision: https://phabricator.services.mozilla.com/D12251

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GMPContentChild_h_
#define GMPContentChild_h_

#include "mozilla/gmp/PGMPContentChild.h"
#include "GMPSharedMemManager.h"

namespace mozilla {
namespace gmp {

class GMPChild;

class GMPContentChild : public PGMPContentChild, public GMPSharedMem {
 public:
  explicit GMPContentChild(GMPChild* aChild);
  virtual ~GMPContentChild();

  MessageLoop* GMPMessageLoop();

  mozilla::ipc::IPCResult RecvPGMPVideoDecoderConstructor(
      PGMPVideoDecoderChild* aActor, const uint32_t& aDecryptorId) override;
  mozilla::ipc::IPCResult RecvPGMPVideoEncoderConstructor(
      PGMPVideoEncoderChild* aActor) override;
  mozilla::ipc::IPCResult RecvPChromiumCDMConstructor(
      PChromiumCDMChild* aActor) override;

  PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild(
      const uint32_t& aDecryptorId) override;
  bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override;

  PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override;
  bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override;

  PChromiumCDMChild* AllocPChromiumCDMChild() override;
  bool DeallocPChromiumCDMChild(PChromiumCDMChild* aActor) override;

  void ActorDestroy(ActorDestroyReason aWhy) override;
  void ProcessingError(Result aCode, const char* aReason) override;

  // GMPSharedMem
  void CheckThread() override;

  void CloseActive();
  bool IsUsed();

  GMPChild* mGMPChild;
};

}  // namespace gmp
}  // namespace mozilla

#endif  // GMPContentChild_h_