Closed Bug 1846102 Opened 11 months ago Closed 10 months ago

Distinguish "supported codec" from "valid codec"

Categories

(Core :: Audio/Video: Web Codecs, task, P1)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

(Blocks 1 open bug)

Details

Attachments

(7 files)

We need to distinguish the concept of a "supported" codec string from a "valid" codec string to meet the latest spec validating the codec here (bug 1843974). In short, the "invalid" is more like "empty" rather than "unrecognized". The "recognized" string must be a "valid" string, while the "valid" string may be "unrecognized". A "recognized" codec may not be "supported". That is, "valid" codec strings set ⊇ "recognized" codec strings set ⊇ "supported" codec strings set.

For example, the codec string "theora" is "valid" but it's "unsupported" in WebCodecs.

By the latest spec about validating VideoDecoderConfig, the codec string
can have leading and trailing spaces, so we should trim them to get the
real codec string.

[1] https://w3c.github.io/webcodecs/#valid-videodecoderconfig

This patch adds a function to get the pointer pointing to the value in
Optional if any.

Depends on D184870

This patch addes a struct that holds the parameters needed for
GuessMIMETypes() and the struct members can be set automatically from
VideoDecoderConfig{Internal}.

Depends on D184871

By the latest spec [1], the "invalid" is more like "empty" rather than
"supported". The "supported" codec must be a "valid" codec, while the
"valid" codec may be "unsupported".

[1] https://github.com/w3c/webcodecs/pull/707

Depends on D184872

Depends on: 1843974
Attachment #9346338 - Attachment description: WIP: Bug 1846102 - Trim leading and trailing spaces in codec string → Bug 1846102 - Trim leading and trailing spaces in codec string
Attachment #9346339 - Attachment description: WIP: Bug 1846102 - Add a shortcut to get pointer from Optional → Bug 1846102 - Add a shortcut to get pointer from Optional
Attachment #9346340 - Attachment description: WIP: Bug 1846102 - Pack GuessMIMETypes parameters into struct → Bug 1846102 - Pack GuessMIMETypes parameters into struct
Attachment #9346341 - Attachment description: WIP: Bug 1846102 - Distinguish "supported" from "valid" codec → Bug 1846102 - Distinguish "supported" from "valid" codec

The code has been updated to meet the latest spec in previous patches,
so the expected test results of the corresponding WPTs need to be
updated as well.

Since the corresponding WPTs for configure is out-of-spec, those
expected results will be changed in next patch instead.

Depends on D184873

By step 6-3 in VideoDecoder's configure method, when the codec is
unsupported, the NotSupportedError will be delivered within the error
callback via Close-VideoDecoder algorithm, instead of being throwed
directly when configure method is called.

[1] https://w3c.github.io/webcodecs/#dom-videodecoder-configure

Depends on D185602

Depends on D185603

Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd7a5604e5c8
Trim leading and trailing spaces in codec string r=padenot
https://hg.mozilla.org/integration/autoland/rev/c85f0431aa2a
Add a shortcut to get pointer from Optional r=padenot
https://hg.mozilla.org/integration/autoland/rev/2971219bf521
Pack GuessMIMETypes parameters into struct r=padenot
https://hg.mozilla.org/integration/autoland/rev/c7b50d615dfb
Distinguish "supported" from "valid" codec r=padenot
https://hg.mozilla.org/integration/autoland/rev/0a9b9052fa63
Update isConfigSupported's WPT expectation r=padenot
https://hg.mozilla.org/integration/autoland/rev/14c5bb13b4ac
Make WPTs spec-compliant r=padenot
https://hg.mozilla.org/integration/autoland/rev/ae4f74d6364a
Ensure codec string with spaces is valid r=padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41421 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Regressions: 1848460
No longer regressions: 1848460
Regressions: 1874293
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: