Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  GMPContentParent.h

  Sprache: C
 

/* 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 GMPContentParent_h_
#define GMPContentParent_h_

#include "GMPNativeTypes.h"
#include "mozilla/gmp/PGMPContentParent.h"
#include "nsISupportsImpl.h"

namespace mozilla::gmp {

class GMPContentParentCloseBlocker;
class GMPParent;
class GMPVideoDecoderParent;
class GMPVideoEncoderParent;
class ChromiumCDMParent;

/**
 * This class allows the parent/content processes to create GMP decoder/encoder
 * objects in the GMP process.
 */

class GMPContentParent final : public PGMPContentParent {
  friend class PGMPContentParent;

 public:
  // Mark AddRef and Release as `final`, as they overload pure virtual
  // implementations in PGMPContentParent.
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPContentParent, final)

  explicit GMPContentParent(GMPParent* aParent = nullptr);

  nsresult GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD);
  void VideoDecoderDestroyed(GMPVideoDecoderParent* aDecoder);

  nsresult GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE);
  void VideoEncoderDestroyed(GMPVideoEncoderParent* aEncoder);

  already_AddRefed<ChromiumCDMParent> GetChromiumCDM(
      const nsCString& aKeySystem);
  void ChromiumCDMDestroyed(ChromiumCDMParent* aCDM);

  nsCOMPtr<nsISerialEventTarget> GMPEventTarget();

  void SetDisplayName(const nsCString& aDisplayName) {
    mDisplayName = aDisplayName;
  }
  const nsCString& GetDisplayName() const { return mDisplayName; }
  void SetPluginId(const uint32_t aPluginId) { mPluginId = aPluginId; }
  uint32_t GetPluginId() const { return mPluginId; }
  void SetPluginType(GMPPluginType aPluginType) { mPluginType = aPluginType; }
  GMPPluginType GetPluginType() const { return mPluginType; }

 private:
  friend class GMPContentParentCloseBlocker;

  void AddCloseBlocker();
  void RemoveCloseBlocker();

  ~GMPContentParent();

  void ActorDestroy(ActorDestroyReason aWhy) override;

  void CloseIfUnused();
  // Needed because NewRunnableMethod tried to use the class that the method
  // lives on to store the receiver, but PGMPContentParent isn't refcounted.
  void Close() { PGMPContentParent::Close(); }

  nsTArray<RefPtr<GMPVideoDecoderParent>> mVideoDecoders;
  nsTArray<RefPtr<GMPVideoEncoderParent>> mVideoEncoders;
  nsTArray<RefPtr<ChromiumCDMParent>> mChromiumCDMs;
  nsCOMPtr<nsISerialEventTarget> mGMPEventTarget;
  RefPtr<GMPParent> mParent;
  nsCString mDisplayName;
  uint32_t mPluginId;
  GMPPluginType mPluginType = GMPPluginType::Unknown;
  uint32_t mCloseBlockerCount = 0;
};

class GMPContentParentCloseBlocker final {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GMPContentParentCloseBlocker)

  explicit GMPContentParentCloseBlocker(GMPContentParent* aParent)
      : mParent(aParent), mEventTarget(aParent->GMPEventTarget()) {
    MOZ_ASSERT(mEventTarget);
    mParent->AddCloseBlocker();
  }

  void Destroy();

  RefPtr<GMPContentParent> mParent;

 private:
  nsCOMPtr<nsISerialEventTarget> mEventTarget;

  ~GMPContentParentCloseBlocker() { Destroy(); }
};

}  // namespace mozilla::gmp

#endif  // GMPParent_h_

Messung V0.5 in Prozent
C=91 H=99 G=94

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002