Repository navigation
[MediaCapabilities][GStreamer] Check audio codecs support isConfigurationSupported() - #60871
Conversation
|
EWS run on previous version of this PR (hash 9b1aa9f) Details |
calvaris
left a comment
There was a problem hiding this comment.
This implies a behavioral change as it forces to have a hardware audio codec that is also hardware accerelated to consider something to be power efficient. Other browsers and ports consider only video for power efficiency and it is what we should do. Even when the spec allows this, I don't think we should have this behavioral change, at least by default upstream.
Hmmm... you have a point, yes. It would be unreasonable to flag "H264 video + mpeg audio" as "not hardware accelerated" in a case where there's no hardware accelerated mpeg audio decoder but there's an accelerated H264 decoder. Doing this might lead to a worse video encoding format final choice by the webpage. I'm going to remove the audio part from the "hardware acelerated" flagging. |
|
EWS run on previous version of this PR (hash 48a96b1) Details |
calvaris
left a comment
There was a problem hiding this comment.
I think you should also write a test for this.
| allCodecs.appendVector(contentType.codecs()); | ||
| videoCodecs.appendVector(contentType.codecs()); |
There was a problem hiding this comment.
Please cache the codecs() result to not parse them more than once.
| if (!allCodecs.isEmpty()) { | ||
| if (!areAllCodecsSupported(configuration, allCodecs, false)) | ||
| return { false, false, nullptr }; | ||
| isUsingHardware = areAllCodecsSupported(configuration, videoCodecs, true); |
There was a problem hiding this comment.
| isUsingHardware = areAllCodecsSupported(configuration, videoCodecs, true); | |
| isUsingHardware = !videoCodecs.isEmpty() && areAllCodecsSupported(configuration, videoCodecs, true); | |
areAllCodecsSupported returns true if the vector is empty and we don't want that here.
|
EWS run on previous version of this PR (hash d14c2dd) Details |
calvaris
left a comment
There was a problem hiding this comment.
Please, try the test crossplatform and if it works, it's preferred.
| isUsingHardware = areAllCodecsSupported(configuration, codecs, true); | ||
| } | ||
| allCodecs.appendVector(codecs); | ||
| videoCodecs.appendVector(codecs); |
There was a problem hiding this comment.
If you WTF::move in the second call, you save a vector copy.
No, it doesn't. Mac doesn't support |
|
EWS run on current version of this PR (hash 7cfa03d) Details |
…tionSupported() https://bugs.webkit.org/show_bug.cgi?id=310195 Reviewed by Xabier Rodriguez-Calvar. Currently, isConfigurationSupported() only validates video codecs against the registered decoder/encoder map. Audio codecs from the audio configuration were never checked, so unsupported audio codecs could incorrectly be reported as supported. See: WebPlatformForEmbedded/WPEWebKit#1640 Fix this by collecting codec strings from both the video and audio ContentType objects into a single vector and running the software codec support checks once on the combined list at the end of the function. Audio hardware accelerated decoding doesn't save much CPU power compared to video accelerated decoding, and we don't want to reject a video+audio codec combination just because the audio part isn't accelerated. That's why the hardware accelerated decoding support checks are only run on the video codecs. A new platform-specific layout test has been added to check that common audio formats and codecs are properly detected (but without power-efficient decoding, that is, without hardware decoding), while an unexistent "fictional" codec is rejected. Co-authored by: Andrzej Surdej (https://github.com/asurdej-comcast) * LayoutTests/platform/glib/media/mediacapabilities/audio-decoding-info-expected.txt: Added. * LayoutTests/platform/glib/media/mediacapabilities/audio-decoding-info.html: Added. * Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isConfigurationSupported const): Collect audio codecs and run the codec checks. Canonical link: https://commits.webkit.org/309939@main
7cfa03d to
e89e1a0
Compare
|
Committed 309939@main (e89e1a0): https://commits.webkit.org/309939@main Reviewed commits have been landed. Closing PR #60871 and removing active labels. |
e89e1a0
7cfa03d
🛠 win🧪 wpe-wk2🧪 win-tests🧪 ios-wk2🧪 api-mac🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios🛠 ios-safer-cpp🧪 mac-wk2🧪 gtk-wk2🧪 mac-AS-debug-wk2🛠 playstation🧪 mac-intel-wk2🛠 tv-sim🛠 watch-sim