Backed out 8 changesets (bug 1754239, bug 1766308, bug 1766307, bug 1766310) for causing build bustages on UtilityAudioDecoderParent.cpp CLOSED TREE

Backed out changeset e383703e28cf (bug 1766307)
Backed out changeset 5fb04c68ae7a (bug 1766307)
Backed out changeset ee76505a46ff (bug 1766310)
Backed out changeset d76eae67ae79 (bug 1754239)
Backed out changeset fed974dcf641 (bug 1754239)
Backed out changeset 67c5fbd546a1 (bug 1766307)
Backed out changeset da49735366d2 (bug 1766308)
Backed out changeset 81ccd31d0f07 (bug 1766307)
This commit is contained in:
Norisz Fay 2022-07-14 04:03:19 +03:00
Родитель 4ea684224b
Коммит 82c8f892b0
42 изменённых файлов: 154 добавлений и 674 удалений

Просмотреть файл

@ -4626,7 +4626,8 @@ IPCResult ContentChild::RecvFlushFOGData(FlushFOGDataResolver&& aResolver) {
}
IPCResult ContentChild::RecvUpdateMediaCodecsSupported(
RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported) {
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported) {
RemoteDecoderManagerChild::SetSupported(aLocation, aSupported);
return IPC_OK();

Просмотреть файл

@ -803,7 +803,8 @@ class ContentChild final : public PContentChild,
mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver);
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported);
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported);
#ifdef NIGHTLY_BUILD
virtual void OnChannelReceivedMessage(const Message& aMsg) override;

Просмотреть файл

@ -363,7 +363,8 @@ namespace dom {
LazyLogModule gProcessLog("Process");
static std::map<RemoteDecodeIn, media::MediaCodecsSupported> sCodecsSupported;
static std::map<RemoteDecodeIn, PDMFactory::MediaCodecsSupported>
sCodecsSupported;
/* static */
uint32_t ContentParent::sMaxContentProcesses = 0;
@ -1631,21 +1632,12 @@ void ContentParent::BroadcastThemeUpdate(widget::ThemeChangeKind aKind) {
/*static */
void ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported) {
// Merge incoming codec support with existing support list
media::MCSInfo::AddSupport(aSupported);
auto support = media::MCSInfo::GetSupport();
// Update processes
sCodecsSupported[aLocation] = support;
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported) {
sCodecsSupported[aLocation] = aSupported;
for (auto* cp : AllProcesses(eAll)) {
Unused << cp->SendUpdateMediaCodecsSupported(aLocation, support);
Unused << cp->SendUpdateMediaCodecsSupported(aLocation, aSupported);
}
// Generate + save support string for display in about:support
nsCString supportString;
media::MCSInfo::GetMediaCodecsSupportedString(supportString, support);
gfx::gfxVars::SetCodecSupportInfo(supportString);
}
const nsACString& ContentParent::GetRemoteType() const { return mRemoteType; }

Просмотреть файл

@ -254,7 +254,8 @@ class ContentParent final : public PContentParent,
static void BroadcastThemeUpdate(widget::ThemeChangeKind);
static void BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported);
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported);
const nsACString& GetRemoteType() const override;

Просмотреть файл

@ -148,7 +148,7 @@ using mozilla::PermissionDelegateHandler::DelegatedPermissionList from "mozilla/
using class mozilla::dom::SessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
using struct nsPoint from "nsPoint.h";
using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";
[RefCounted] using mozilla::dom::FeaturePolicy from "mozilla/dom/FeaturePolicy.h";

Просмотреть файл

@ -13,8 +13,7 @@ namespace mozilla {
/* static */
bool ADTSDecoder::IsEnabled() {
RefPtr<PDMFactory> platform = new PDMFactory();
return platform->SupportsMimeType("audio/mp4a-latm"_ns) !=
media::DecodeSupport::Unsupported;
return platform->SupportsMimeType("audio/mp4a-latm"_ns);
}
/* static */

Просмотреть файл

@ -1164,8 +1164,7 @@ void MediaFormatReader::OnDemuxerInitDone(const MediaResult& aResult) {
UniquePtr<TrackInfo> videoInfo = mVideo.mTrackDemuxer->GetInfo();
videoActive = videoInfo && videoInfo->IsValid();
if (videoActive) {
if (platform && platform->SupportsMimeType(videoInfo->mMimeType) ==
media::DecodeSupport::Unsupported) {
if (platform && !platform->SupportsMimeType(videoInfo->mMimeType)) {
// We have no decoder for this track. Error.
mMetadataPromise.Reject(NS_ERROR_DOM_MEDIA_METADATA_ERR, __func__);
return;
@ -1196,8 +1195,7 @@ void MediaFormatReader::OnDemuxerInitDone(const MediaResult& aResult) {
// We actively ignore audio tracks that we know we can't play.
audioActive =
audioInfo && audioInfo->IsValid() &&
(!platform || platform->SupportsMimeType(audioInfo->mMimeType) !=
media::DecodeSupport::Unsupported);
(!platform || platform->SupportsMimeType(audioInfo->mMimeType));
if (audioActive) {
mInfo.mAudio = *audioInfo->GetAsAudioInfo();

Просмотреть файл

@ -1,158 +0,0 @@
/* -*- 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/. */
#include "gtest/gtest.h"
#include "MediaCodecsSupport.h"
using namespace mozilla;
using namespace media;
// Test MCSInfo::GetDecodeSupportSet function.
// This function is used to retrieve SW/HW support information for a
// given codec from a MediaCodecsSupported EnumSet.
// We validate that SW, HW, SW+HW, or lack of support information is
// properly returned.
TEST(MediaCodecsSupport, GetDecodeSupportSet)
{
// Mock VP8 SW support, VP9 HW support, H264 SW+HW support
MediaCodecsSupported supported{MediaCodecsSupport::VP8SoftwareDecode,
MediaCodecsSupport::VP9HardwareDecode,
MediaCodecsSupport::H264SoftwareDecode,
MediaCodecsSupport::H264HardwareDecode};
MediaCodec codec; // Codec used to generate + filter results
DecodeSupportSet RV; // Return value to check for validity
// Check only SW support returned for VP8
codec = MediaCodec::VP8;
RV = MCSInfo::GetDecodeSupportSet(codec, supported);
EXPECT_TRUE(RV.contains(DecodeSupport::SoftwareDecode));
EXPECT_TRUE(RV.size() == 1);
// Check only HW support returned for VP9
codec = MediaCodec::VP9;
RV = MCSInfo::GetDecodeSupportSet(codec, supported);
EXPECT_TRUE(RV.contains(DecodeSupport::HardwareDecode));
EXPECT_TRUE(RV.size() == 1);
// Check for both SW/HW support returned for H264
codec = MediaCodec::H264;
RV = MCSInfo::GetDecodeSupportSet(codec, supported);
EXPECT_TRUE(RV.contains(DecodeSupport::SoftwareDecode));
EXPECT_TRUE(RV.contains(DecodeSupport::HardwareDecode));
EXPECT_TRUE(RV.size() == 2);
// Check empty return if codec not in list of codecs
codec = MediaCodec::AV1;
RV = MCSInfo::GetDecodeSupportSet(codec, supported);
EXPECT_TRUE(RV.size() == 0);
}
// Test MCSInfo::GetDecodeMediaCodecsSupported function.
// This function is used to generate codec-specific SW/HW
// support information from a generic codec identifier enum and
// generic SW/HW support information.
// We validate that SW, HW, SW+HW, or lack of support information is
// properly returned.
TEST(MediaCodecsSupport, GetDecodeMediaCodecsSupported)
{
MediaCodec codec; // Codec used to generate / filter results
MediaCodecsSupported RV; // Return value to check for validity
DecodeSupportSet dss; // Non codec-specific SW / HW support information
// Check SW support returned for VP8
codec = MediaCodec::VP8;
dss = DecodeSupportSet{DecodeSupport::SoftwareDecode};
RV = MCSInfo::GetDecodeMediaCodecsSupported(codec, dss);
EXPECT_TRUE(RV.contains(MediaCodecsSupport::VP8SoftwareDecode));
EXPECT_TRUE(RV.size() == 1);
// Check HW support returned for AV1
codec = MediaCodec::AV1;
dss = DecodeSupportSet{DecodeSupport::HardwareDecode};
RV = MCSInfo::GetDecodeMediaCodecsSupported(codec, dss);
EXPECT_TRUE(RV.contains(MediaCodecsSupport::AV1HardwareDecode));
EXPECT_TRUE(RV.size() == 1);
// Check SW + HW support returned for VP9
codec = MediaCodec::VP9;
dss = DecodeSupportSet{DecodeSupport::SoftwareDecode,
DecodeSupport::HardwareDecode};
RV = MCSInfo::GetDecodeMediaCodecsSupported(codec, dss);
EXPECT_TRUE(RV.contains(MediaCodecsSupport::VP9SoftwareDecode));
EXPECT_TRUE(RV.contains(MediaCodecsSupport::VP9HardwareDecode));
EXPECT_TRUE(RV.size() == 2);
// Check empty return if codec not supported
codec = MediaCodec::AV1;
dss = DecodeSupportSet{};
RV = MCSInfo::GetDecodeMediaCodecsSupported(codec, dss);
EXPECT_TRUE(RV.size() == 0);
}
// Test MCSInfo::AddSupport function.
// This function is used to store codec support data.
// Incoming support data will be merged with any data that
// has already been stored.
TEST(MediaCodecsSupport, AddSupport)
{
// Make sure we're not storing any existing support information.
MCSInfo::ResetSupport();
EXPECT_TRUE(MCSInfo::GetSupport().size() == 0);
// Add codec support one at a time via individual calls
MCSInfo::AddSupport(MediaCodecsSupport::AACSoftwareDecode);
MCSInfo::AddSupport(MediaCodecsSupport::VP9SoftwareDecode);
MCSInfo::AddSupport(MediaCodecsSupport::AV1HardwareDecode);
// Add multiple codec support via MediaCodecsSupported EnumSet
MCSInfo::AddSupport(
MediaCodecsSupported{MediaCodecsSupport::H264SoftwareDecode,
MediaCodecsSupport::H264HardwareDecode});
// Query MCSInfo for supported codecs
MediaCodecsSupported supported = MCSInfo::GetSupport();
DecodeSupportSet dss;
// AAC should only report software decode support
dss = MCSInfo::GetDecodeSupportSet(MediaCodec::AAC, supported);
EXPECT_TRUE(dss.size() == 1);
EXPECT_TRUE(dss.contains(DecodeSupport::SoftwareDecode));
// AV1 should only report hardware decode support
dss = MCSInfo::GetDecodeSupportSet(MediaCodec::AV1, supported);
EXPECT_TRUE(dss.size() == 1);
EXPECT_TRUE(dss.contains(DecodeSupport::HardwareDecode));
// H264 should report both SW + HW decode support
dss = MCSInfo::GetDecodeSupportSet(MediaCodec::H264, supported);
EXPECT_TRUE(dss.size() == 2);
EXPECT_TRUE(dss.contains(DecodeSupport::SoftwareDecode));
EXPECT_TRUE(dss.contains(DecodeSupport::HardwareDecode));
// Vorbis should report no decode support
dss = MCSInfo::GetDecodeSupportSet(MediaCodec::Vorbis, supported);
EXPECT_TRUE(dss.size() == 0);
}
// Test MCSInfo::GetMediaCodecsSupportedString function.
// This function returns a human-readable string containing codec
// names and SW/HW playback support information.
TEST(MediaCodecsSupport, GetMediaCodecsSupportedString)
{
// Make sure we're not storing any existing support information.
MCSInfo::ResetSupport();
EXPECT_TRUE(MCSInfo::GetSupport().size() == 0);
// Add H264 SW/HW support + VP8 Software decode support.
MCSInfo::AddSupport({MediaCodecsSupport::H264SoftwareDecode,
MediaCodecsSupport::H264HardwareDecode,
MediaCodecsSupport::VP8SoftwareDecode});
nsCString supportString;
MCSInfo::GetMediaCodecsSupportedString(supportString, MCSInfo::GetSupport());
EXPECT_TRUE(supportString.Equals(
"Codec support information:\nH264 SW\nH264 HW\nVP8 SW"_ns));
}

Просмотреть файл

@ -46,7 +46,6 @@ UNIFIED_SOURCES += [
"TestGroupId.cpp",
"TestIntervalSet.cpp",
"TestKeyValueStorage.cpp",
"TestMediaCodecsSupport.cpp",
"TestMediaDataDecoder.cpp",
"TestMediaDataEncoder.cpp",
"TestMediaEventSource.cpp",

Просмотреть файл

@ -18,7 +18,7 @@ include protocol PSandboxTesting;
include "mozilla/ipc/ByteBufUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
#if defined(XP_WIN)
[MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";

Просмотреть файл

@ -142,7 +142,7 @@ mozilla::ipc::IPCResult RDDChild::RecvGetModulesTrust(
#endif // defined(XP_WIN)
mozilla::ipc::IPCResult RDDChild::RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported) {
const PDMFactory::MediaCodecsSupported& aSupported) {
dom::ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn::RddProcess, aSupported);
return IPC_OK();

Просмотреть файл

@ -47,7 +47,7 @@ class RDDChild final : public PRDDChild,
GetModulesTrustResolver&& aResolver);
#endif // defined(XP_WIN)
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported);
const PDMFactory::MediaCodecsSupported& aSupported);
mozilla::ipc::IPCResult RecvFOGData(ByteBuf&& aBuf);
bool SendRequestMemoryReport(const uint32_t& aGeneration,

Просмотреть файл

@ -58,12 +58,12 @@ static StaticRefPtr<RemoteDecoderManagerChild>
sRemoteDecoderManagerChildForGPUProcess;
static UniquePtr<nsTArray<RefPtr<Runnable>>> sRecreateTasks;
static StaticDataMutex<Maybe<media::MediaCodecsSupported>> sGPUSupported(
static StaticDataMutex<Maybe<PDMFactory::MediaCodecsSupported>> sGPUSupported(
"RDMC::sGPUSupported");
static StaticDataMutex<Maybe<media::MediaCodecsSupported>> sRDDSupported(
static StaticDataMutex<Maybe<PDMFactory::MediaCodecsSupported>> sRDDSupported(
"RDMC::sRDDSupported");
static StaticDataMutex<Maybe<media::MediaCodecsSupported>> sUtilitySupported(
"RDMC::sUtilitySupported");
static StaticDataMutex<Maybe<PDMFactory::MediaCodecsSupported>>
sUtilitySupported("RDMC::sUtilitySupported");
class ShutdownObserver final : public nsIObserver {
public:
@ -226,7 +226,7 @@ nsISerialEventTarget* RemoteDecoderManagerChild::GetManagerThread() {
bool RemoteDecoderManagerChild::Supports(
RemoteDecodeIn aLocation, const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) {
Maybe<media::MediaCodecsSupported> supported;
Maybe<PDMFactory::MediaCodecsSupported> supported;
switch (aLocation) {
case RemoteDecodeIn::RddProcess: {
auto supportedRDD = sRDDSupported.Lock();
@ -264,8 +264,7 @@ bool RemoteDecoderManagerChild::Supports(
// We can ignore the SupportDecoderParams argument for now as creation of the
// decoder will actually fail later and fallback PDMs will be tested on later.
return PDMFactory::SupportsMimeType(aParams.MimeType(), *supported,
aLocation) !=
media::DecodeSupport::Unsupported;
aLocation);
}
/* static */
@ -798,7 +797,8 @@ void RemoteDecoderManagerChild::HandleFatalError(const char* aMsg) const {
}
void RemoteDecoderManagerChild::SetSupported(
RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported) {
RemoteDecodeIn aLocation,
const PDMFactory::MediaCodecsSupported& aSupported) {
switch (aLocation) {
case RemoteDecodeIn::GpuProcess: {
auto supported = sGPUSupported.Lock();

Просмотреть файл

@ -41,7 +41,7 @@ class RemoteDecoderManagerChild final
static void Init();
static void SetSupported(RemoteDecodeIn aLocation,
const media::MediaCodecsSupported& aSupported);
const PDMFactory::MediaCodecsSupported& aSupported);
// Can be called from any thread.
static bool Supports(RemoteDecodeIn aLocation,

Просмотреть файл

@ -255,8 +255,7 @@ already_AddRefed<Promise> MediaCapabilities::DecodingInfo(
InvokeAsync(taskQueue, __func__, [config = std::move(config)]() {
RefPtr<PDMFactory> pdm = new PDMFactory();
SupportDecoderParams params{*config};
if (pdm->Supports(params, nullptr /* decoder doctor */) ==
media::DecodeSupport::Unsupported) {
if (!pdm->Supports(params, nullptr /* decoder doctor */)) {
return CapabilitiesPromise::CreateAndReject(NS_ERROR_FAILURE,
__func__);
}

Просмотреть файл

@ -13,8 +13,7 @@ namespace mozilla {
/* static */
bool MP3Decoder::IsEnabled() {
RefPtr<PDMFactory> platform = new PDMFactory();
return platform->SupportsMimeType("audio/mpeg"_ns) !=
media::DecodeSupport::Unsupported;
return platform->SupportsMimeType("audio/mpeg"_ns);
}
/* static */

Просмотреть файл

@ -154,8 +154,7 @@ bool MP4Decoder::IsSupportedType(const MediaContainerType& aType,
RefPtr<PDMFactory> platform = new PDMFactory();
for (const auto& track : tracks) {
if (!track ||
platform->Supports(SupportDecoderParams(*track), aDiagnostics) ==
media::DecodeSupport::Unsupported) {
!platform->Supports(SupportDecoderParams(*track), aDiagnostics)) {
return false;
}
}
@ -184,8 +183,7 @@ bool MP4Decoder::IsSupportedType(const MediaContainerType& aType,
RefPtr<PDMFactory> platform = new PDMFactory();
for (const auto& track : tracks) {
if (track &&
platform->Supports(SupportDecoderParams(*track), aDiagnostics) !=
media::DecodeSupport::Unsupported) {
platform->Supports(SupportDecoderParams(*track), aDiagnostics)) {
return true;
}
}

Просмотреть файл

@ -1,174 +0,0 @@
/* -*- 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 <array>
#include "MediaCodecsSupport.h"
#include "PlatformDecoderModule.h"
#include "mozilla/gfx/gfxVars.h"
#include "nsTHashMap.h"
using MediaCodecsSupport = mozilla::media::MediaCodecsSupport;
namespace mozilla::media {
#define CODEC_SUPPORT_LOG(msg, ...) \
MOZ_LOG(sPDMLog, LogLevel::Debug, ("MediaCodecsSupport, " msg, ##__VA_ARGS__))
void MCSInfo::AddSupport(const MediaCodecsSupported& aSupport) {
StaticMutexAutoLock lock(sUpdateMutex);
GetInstance()->mSupport += aSupport;
}
MediaCodecsSupported MCSInfo::GetSupport() {
StaticMutexAutoLock lock(sUpdateMutex);
return GetInstance()->mSupport;
}
void MCSInfo::ResetSupport() {
StaticMutexAutoLock lock(sUpdateMutex);
GetInstance()->mSupport.clear();
}
DecodeSupportSet MCSInfo::GetDecodeSupportSet(
const MediaCodec& aCodec, const MediaCodecsSupported& aSupported) {
DecodeSupportSet support;
const auto supportInfo = GetCodecDefinition(aCodec);
if (aSupported.contains(supportInfo.swDecodeSupport)) {
support += DecodeSupport::SoftwareDecode;
}
if (aSupported.contains(supportInfo.hwDecodeSupport)) {
support += DecodeSupport::HardwareDecode;
}
return support;
}
MediaCodecsSupported MCSInfo::GetDecodeMediaCodecsSupported(
const MediaCodec& aCodec, const DecodeSupportSet& aSupportSet) {
MediaCodecsSupported support;
const auto supportInfo = GetCodecDefinition(aCodec);
if (aSupportSet.contains(DecodeSupport::SoftwareDecode)) {
support += supportInfo.swDecodeSupport;
}
if (aSupportSet.contains(DecodeSupport::HardwareDecode)) {
support += supportInfo.hwDecodeSupport;
}
return support;
}
void MCSInfo::GetMediaCodecsSupportedString(
nsCString& aSupportString, const MediaCodecsSupported& aSupportedCodecs) {
CodecDefinition supportInfo;
aSupportString = "Codec support information:\n"_ns;
for (const auto& it : aSupportedCodecs) {
if (!GetInstance()->mHashTableMCS->Get(it, &supportInfo)) {
CODEC_SUPPORT_LOG(
"Could not find string matching MediaCodecsSupported enum: %d", it);
aSupportString.Append("Unknown codec entry found!\n"_ns);
continue;
}
// Get codec name string and append SW/HW support info
aSupportString.Append(supportInfo.commonName);
if (it == supportInfo.swDecodeSupport) {
aSupportString.Append(" SW"_ns);
}
if (it == supportInfo.hwDecodeSupport) {
aSupportString.Append(" HW"_ns);
}
aSupportString.Append("\n"_ns);
}
// Remove any trailing newline characters
if (!aSupportString.IsEmpty()) {
aSupportString.Truncate(aSupportString.Length() - 1);
}
}
MCSInfo* MCSInfo::GetInstance() {
StaticMutexAutoLock lock(sInitMutex);
if (!sInstance) {
sInstance.reset(new MCSInfo());
}
return sInstance.get();
}
MCSInfo::MCSInfo() {
// Initialize hash tables
mHashTableMCS.reset(new nsTHashMap<MediaCodecsSupport, CodecDefinition>());
mHashTableCodec.reset(new nsTHashMap<MediaCodec, CodecDefinition>());
for (const auto& it : GetAllCodecDefinitions()) {
// Insert MediaCodecsSupport values as keys
mHashTableMCS->InsertOrUpdate(it.swDecodeSupport, it);
mHashTableMCS->InsertOrUpdate(it.hwDecodeSupport, it);
// Insert codec enum values as keys
mHashTableCodec->InsertOrUpdate(it.codec, it);
}
GetMainThreadSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("MCSInfo::MCSInfo", [&] {
// Ensure hash tables freed on shutdown
RunOnShutdown(
[&] {
mHashTableMCS.reset();
mHashTableCodec.reset();
},
ShutdownPhase::XPCOMShutdown);
}));
}
CodecDefinition MCSInfo::GetCodecDefinition(const MediaCodec& aCodec) {
CodecDefinition info;
if (!GetInstance()->mHashTableCodec->Get(aCodec, &info)) {
CODEC_SUPPORT_LOG("Could not find codec definition for codec enum: %d!",
aCodec);
}
return info;
}
std::array<CodecDefinition, 12> MCSInfo::GetAllCodecDefinitions() {
static constexpr std::array<CodecDefinition, 12> codecDefinitions = {
{{MediaCodec::H264, "H264", "video/avc",
MediaCodecsSupport::H264SoftwareDecode,
MediaCodecsSupport::H264HardwareDecode},
{MediaCodec::VP9, "VP9", "video/vp9",
MediaCodecsSupport::VP9SoftwareDecode,
MediaCodecsSupport::VP9HardwareDecode},
{MediaCodec::VP8, "VP8", "video/vp8",
MediaCodecsSupport::VP8SoftwareDecode,
MediaCodecsSupport::VP8HardwareDecode},
{MediaCodec::AV1, "AV1", "video/av1",
MediaCodecsSupport::AV1SoftwareDecode,
MediaCodecsSupport::AV1HardwareDecode},
{MediaCodec::Theora, "Theora", "video/theora",
MediaCodecsSupport::TheoraSoftwareDecode,
MediaCodecsSupport::TheoraHardwareDecode},
{MediaCodec::AAC, "AAC", "audio/mp4a-latm",
MediaCodecsSupport::AACSoftwareDecode,
MediaCodecsSupport::AACHardwareDecode},
{MediaCodec::MP3, "MP3", "audio/mpeg",
MediaCodecsSupport::MP3SoftwareDecode,
MediaCodecsSupport::MP3HardwareDecode},
{MediaCodec::Opus, "Opus", "audio/opus",
MediaCodecsSupport::OpusSoftwareDecode,
MediaCodecsSupport::OpusHardwareDecode},
{MediaCodec::Vorbis, "Vorbis", "audio/vorbis",
MediaCodecsSupport::VorbisSoftwareDecode,
MediaCodecsSupport::VorbisHardwareDecode},
{MediaCodec::FLAC, "FLAC", "audio/flac",
MediaCodecsSupport::FLACSoftwareDecode,
MediaCodecsSupport::FLACHardwareDecode},
{MediaCodec::Wave, "Wave", "audio/x-wav",
MediaCodecsSupport::WaveSoftwareDecode,
MediaCodecsSupport::WaveHardwareDecode},
{MediaCodec::SENTINEL, "Undefined codec name",
"Undefined MIME type string", MediaCodecsSupport::SENTINEL,
MediaCodecsSupport::SENTINEL}}};
return codecDefinitions;
}
} // namespace mozilla::media
#undef CODEC_SUPPORT_LOG

Просмотреть файл

@ -5,195 +5,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DOM_MEDIA_PLATFORMS_MEDIACODECSSUPPORT_H_
#define DOM_MEDIA_PLATFORMS_MEDIACODECSSUPPORT_H_
#include <array>
#include "mozilla/Atomics.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/EnumSet.h"
#include "mozilla/StaticMutex.h"
#include "nsString.h"
#include "nsTHashMap.h"
#include "nsThreadUtils.h"
namespace mozilla::media {
// List of codecs we support, used in the below macros
// to generate MediaCodec and MediaCodecSupports enums.
#define CODEC_LIST \
X(H264) \
X(VP8) \
X(VP9) \
X(AV1) \
X(Theora) \
X(AAC) \
X(FLAC) \
X(MP3) \
X(Opus) \
X(Vorbis) \
X(Wave)
// Generate MediaCodec enum with the names of each codec we support.
// Example: MediaCodec::H264
enum class MediaCodec {
#define X(name) name,
CODEC_LIST
#undef X
SENTINEL
};
// Helper macros used to create codec-specific SW/HW decode enums below.
#define SW_DECODE(codec) codec##SoftwareDecode
#define HW_DECODE(codec) codec##HardwareDecode
// Generate the MediaCodecsSupport enum, containing
// codec-specific SW/HW decode/encode information.
// Entries for HW audio decode/encode should never be set as we
// don't support HW audio decode/encode, but they are included
// for debug purposes / check for erroneous PDM return values.
// Example: MediaCodecsSupport::AACSoftwareDecode
enum class MediaCodecsSupport {
#define X(name) SW_DECODE(name), HW_DECODE(name),
CODEC_LIST
#undef X
SENTINEL
};
#undef SW_DECODE
#undef HW_DECODE
#undef CODEC_LIST // end of macros!
// Enumset containing per-codec SW/HW support
using MediaCodecsSupported = EnumSet<MediaCodecsSupport, uint64_t>;
// Codec-agnostic SW/HW decode support information.
enum class DecodeSupport {
Unsupported = 0,
SoftwareDecode,
HardwareDecode,
};
using DecodeSupportSet = EnumSet<DecodeSupport, uint64_t>;
// CodecDefinition stores information needed to convert / index
// codec support information between types. See: GetAllCodecDefinitions()
struct CodecDefinition {
MediaCodec codec = MediaCodec::SENTINEL;
const char* commonName = "Undefined codec name";
const char* mimeTypeString = "Undefined MIME type string";
MediaCodecsSupport swDecodeSupport = MediaCodecsSupport::SENTINEL;
MediaCodecsSupport hwDecodeSupport = MediaCodecsSupport::SENTINEL;
};
// Singleton class used to collect, manage, and report codec support data.
class MCSInfo final {
public:
// Add codec support information to our aggregated list of supported codecs.
// Incoming support info is merged with the current support info.
// This is because different PDMs may report different codec support
// information, so merging their results allows us to maintain a
// cumulative support list without overwriting any existing data.
static void AddSupport(const MediaCodecsSupported& aSupport);
// Return a cumulative list of codec support information.
// Each call to AddSupport adds to or updates this list.
// This support information can be used to create user-readable strings
// to report codec support information in about:support.
static MediaCodecsSupported GetSupport();
// Reset codec support information saved from calls to AddSupport().
static void ResetSupport();
// Query a MediaCodecsSupported EnumSet for codec-specific SW/HW support enums
// and return general support information as stored in a DecodeSupportSet.
//
// Example input:
//
// aCodec: MediaCodec::H264
// aDecode: MediaCodecsSupport {
// MediaCodecsSupport::AACSoftwareDecode
// MediaCodecsSupport::H264HardwareDecode,
// MediaCodecsSupport::H264SoftwareDecode,
// MediaCodecsSupport::VP8SoftwareDecode,
// }
//
// Example output:
//
// DecodeSupportSet {
// DecodeSupport::SoftwareDecode,
// DecodeSupport::HardwareDecode
// }
//
static DecodeSupportSet GetDecodeSupportSet(
const MediaCodec& aCodec, const MediaCodecsSupported& aSupported);
// Return codec-specific SW/HW support enums for a given codec.
// The DecodeSupportSet argument is used which codec-specific SW/HW
// support values are returned, if any.
//
// Example input:
// aCodec: MediaCodec::VP8
// aSupportSet: DecodeSupportSet {DecodeSupport::SoftwareDecode}
//
// Example output:
// MediaCodecsSupported {MediaCodecsSupport::VP8SoftwareDecode}
//
static MediaCodecsSupported GetDecodeMediaCodecsSupported(
const MediaCodec& aCodec, const DecodeSupportSet& aSupportSet);
// Generate a plaintext description for the SW/HW support information
// contained in a MediaCodecsSupported EnumSet.
//
// Example input:
// MediaCodecsSupported {
// MediaCodecsSupport::H264SoftwareDecode,
// MediaCodecsSupport::H264HardwareDecode,
// MediaCodecsSupport::VP8SoftwareDecode
// }
//
// Example output (returned via argument aCodecString)
//
// "SW H264 decode\n
// HW H264 decode\n
// SW VP8 decode"_ns
//
static void GetMediaCodecsSupportedString(
nsCString& aSupportString, const MediaCodecsSupported& aSupportedCodecs);
// Returns array of hardcoded codec definitions used to generate hashtables
// that convert between types
static std::array<CodecDefinition, 12> GetAllCodecDefinitions();
MCSInfo(MCSInfo const&) = delete;
void operator=(MCSInfo const&) = delete;
~MCSInfo() = default;
private:
MCSInfo();
static MCSInfo* GetInstance();
// Returns a codec definition by MIME type name ("media/vp9")
// or "common" name ("VP9")
static CodecDefinition GetCodecDefinition(const MediaCodec& aCodec);
static inline UniquePtr<MCSInfo> sInstance = nullptr;
static inline StaticMutex sInitMutex;
static inline StaticMutex sUpdateMutex;
UniquePtr<nsTHashMap<MediaCodecsSupport, CodecDefinition>> mHashTableMCS =
nullptr;
UniquePtr<nsTHashMap<const char*, CodecDefinition>> mHashTableString =
nullptr;
UniquePtr<nsTHashMap<MediaCodec, CodecDefinition>> mHashTableCodec = nullptr;
MediaCodecsSupported mSupport{};
};
} // namespace mozilla::media
namespace mozilla {
// Used for IPDL serialization.
// The 'value' has to be the biggest enum from MediaCodecsSupport.
template <typename T>
struct MaxEnumValue;
template <>
struct MaxEnumValue<media::MediaCodecsSupport> {
static constexpr unsigned int value =
static_cast<unsigned int>(media::MediaCodecsSupport::SENTINEL);
};
} // namespace mozilla
#endif /* MediaCodecsSupport_h_ */

Просмотреть файл

@ -61,13 +61,6 @@
#include <functional>
using DecodeSupport = mozilla::media::DecodeSupport;
using DecodeSupportSet = mozilla::media::DecodeSupportSet;
using MediaCodec = mozilla::media::MediaCodec;
using MediaCodecsSupport = mozilla::media::MediaCodecsSupport;
using MediaCodecsSupported = mozilla::media::MediaCodecsSupported;
using MCSInfo = mozilla::media::MCSInfo;
namespace mozilla {
#define PDM_INIT_LOG(msg, ...) \
@ -447,31 +440,24 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
return aPDM->AsyncCreateDecoder(aParams);
}
DecodeSupportSet PDMFactory::SupportsMimeType(
const nsACString& aMimeType) const {
bool PDMFactory::SupportsMimeType(const nsACString& aMimeType) const {
UniquePtr<TrackInfo> trackInfo = CreateTrackInfoWithMIMEType(aMimeType);
if (!trackInfo) {
return DecodeSupport::Unsupported;
return false;
}
return Supports(SupportDecoderParams(*trackInfo), nullptr);
}
DecodeSupportSet PDMFactory::Supports(
const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) const {
bool PDMFactory::Supports(const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) const {
if (mEMEPDM) {
return mEMEPDM->Supports(aParams, aDiagnostics);
return mEMEPDM->Supports(aParams, aDiagnostics) !=
media::DecodeSupport::Unsupported;
}
RefPtr<PlatformDecoderModule> current =
GetDecoderModule(aParams, aDiagnostics);
if (!current) {
return DecodeSupport::Unsupported;
}
// We have a PDM - check for + return SW/HW support info
return current->Supports(aParams, aDiagnostics);
return !!current;
}
void PDMFactory::CreatePDMs() {
@ -758,7 +744,7 @@ void PDMFactory::SetCDMProxy(CDMProxy* aProxy) {
}
/* static */
media::MediaCodecsSupported PDMFactory::Supported(bool aForceRefresh) {
PDMFactory::MediaCodecsSupported PDMFactory::Supported(bool aForceRefresh) {
MOZ_ASSERT(NS_IsMainThread());
static auto calculate = []() {
@ -772,25 +758,53 @@ media::MediaCodecsSupported PDMFactory::Supported(bool aForceRefresh) {
// available.
// This logic will have to be revisited if a PDM supporting either codec
// will be added in addition to the WMF and FFmpeg PDM (such as OpenH264)
for (const auto& cd : MCSInfo::GetAllCodecDefinitions()) {
supported += MCSInfo::GetDecodeMediaCodecsSupported(
cd.codec, pdm->SupportsMimeType(nsCString(cd.mimeTypeString)));
if (pdm->SupportsMimeType("video/avc"_ns)) {
supported += MediaCodecs::H264;
}
if (pdm->SupportsMimeType("video/vp9"_ns)) {
supported += MediaCodecs::VP9;
}
if (pdm->SupportsMimeType("video/vp8"_ns)) {
supported += MediaCodecs::VP8;
}
if (pdm->SupportsMimeType("video/av1"_ns)) {
supported += MediaCodecs::AV1;
}
if (pdm->SupportsMimeType("video/theora"_ns)) {
supported += MediaCodecs::Theora;
}
if (pdm->SupportsMimeType("audio/mp4a-latm"_ns)) {
supported += MediaCodecs::AAC;
}
// MP3 can be either decoded by ffvpx or WMF/FFmpeg
if (pdm->SupportsMimeType("audio/mpeg"_ns)) {
supported += MediaCodecs::MP3;
}
if (pdm->SupportsMimeType("audio/opus"_ns)) {
supported += MediaCodecs::Opus;
}
if (pdm->SupportsMimeType("audio/vorbis"_ns)) {
supported += MediaCodecs::Vorbis;
}
if (pdm->SupportsMimeType("audio/flac"_ns)) {
supported += MediaCodecs::Flac;
}
if (pdm->SupportsMimeType("audio/x-wav"_ns)) {
supported += MediaCodecs::Wave;
}
return supported;
};
static MediaCodecsSupported supported = calculate();
if (aForceRefresh) {
supported = calculate();
}
return supported;
}
/* static */
DecodeSupportSet PDMFactory::SupportsMimeType(
const nsACString& aMimeType, const MediaCodecsSupported& aSupported,
RemoteDecodeIn aLocation) {
bool PDMFactory::SupportsMimeType(const nsACString& aMimeType,
const MediaCodecsSupported& aSupported,
RemoteDecodeIn aLocation) {
const bool videoSupport = aLocation != RemoteDecodeIn::UtilityProcess;
const bool audioSupport = (aLocation == RemoteDecodeIn::UtilityProcess &&
StaticPrefs::media_utility_process_enabled()) ||
@ -799,44 +813,45 @@ DecodeSupportSet PDMFactory::SupportsMimeType(
if (videoSupport) {
if (MP4Decoder::IsH264(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::H264, aSupported);
return aSupported.contains(MediaCodecs::H264);
}
if (VPXDecoder::IsVP9(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::VP9, aSupported);
return aSupported.contains(MediaCodecs::VP9);
}
if (VPXDecoder::IsVP8(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::VP8, aSupported);
return aSupported.contains(MediaCodecs::VP8);
}
#ifdef MOZ_AV1
if (AOMDecoder::IsAV1(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::AV1, aSupported);
return aSupported.contains(MediaCodecs::AV1);
}
#endif
if (TheoraDecoder::IsTheora(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::Theora, aSupported);
return aSupported.contains(MediaCodecs::Theora);
}
}
if (audioSupport) {
if (MP4Decoder::IsAAC(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::AAC, aSupported);
return aSupported.contains(MediaCodecs::AAC);
}
if (aMimeType.EqualsLiteral("audio/mpeg")) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::MP3, aSupported);
return aSupported.contains(MediaCodecs::MP3);
}
if (OpusDataDecoder::IsOpus(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::Opus, aSupported);
return aSupported.contains(MediaCodecs::Opus);
}
if (VorbisDataDecoder::IsVorbis(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::Vorbis, aSupported);
return aSupported.contains(MediaCodecs::Vorbis);
}
if (aMimeType.EqualsLiteral("audio/flac")) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::FLAC, aSupported);
return aSupported.contains(MediaCodecs::Flac);
}
if (WaveDataDecoder::IsWave(aMimeType)) {
return MCSInfo::GetDecodeSupportSet(MediaCodec::Wave, aSupported);
return aSupported.contains(MediaCodecs::Wave);
}
}
return DecodeSupport::Unsupported;
return false;
}
/* static */

Просмотреть файл

@ -25,6 +25,8 @@ class CDMProxy;
class MediaDataDecoder;
class MediaResult;
class StaticMutex;
template <typename T>
struct MaxEnumValue;
struct CreateDecoderParams;
struct CreateDecoderParamsForAsync;
struct SupportDecoderParams;
@ -43,10 +45,9 @@ class PDMFactory final {
RefPtr<PDMCreateDecoderPromise> CreateDecoder(
const CreateDecoderParams& aParams);
media::DecodeSupportSet SupportsMimeType(const nsACString& aMimeType) const;
media::DecodeSupportSet Supports(
const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) const;
bool SupportsMimeType(const nsACString& aMimeType) const;
bool Supports(const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) const;
// Creates a PlatformDecoderModule that uses a CDMProxy to decrypt or
// decrypt-and-decode EME encrypted content. If the CDM only decrypts and
@ -60,10 +61,31 @@ class PDMFactory final {
static constexpr int kYUV422 = 2;
static constexpr int kYUV444 = 3;
static media::MediaCodecsSupported Supported(bool aForceRefresh = false);
static media::DecodeSupportSet SupportsMimeType(
const nsACString& aMimeType,
const media::MediaCodecsSupported& aSupported, RemoteDecodeIn aLocation);
/*
* All the codecs we support
*/
enum class MediaCodecs {
H264,
VP9,
VP8,
AV1,
Theora,
AAC,
MP3,
Opus,
Vorbis,
Flac,
Wave,
SENTINEL,
};
using MediaCodecsSupported = EnumSet<MediaCodecs>;
static MediaCodecsSupported Supported(bool aForceRefresh = false);
static bool SupportsMimeType(const nsACString& aMimeType,
const MediaCodecsSupported& aSupported,
RemoteDecodeIn aLocation);
static bool AllDecodersAreRemote();
@ -107,6 +129,14 @@ class PDMFactory final {
static void EnsureInit();
};
// Used for IPDL serialization.
// The 'value' have to be the biggest enum from MediaCodecs.
template <>
struct MaxEnumValue<PDMFactory::MediaCodecs> {
static constexpr unsigned int value =
static_cast<unsigned int>(PDMFactory::MediaCodecs::SENTINEL);
};
} // namespace mozilla
#endif /* PDMFactory_h_ */

Просмотреть файл

@ -5,7 +5,6 @@
#include "AndroidDataEncoder.h"
#include "AnnexB.h"
#include "H264.h"
#include "MediaData.h"
#include "MediaInfo.h"
#include "SimpleMap.h"
@ -171,9 +170,9 @@ RefPtr<MediaDataEncoder::EncodePromise> AndroidDataEncoder<ConfigType>::Encode(
static jni::ByteBuffer::LocalRef ConvertI420ToNV12Buffer(
RefPtr<const VideoData> aSample, RefPtr<MediaByteBuffer>& aYUVBuffer) {
const layers::PlanarYCbCrImage* image = aSample->mImage->AsPlanarYCbCrImage();
const PlanarYCbCrImage* image = aSample->mImage->AsPlanarYCbCrImage();
MOZ_ASSERT(image);
const layers::PlanarYCbCrData* yuv = image->GetData();
const PlanarYCbCrData* yuv = image->GetData();
auto ySize = yuv->YDataSize();
auto cbcrSize = yuv->CbCrDataSize();
size_t yLength = yuv->mYStride * ySize.height;

Просмотреть файл

@ -38,7 +38,6 @@ UNIFIED_SOURCES += [
"agnostic/VPXDecoder.cpp",
"agnostic/WAVDecoder.cpp",
"AllocationPolicy.cpp",
"MediaCodecsSupport.cpp",
"PDMFactory.cpp",
"PEMFactory.cpp",
"PlatformDecoderModule.cpp",

Просмотреть файл

@ -335,13 +335,9 @@ media::DecodeSupportSet WMFDecoderModule::Supports(
}
if (CanCreateMFTDecoder(type)) {
if (StreamTypeIsVideo(type)) {
return sDXVAEnabled ? media::DecodeSupport::HardwareDecode
: media::DecodeSupport::SoftwareDecode;
} else {
// Audio only supports software decode
return media::DecodeSupport::SoftwareDecode;
}
// TODO: Note that we do not yet distinguish between SW/HW decode support.
// Will be done in bug 1754239.
return media::DecodeSupport::SoftwareDecode;
}
return media::DecodeSupport::Unsupported;
@ -434,13 +430,17 @@ media::DecodeSupportSet WMFDecoderModule::SupportsMimeType(
if (!trackInfo) {
return media::DecodeSupport::Unsupported;
}
auto supports = Supports(SupportDecoderParams(*trackInfo), aDiagnostics);
MOZ_LOG(
sPDMLog, LogLevel::Debug,
("WMF decoder %s requested type '%s'",
supports != media::DecodeSupport::Unsupported ? "supports" : "rejects",
aMimeType.BeginReading()));
return supports;
bool supports = Supports(SupportDecoderParams(*trackInfo), aDiagnostics) !=
media::DecodeSupport::Unsupported;
MOZ_LOG(sPDMLog, LogLevel::Debug,
("WMF decoder %s requested type '%s'",
supports ? "supports" : "rejects", aMimeType.BeginReading()));
if (!supports) {
return media::DecodeSupport::Unsupported;
}
// TODO: Note that we do not yet distinguish between SW/HW decode support.
// Will be done in bug 1754239.
return media::DecodeSupport::SoftwareDecode;
}
} // namespace mozilla

Просмотреть файл

@ -265,8 +265,7 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
UniquePtr<TrackInfo> audioInfo = mTrackDemuxer->GetInfo();
// We actively ignore audio tracks that we know we can't play.
if (audioInfo && audioInfo->IsValid() &&
platform->SupportsMimeType(audioInfo->mMimeType) !=
media::DecodeSupport::Unsupported) {
platform->SupportsMimeType(audioInfo->mMimeType)) {
mMediaInfo.mAudio = *audioInfo->GetAsAudioInfo();
}
}

Просмотреть файл

@ -104,9 +104,8 @@ bool WebMDecoder::IsSupportedType(const MediaContainerType& aContainerType) {
// color depth
RefPtr<PDMFactory> platform = new PDMFactory();
for (const auto& track : tracks) {
if (!track || platform->Supports(SupportDecoderParams(*track),
nullptr /* diagnostic */) ==
media::DecodeSupport::Unsupported) {
if (!track || !platform->Supports(SupportDecoderParams(*track),
nullptr /* diagnostic */)) {
return false;
}
}

Просмотреть файл

@ -60,7 +60,7 @@ WebrtcVideoDecoder* MediaDataCodec::CreateDecoder(
return nullptr;
}
RefPtr<PDMFactory> pdm = new PDMFactory();
if (pdm->SupportsMimeType(codec) == media::DecodeSupport::Unsupported) {
if (!pdm->SupportsMimeType(codec)) {
return nullptr;
}

Просмотреть файл

@ -84,7 +84,6 @@ class gfxVarReceiver;
_(UseEGL, bool, false) \
_(DrmRenderDevice, nsCString, nsCString()) \
_(UseDMABuf, bool, false) \
_(CodecSupportInfo, nsCString, nsCString()) \
_(WebRenderRequiresHardwareDriver, bool, false) \
_(SupportsThreadsafeGL, bool, false) \
_(OffscreenCanvasDomainAllowlist, nsCString, nsCString()) \

Просмотреть файл

@ -326,7 +326,7 @@ mozilla::ipc::IPCResult GPUChild::RecvBHRThreadHang(
}
mozilla::ipc::IPCResult GPUChild::RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported) {
const PDMFactory::MediaCodecsSupported& aSupported) {
dom::ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn::GpuProcess, aSupported);
return IPC_OK();

Просмотреть файл

@ -79,7 +79,7 @@ class GPUChild final : public ipc::CrashReporterHelper<GeckoProcessType_GPU>,
const nsCString& aMessage);
mozilla::ipc::IPCResult RecvBHRThreadHang(const HangDetails& aDetails);
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported);
const PDMFactory::MediaCodecsSupported& aSupported);
mozilla::ipc::IPCResult RecvFOGData(ByteBuf&& aBuf);
bool SendRequestMemoryReport(const uint32_t& aGeneration,

Просмотреть файл

@ -37,7 +37,7 @@ using mozilla::gfx::Feature from "gfxFeature.h";
using mozilla::gfx::Fallback from "gfxFallback.h";
using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
using mozilla::layers::OverlayInfo from "mozilla/layers/OverlayInfo.h";
using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
namespace mozilla {
namespace gfx {

Просмотреть файл

@ -154,9 +154,6 @@ class MockGfxInfo final : public nsIGfxInfo {
NS_IMETHOD GetTargetFrameRate(uint32_t* aTargetFrameRate) override {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHOD GetCodecSupportInfo(nsACString& aCodecSupportInfo) override {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override {
return NS_ERROR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -5,7 +5,7 @@
include protocol PRemoteDecoderManager;
using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
using mozilla::PDMFactory::MediaCodecsSupported from "PDMFactory.h";
namespace mozilla {

Просмотреть файл

@ -40,7 +40,7 @@ RefPtr<UtilityAudioDecoderChild> UtilityAudioDecoderChild::GetSingleton() {
mozilla::ipc::IPCResult
UtilityAudioDecoderChild::RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported) {
const PDMFactory::MediaCodecsSupported& aSupported) {
dom::ContentParent::BroadcastMediaCodecsSupportedUpdate(
RemoteDecodeIn::UtilityProcess, aSupported);
return IPC_OK();

Просмотреть файл

@ -24,7 +24,7 @@ class UtilityAudioDecoderChild final : public PUtilityAudioDecoderChild {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UtilityAudioDecoderChild, override);
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
const media::MediaCodecsSupported& aSupported);
const PDMFactory::MediaCodecsSupported& aSupported);
UtilityActorName GetActorName() { return UtilityActorName::AudioDecoder; }

Просмотреть файл

@ -1052,12 +1052,6 @@ var snapshotFormatters = {
// Media Capabilitites
insertEnumerateDatabase();
// Codec decode/encode support information (inc. HW accel)
// Currently supported on Windows with Linux/OS X support under development
if (AppConstants.platform == "win") {
insertBasicInfo("media-codec-support-info", data.codecSupportInfo);
}
},
remoteAgent(data) {

Просмотреть файл

@ -164,7 +164,6 @@ media-device-channels = Channels
media-device-rate = Rate
media-device-latency = Latency
media-capabilities-title = Media Capabilities
media-codec-support-info = Codec Support Information
# List all the entries of the database.
media-capabilities-enumerate = Enumerate database

Просмотреть файл

@ -776,22 +776,6 @@ var dataProviders = {
.audioDevices(Ci.nsIDOMWindowUtils.AUDIO_INPUT)
.QueryInterface(Ci.nsIArray)
);
data.codecSupportInfo = "Unknown";
// We initialize gfxInfo here in the same way as in the media
// section -- should we break this out into a separate function?
try {
// nsIGfxInfo may not be implemented on some platforms.
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// Note: CodecSupportInfo is not populated until we have
// actually instantiated a PDM. We may want to add a button
// or some other means of allowing the user to manually
// instantiate a PDM to ensure that the data is available.
data.codecSupportInfo = gfxInfo.CodecSupportInfo;
} catch (e) {}
done(data);
},

Просмотреть файл

@ -859,10 +859,6 @@ const SNAPSHOT_SCHEMA = {
},
},
},
codecSupportInfo: {
required: false,
type: "string",
},
},
},
accessibility: {

Просмотреть файл

@ -1865,12 +1865,6 @@ GfxInfoBase::GetTargetFrameRate(uint32_t* aTargetFrameRate) {
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetCodecSupportInfo(nsACString& aCodecSupportInfo) {
aCodecSupportInfo.Assign(gfx::gfxVars::CodecSupportInfo());
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetIsHeadless(bool* aIsHeadless) {
*aIsHeadless = gfxPlatform::IsHeadless();

Просмотреть файл

@ -71,7 +71,6 @@ class GfxInfoBase : public nsIGfxInfo,
NS_IMETHOD GetWebRenderEnabled(bool* aWebRenderEnabled) override;
NS_IMETHOD GetIsHeadless(bool* aIsHeadless) override;
NS_IMETHOD GetTargetFrameRate(uint32_t* aTargetFrameRate) override;
NS_IMETHOD GetCodecSupportInfo(nsACString& aCodecSupportInfo) override;
// Non-XPCOM method to get IPC data:
nsTArray<mozilla::gfx::GfxInfoFeatureStatus> GetAllFeatures();

Просмотреть файл

@ -37,7 +37,6 @@ interface nsIGfxInfo : nsISupports
readonly attribute boolean WebRenderEnabled;
readonly attribute boolean isHeadless;
readonly attribute unsigned long TargetFrameRate;
readonly attribute ACString CodecSupportInfo;
// XXX: Switch to a list of devices, rather than explicitly numbering them.