Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  AndroidEncoderModule.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 "AndroidEncoderModule.h"

#include "AndroidDataEncoder.h"
#include "mozilla/Logging.h"
#include "mozilla/java/HardwareCodecCapabilityUtilsWrappers.h"

using mozilla::media::EncodeSupport;
using mozilla::media::EncodeSupportSet;

namespace mozilla {
extern LazyLogModule sPEMLog;
#define AND_PEM_LOG(arg, ...)                                                 \
  MOZ_LOG_FMT(sPEMLog, mozilla::LogLevel::Debug,                              \
              "AndroidEncoderModule({})::{}: " arg, fmt::ptr(this), __func__, \
              ##__VA_ARGS__)

EncodeSupportSet AndroidEncoderModule::SupportsCodec(CodecType aCodec) const {
  EncodeSupportSet supports{};
  switch (aCodec) {
    case CodecType::H264:
      supports += EncodeSupport::SoftwareEncode;
      if (java::HardwareCodecCapabilityUtils::HasHWH264(true /* encoder */)) {
        supports += EncodeSupport::HardwareEncode;
      }
      break;
    case CodecType::VP8:
      if (java::HardwareCodecCapabilityUtils::HasHWVP8(true /* encoder */)) {
        supports += EncodeSupport::HardwareEncode;
      }
      break;
    case CodecType::VP9:
      if (java::HardwareCodecCapabilityUtils::HasHWVP9(true /* encoder */)) {
        supports += EncodeSupport::HardwareEncode;
      }
      break;
    default:
      break;
  }
  return supports;
}

EncodeSupportSet AndroidEncoderModule::Supports(
    const EncoderConfig& aConfig) const {
  if (!CanLikelyEncode(aConfig)) {
    return EncodeSupportSet{};
  }
  if (aConfig.mScalabilityMode != ScalabilityMode::None) {
    return EncodeSupportSet{};
  }
  // Only hardware encoder are supported for now.
  return SupportsCodec(aConfig.mCodec);
}

already_AddRefed<MediaDataEncoder> AndroidEncoderModule::CreateVideoEncoder(
    const EncoderConfig& aConfig, const RefPtr<TaskQueue>& aTaskQueue) const {
  if (Supports(aConfig).isEmpty()) {
    AND_PEM_LOG("Unsupported codec type: {}",
                EnumValueToString(aConfig.mCodec));
    return nullptr;
  }
  return MakeRefPtr<AndroidDataEncoder>(aConfig, aTaskQueue).forget();
}

}  // namespace mozilla

#undef AND_PEM_LOG

Messung V0.5 in Prozent
C=95 H=90 G=92

¤ Dauer der Verarbeitung: 0.2 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=752002