Skip to content

[GST] Expose VIDEO_DECODING_LIMIT through env variable#1626

Open
asurdej-comcast wants to merge 4 commits intoWebPlatformForEmbedded:wpe-2.38from
asurdej-comcast:video_decoding_limit_2.38
Open

[GST] Expose VIDEO_DECODING_LIMIT through env variable#1626
asurdej-comcast wants to merge 4 commits intoWebPlatformForEmbedded:wpe-2.38from
asurdej-comcast:video_decoding_limit_2.38

Conversation

@asurdej-comcast
Copy link

With RDK-E and common webkit build we can't use per platform compile time option any more. This change adds WEBKIT_GST_VIDEO_DECODING_LIMIT env on top of VIDEO_DECODING_LIMIT compile time option to limit video decoding capabilities.

This PR also backports couple of related changes to align with 2.46 version

pgorszkowski-igalia and others added 4 commits February 26, 2026 14:47
https://bugs.webkit.org/show_bug.cgi?id=248961

Reviewed by Philippe Normand.

Moved the same functionality to one place - from
MediaPlayerPrivateGStreamerMSE::supportsType to
GStreamerRegistryScanner::isContentTypeSupported.

* Source/WebCore/platform/GStreamer.cmake:
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(videoDecoderLimitsDefaults):
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const):
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
(videoDecoderLimitsDefaults): Deleted.

Canonical link: https://commits.webkit.org/263408@main
https://bugs.webkit.org/show_bug.cgi?id=264941

Reviewed by Philippe Normand.

When VIDEO_DECODING_LIMIT support is enabled, after a first call of
isContentTypeSupported() with Configuration::Decoding, the video
limits are remembered in a static variable.

They were then used for all subsequent isContentTypeSupported() calls,
regardless of the configuration.

This should be limited to Configuration::Decoding.

* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const):

Canonical link: https://commits.webkit.org/270877@main
https://bugs.webkit.org/show_bug.cgi?id=296572

Reviewed by Philippe Normand.

Decoder limits are set by a build configuration in the form of
widthxheight@framerate. However, framerate limit is only considered when
the width and height are the ones in the build config. If the actual
requested resolution is different, no framerate limit is ever
considered.

See: WebPlatformForEmbedded#1547

This change introduces a behavior where limits where considered for each
variable independently. While not ideal, as lower resolutions might
support higher frame rates, and the way the build config ties
semantically the framerate to the resolution specified, an alternative
fix would require either an absolute max rate to be specified, or
possibly different sets of resolution + framerate limits, which might be
overkill to this purpose.

Original autor: Filipe Norte <filipe_norte@comcast.com>

* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Limit framerate even when the dimensions are smaller than the max limit set for them.

Canonical link: https://commits.webkit.org/297974@main
WEBKIT_GST_VIDEO_DECODING_LIMIT can now be set in runtime
and it takes precedence over compile time definition VIDEO_DECODING_LIMIT.
@modeveci modeveci requested review from ntrrgc and removed request for philn March 2, 2026 09:59
@eocanha eocanha requested review from eocanha and removed request for ntrrgc March 2, 2026 13:57
eocanha added a commit to eocanha/WebKit that referenced this pull request Mar 2, 2026
https://bugs.webkit.org/show_bug.cgi?id=308969

Reviewed by NOBODY (OOPS!).

The RDK-E downstream platform would like to have a single unified build
for many kind of devices. For that reason, the platform compile-time
VIDEO_DECODING_LIMIT restriction aren't appropriate anymore, since the
same build can be used for devices with different runtime limits. A way
to specify the decoding limit ar runtime would be desirable.

An environment variable looks like a better way to do it than a runtime
setting, since the limit is unlikely to change at runtime and likely to
change per device (with a value consistent on every execution).
Moreover, having a setting would mean extra changes in the dependent
packages that embed WebKit, while having en environmente variable would
be less intrusive and would only mean a change in the (easier to
maintain) startup scripts.

This change adds WEBKIT_GST_VIDEO_DECODING_LIMIT env on top of
VIDEO_DECODING_LIMIT compile time option to limit video decoding
capabilities. WEBKIT_GST_VIDEO_DECODING_LIMIT can now be set in runtime
and it takes precedence over compile time definition
VIDEO_DECODING_LIMIT.

See: WebPlatformForEmbedded/WPEWebKit#1625
     WebPlatformForEmbedded/WPEWebKit#1626

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

* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Parse env var and only require the build ifdefs when strictly needed.
(videoDecoderLimitsDefaults): Deleted.
@eocanha
Copy link
Member

eocanha commented Mar 2, 2026

The VIDEO_DECODING_LIMIT commit was submitted upstream for review as https://bugs.webkit.org/show_bug.cgi?id=308969 / WebKit/WebKit#59726

@eocanha eocanha added the upstream Related to an upstream bug (or should be at some point) label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Related to an upstream bug (or should be at some point) wpe-2.38

Development

Successfully merging this pull request may close these issues.

6 participants