Skip to content

Commit 28d39a4

Browse files
filipe-norte-redeocanha
authored andcommitted
[GStreamer] Fix content type frame rate limit
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: #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
1 parent 6dde29e commit 28d39a4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,12 @@ MediaPlayerEnums::SupportsType GStreamerRegistryScanner::isContentTypeSupported(
795795
if (!ok)
796796
height = 0;
797797

798-
if (videoDecodingLimits && (width > videoDecodingLimits->mediaMaxWidth || height > videoDecodingLimits->mediaMaxHeight))
799-
return SupportsType::IsNotSupported;
800-
801798
float frameRate = contentType.parameter("framerate"_s).toFloat(&ok);
802-
// Limit frameRate only in case of highest supported resolution.
803-
if (ok && videoDecodingLimits && width == videoDecodingLimits->mediaMaxWidth && height == videoDecodingLimits->mediaMaxHeight && frameRate > videoDecodingLimits->mediaMaxFrameRate)
799+
if (!ok)
800+
frameRate = 0;
801+
802+
if (videoDecodingLimits && (width > videoDecodingLimits->mediaMaxWidth || height > videoDecodingLimits->mediaMaxHeight
803+
|| frameRate > videoDecodingLimits->mediaMaxFrameRate))
804804
return SupportsType::IsNotSupported;
805805

806806
const auto& codecs = contentType.codecs();

0 commit comments

Comments
 (0)