Skip to content

Conversation

@eocanha
Copy link
Contributor

@eocanha eocanha commented Sep 30, 2025

989ce9f

[GStreamer] Don't advertise support for HDR on systems that don't explicitly declare that support
https://bugs.webkit.org/show_bug.cgi?id=299873

Reviewed by Philippe Normand.

Some websites and JS players can try to play HDR video on systems that
don't support it. Even when there isn't an effective HDR connected
screen detection mechanism yet in place on GStreamer ports, it would be
nice to at least report HDR as unsupported to those webpages asking for
it.

See: WebPlatformForEmbedded/WPEWebKit#1564

This patch now filters the MediaCapabilities query, so if the webpage
is asking for an hdrMetadataType or a transferFunction and our
internal screen data doesn't acknowledge the presence of an HDR screen,
we reply that such MediaCapabilities combination is not supported.

Also, if the requested codecs aren't supported (even by software),
we now return that the MediaCapabilities combination is not supported.

Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com>

* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isConfigurationSupported const): Apply filters. Check if codecs are supported.

Canonical link: https://commits.webkit.org/301049@main

d34484c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@eocanha eocanha requested a review from philn as a code owner September 30, 2025 18:58
@eocanha eocanha self-assigned this Sep 30, 2025
@eocanha eocanha added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Sep 30, 2025
@philn
Copy link
Member

philn commented Oct 1, 2025

/home/buildbot-worker/WPE-Build-EWS/build/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:1030:36: error: ‘primaryScreenDisplayID’ was not declared in this scope
 1030 |         auto* scrData = screenData(primaryScreenDisplayID());
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
/home/buildbot-worker/WPE-Build-EWS/build/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:1030:25: error: ‘screenData’ was not declared in this scope; did you mean ‘scrData’?
 1030 |         auto* scrData = screenData(primaryScreenDisplayID());
      |                         ^~~~~~~~~~
      |                         scrData

@eocanha
Copy link
Contributor Author

eocanha commented Oct 1, 2025

error: ‘primaryScreenDisplayID’ was not declared in this scope

Sorry, this is embarrassing... It turns out that using WebKitGTK to check if a code ifdeffed for WPE works or even builds doesn't look like a great idea. "Now I understand why it was building on my machine" 🤦

I'm submitting a new version with the extra required includes.

@eocanha eocanha removed the merging-blocked Applied to prevent a change from being merged label Oct 1, 2025
videoConfiguration.bitrate, videoConfiguration.framerate);
#endif

#if PLATFORM(WPE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this please?

@eocanha eocanha added the merge-queue Applied to send a pull request to merge-queue label Oct 6, 2025
…licitly declare that support

https://bugs.webkit.org/show_bug.cgi?id=299873

Reviewed by Philippe Normand.

Some websites and JS players can try to play HDR video on systems that
don't support it. Even when there isn't an effective HDR connected
screen detection mechanism yet in place on GStreamer ports, it would be
nice to at least report HDR as unsupported to those webpages asking for
it.

See: WebPlatformForEmbedded/WPEWebKit#1564

This patch now filters the MediaCapabilities query, so if the webpage
is asking for an hdrMetadataType or a transferFunction and our
internal screen data doesn't acknowledge the presence of an HDR screen,
we reply that such MediaCapabilities combination is not supported.

Also, if the requested codecs aren't supported (even by software),
we now return that the MediaCapabilities combination is not supported.

Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com>

* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isConfigurationSupported const): Apply filters. Check if codecs are supported.

Canonical link: https://commits.webkit.org/301049@main
@webkit-commit-queue
Copy link
Collaborator

Committed 301049@main (989ce9f): https://commits.webkit.org/301049@main

Reviewed commits have been landed. Closing PR #51577 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 989ce9f into WebKit:main Oct 6, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants