Backed out changeset 5871f19bf25d (bug 1855058) for causing geckoview failures in GetMediaCodecsSupportedString CLOSED TREE

This commit is contained in:
Cristian Tuns 2023-09-27 13:03:29 -04:00
parent aa7253a06f
commit 90952a1cc2
2 changed files with 11 additions and 19 deletions

View File

@ -108,27 +108,20 @@ void MCSInfo::GetMediaCodecsSupportedString(
CODEC_SUPPORT_LOG("Can't get codec support string w/o a MCSInfo instance!");
return;
}
for (const auto& it : GetAllCodecDefinitions()) {
if (it.codec == MediaCodec::SENTINEL) {
break;
}
if (!instance->mHashTableCodec->Get(it.codec, &supportInfo)) {
CODEC_SUPPORT_LOG("Can't find codec for MediaCodecsSupported enum: %d",
static_cast<int>(it.codec));
for (const auto& it : aSupportedCodecs) {
if (!instance->mHashTableMCS->Get(it, &supportInfo)) {
CODEC_SUPPORT_LOG("Can't find string for MediaCodecsSupported enum: %d",
static_cast<int>(it));
aSupportString.Append("Unknown codec entry found!\n"_ns);
continue;
}
// Get codec name string and append SW/HW support info
aSupportString.Append(supportInfo.commonName);
bool foundSupport = false;
if (aSupportedCodecs.contains(it.swDecodeSupport)) {
if (it == supportInfo.swDecodeSupport) {
aSupportString.Append(" SW"_ns);
foundSupport = true;
}
if (aSupportedCodecs.contains(it.hwDecodeSupport)) {
if (it == supportInfo.hwDecodeSupport) {
aSupportString.Append(" HW"_ns);
foundSupport = true;
}
if (!foundSupport) {
aSupportString.Append(" NONE"_ns);
}
aSupportString.Append("\n"_ns);
}

View File

@ -1181,7 +1181,7 @@ var snapshotFormatters = {
for (const codec_string of data.codecSupportInfo.split("\n")) {
const s = codec_string.split(" ");
const codec_name = s[0];
const codec_support = s.slice(1);
const codec_support = s[1];
if (!(codec_name in codecs)) {
codecs[codec_name] = {
@ -1191,10 +1191,9 @@ var snapshotFormatters = {
};
}
if (codec_support.includes("SW")) {
if (codec_support === "SW") {
codecs[codec_name].sw = true;
}
if (codec_support.includes("HW")) {
} else if (codec_support === "HW") {
codecs[codec_name].hw = true;
}
}