Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  GMPDecoderModule.cpp

  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/. */


#include "GMPDecoderModule.h"

#include "AOMDecoder.h"
#include "DecoderDoctorDiagnostics.h"
#include "GMPService.h"
#include "GMPUtils.h"
#include "GMPVideoDecoder.h"
#include "MP4Decoder.h"
#include "MediaDataDecoderProxy.h"
#include "VPXDecoder.h"
#include "VideoUtils.h"
#include "gmp-video-decode.h"
#include "mozilla/StaticMutex.h"
#include "nsServiceManagerUtils.h"
#ifdef XP_WIN
#  include "WMFDecoderModule.h"
#endif

namespace mozilla {

static already_AddRefed<MediaDataDecoderProxy> CreateDecoderWrapper(
    GMPVideoDecoderParams&& aParams) {
  RefPtr<gmp::GeckoMediaPluginService> s(
      gmp::GeckoMediaPluginService::GetGeckoMediaPluginService());
  if (!s) {
    return nullptr;
  }
  nsCOMPtr<nsISerialEventTarget> thread(s->GetGMPThread());
  if (!thread) {
    return nullptr;
  }

  RefPtr<MediaDataDecoderProxy> decoder(new MediaDataDecoderProxy(
      do_AddRef(new GMPVideoDecoder(std::move(aParams))), thread.forget()));
  return decoder.forget();
}

already_AddRefed<MediaDataDecoder> GMPDecoderModule::CreateVideoDecoder(
    const CreateDecoderParams& aParams) {
  if (!MP4Decoder::IsH264(aParams.mConfig.mMimeType) &&
      !AOMDecoder::IsAV1(aParams.mConfig.mMimeType) &&
      !VPXDecoder::IsVP8(aParams.mConfig.mMimeType) &&
      !VPXDecoder::IsVP9(aParams.mConfig.mMimeType)) {
    return nullptr;
  }

  return CreateDecoderWrapper(GMPVideoDecoderParams(aParams));
}

already_AddRefed<MediaDataDecoder> GMPDecoderModule::CreateAudioDecoder(
    const CreateDecoderParams& aParams) {
  return nullptr;
}

/* static */
media::DecodeSupportSet GMPDecoderModule::SupportsMimeType(
    const nsACString& aMimeType, const nsACString& aApi,
    const Maybe<nsCString>& aKeySystem) {
  AutoTArray<nsCString, 2> tags;
  if (MP4Decoder::IsH264(aMimeType)) {
    tags.AppendElement("h264"_ns);
  } else if (AOMDecoder::IsAV1(aMimeType)) {
    tags.AppendElement("av1"_ns);
  } else if (VPXDecoder::IsVP9(aMimeType)) {
    tags.AppendElement("vp9"_ns);
  } else if (VPXDecoder::IsVP8(aMimeType)) {
    tags.AppendElement("vp8"_ns);
  } else {
    return media::DecodeSupportSet{};
  }

  // Optional tag for EME GMP plugins.
  if (aKeySystem) {
    tags.AppendElement(*aKeySystem);
  }

  // GMP plugins are always software based.
  return HaveGMPFor(aApi, tags) ? media::DecodeSupport::SoftwareDecode
                                : media::DecodeSupportSet{};
}

media::DecodeSupportSet GMPDecoderModule::SupportsMimeType(
    const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
  return SupportsMimeType(aMimeType, "decode-video"_ns, Nothing());
}

/* static */
already_AddRefed<PlatformDecoderModule> GMPDecoderModule::Create() {
  return MakeAndAddRef<GMPDecoderModule>();
}

}  // namespace mozilla

Messung V0.5 in Prozent
C=83 H=83 G=82

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© 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=655579