-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VideoDecoder.configure should not throw on unsupported codecs
https://bugs.webkit.org/show_bug.cgi?id=260622 rdar://114336853 Reviewed by Eric Carlson. Make sure isConfigSupported resolves the promise with unsupported = true in this case. Ditto for VideoDecoder.configure. To do this, we add additional checks in LibWebRTCCodecsProxy to better validate codec string support in GPUProcess. Since decoder creation may now fail, we update IPC code like for encoders to return the failure to WebProcess. We add specific checks for VP9, H264 and H265. * LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-decoder.https.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-decoder.https.any.js: (validButUnsupportedConfigs.forEach.entry.promise_test.async t): (validConfigs.forEach.entry.promise_test.async t): * LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-decoder.https.any.worker-expected.txt: * LayoutTests/platform/glib/TestExpectations: * Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp: (WebCore::isSupportedDecoderCodec): (WebCore::isValidDecoderConfig): (WebCore::WebCodecsVideoDecoder::configure): (WebCore::WebCodecsVideoDecoder::isConfigSupported): * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/platform/graphics/HEVCUtilities.cpp: (WebCore::parseAVCCodecParameters): * Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.h: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: * Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::validateCodecString): (WebKit::LibWebRTCCodecsProxy::createDecoder): (WebKit::LibWebRTCCodecsProxy::releaseDecoder): (WebKit::LibWebRTCCodecsProxy::doDecoderTask): * Source/WebKit/WebProcess/GPU/media/RemoteVideoCodecFactory.cpp: (WebKit::RemoteVideoCodecFactory::createDecoder): * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::videoCodecTypeFromWebCodec): (WebKit::createRemoteDecoder): (WebKit::LibWebRTCCodecs::createDecoder): (WebKit::LibWebRTCCodecs::createDecoderAndWaitUntilReady): (WebKit::LibWebRTCCodecs::createDecoderInternal): (WebKit::LibWebRTCCodecs::gpuProcessConnectionDidClose): * Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h: Canonical link: https://commits.webkit.org/267272@main
- Loading branch information
Showing
14 changed files
with
251 additions
and
66 deletions.
There are no files selected for viewing
29 changes: 21 additions & 8 deletions
29
LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-decoder.https.any-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
|
||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Missing codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Empty codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Unrecognized codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Audio codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Ambiguous codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Codec with MIME type | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Missing codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Empty codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Unrecognized codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Audio codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Ambiguous codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Codec with MIME type | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Unrecognized codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Unrecognized codec with dataview description | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Audio codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Ambiguous codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Codec with MIME type | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future H264 codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future HEVC codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future VP9 codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future AV1 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Unrecognized codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Unrecognized codec with dataview description | ||
PASS Test that VideoDecoder.configure() doesn't support config: Audio codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Ambiguous codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Codec with MIME type | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future H264 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future HEVC codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future VP9 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future AV1 codec string | ||
PASS Test VideoDecoder construction | ||
PASS Test that VideoDecoder.isConfigSupported() accepts config:valid codec with spaces | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 21 additions & 8 deletions
29
...sts/imported/w3c/web-platform-tests/webcodecs/video-decoder.https.any.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
|
||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Missing codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Empty codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Unrecognized codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Audio codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Ambiguous codec | ||
PASS Test that VideoDecoder.isConfigSupported() rejects invalid config:Codec with MIME type | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Missing codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Empty codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Unrecognized codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Audio codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Ambiguous codec | ||
PASS Test that VideoDecoder.configure() rejects invalid config:Codec with MIME type | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Unrecognized codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Unrecognized codec with dataview description | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Audio codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Ambiguous codec | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Codec with MIME type | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future H264 codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future HEVC codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future VP9 codec string | ||
PASS Test that VideoDecoder.isConfigSupported() doesn't support config: Possible future AV1 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Unrecognized codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Unrecognized codec with dataview description | ||
PASS Test that VideoDecoder.configure() doesn't support config: Audio codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Ambiguous codec | ||
PASS Test that VideoDecoder.configure() doesn't support config: Codec with MIME type | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future H264 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future HEVC codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future VP9 codec string | ||
PASS Test that VideoDecoder.configure() doesn't support config: Possible future AV1 codec string | ||
PASS Test VideoDecoder construction | ||
PASS Test that VideoDecoder.isConfigSupported() accepts config:valid codec with spaces | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.