Closed Bug 1853057 Opened 14 days ago Closed 13 days ago

Remove `DecodeSupport::Unsupported`

Categories

(Core :: Audio/Video: Playback, task, P1)

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(2 files)

Two reasons to remove DecodeSupport::Unsupported

  1. If a DecodeSupportSet doesn't set any decode support, then it won't be equal to DecodeSupport::Unsupported

We have many codes to use this pattern, XXX != media::DecodeSupport::Unsupported or XXX == media::DecodeSupport::Unsupported. But this comparison would fail if the DecodeSupportSet is empty.

For example, in MCSInfo::GetDecodeSupportSet(), if there is no support for the codec, that function would return an empty DecodeSupportSet.

An empty DecodeSupportSet is not equal to media::DecodeSupport::Unsupported, so it leads to an incorrect result. DecodeSupportSet{} != media::DecodeSupport::Unsupported will be true, which is not what we expected.

  1. Semantic meaning
    Every flag in EnumSet should be able to exist in the same time. But DecodeSupport::Unsupported is exclusive with other attributes. Eg. It doesn't make sense to have both Unsupported and SoftwareDecode flags on in the same time.

See more details in Bug 1853057 comment0.

When asking config in the content process, we should return result based
on the cached result in the remote decoder because we don't want
to run Windows Media Foundation (WMF) in the content process, which
should be better to run only in the higher security sandboxed process.

We use that function in [1] in the content process to indentify what
types the media engine supports.

[1] https://searchfox.org/mozilla-central/rev/b6cd901cf074c5e75e3902d660bafa3cf3967c40/dom/media/ExternalEngineStateMachine.cpp#332-337

Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/34cf458aac56
remove DecodeSupport::Unsupport. r=azebrowski
https://hg.mozilla.org/integration/autoland/rev/064771e8ad7a
use the cached remote result to anwser the support information. r=jolin
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ebd79534e63f
remove DecodeSupport::Unsupport. r=azebrowski
https://hg.mozilla.org/integration/autoland/rev/2ed0045b3cbf
use the cached remote result to anwser the support information. r=jolin

Relanded this because it turned out to be from Bug 1852806.

Flags: needinfo?(alwu)
Regressions: 1853285
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.