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


Quelle  GMPDecoderModule.cpp   Sprache: C

 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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"

#ifdef MOZ_AV1
#  include "AOMDecoder.h"
#endif
#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) &&
#ifdef MOZ_AV1
      !AOMDecoder::IsAV1(aParams.mConfig.mMimeType) &&
#endif
      !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);
#ifdef MOZ_AV1
  } else if (AOMDecoder::IsAV1(aMimeType)) {
    tags.AppendElement("av1"_ns);
#endif
  } 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
C=93 H=97 G=94

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge