Skip to content

Commit 1c9c32e

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 f8f661c commit 1c9c32e

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
@@ -823,12 +823,12 @@ MediaPlayerEnums::SupportsType GStreamerRegistryScanner::isContentTypeSupported(
823823
if (!ok)
824824
height = 0;
825825

826-
if (videoDecodingLimits && (width > videoDecodingLimits->mediaMaxWidth || height > videoDecodingLimits->mediaMaxHeight))
827-
return SupportsType::IsNotSupported;
828-
829826
float frameRate = contentType.parameter("framerate"_s).toFloat(&ok);
830-
// Limit frameRate only in case of highest supported resolution.
831-
if (ok && videoDecodingLimits && width == videoDecodingLimits->mediaMaxWidth && height == videoDecodingLimits->mediaMaxHeight && frameRate > videoDecodingLimits->mediaMaxFrameRate)
827+
if (!ok)
828+
frameRate = 0;
829+
830+
if (videoDecodingLimits && (width > videoDecodingLimits->mediaMaxWidth || height > videoDecodingLimits->mediaMaxHeight
831+
|| frameRate > videoDecodingLimits->mediaMaxFrameRate))
832832
return SupportsType::IsNotSupported;
833833

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

0 commit comments

Comments
 (0)