Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GStreamer] refactor video decoder limit customization #7381

Conversation

pgorszkowski-igalia
Copy link
Contributor

@pgorszkowski-igalia pgorszkowski-igalia commented Dec 9, 2022

c367583

[GStreamer] refactor video decoder limit customization
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

7e64ee9

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@pgorszkowski-igalia pgorszkowski-igalia added the Media Bugs related to the HTML 5 Media elements. label Dec 9, 2022
Copy link
Contributor

@eocanha eocanha left a comment

Choose a reason for hiding this comment

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

Appart from the comments, the rest of the changes look fine to me.

videoDecodingLimits = videoDecoderLimitsDefaults();
if (!videoDecodingLimits) {
GST_WARNING("Parsing VIDEO_DECODING_LIMIT failed");
ASSERT_NOT_REACHED();
Copy link
Contributor

Choose a reason for hiding this comment

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

The style checker complained about this. Try adding return SupportsType::IsNotSupported; after this line to ensure that an early return happens in case assertions are disabled at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we really want to return IsNotSupport in case of wrongly set VIDEO_DECODING_LIMIT? The consequence will be that none of the stream will be played.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the packager has decided to enable VIDEO_DECODING_LIMIT in CMake, then they should take care of properly defining the limit. Getting all the videos failing is a good way of noticing that something is wrong, so it's acceptable to me (although I'm not a reviewer).

: mediaMaxWidth(mediaMaxWidth)
, mediaMaxHeight(mediaMaxHeight)
, mediaMaxFrameRate(mediaMaxFrameRate)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be one tab less, like in this example.

@pgorszkowski-igalia pgorszkowski-igalia force-pushed the eng/GStreamer-refactor-video-decoder-limit-customization branch from 3f4aec5 to b0cc7e3 Compare December 13, 2022 16:04
Copy link
Member

@philn philn left a comment

Choose a reason for hiding this comment

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

Could these checks be done only when configuration == Configuration::Decoding?

@pgorszkowski-igalia
Copy link
Contributor Author

pgorszkowski-igalia commented Mar 3, 2023

Could these checks be done only when configuration == Configuration::Decoding?

@philn : Sorry for late response, I will add it ASAP.

@pgorszkowski-igalia pgorszkowski-igalia force-pushed the eng/GStreamer-refactor-video-decoder-limit-customization branch from b0cc7e3 to 4477143 Compare April 3, 2023 10:13
@pgorszkowski-igalia pgorszkowski-igalia force-pushed the eng/GStreamer-refactor-video-decoder-limit-customization branch from 4477143 to 7e64ee9 Compare April 25, 2023 14:55
@pgorszkowski-igalia
Copy link
Contributor Author

It works with correct value e.g.:
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024x768@25

I tested it also with few incorrect values:
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024x768@
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024x768
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024x
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024
Tools/Scripts/build-webkit --gtk --cmakeargs=-DVIDEO_DECODING_LIMIT=1024@25

In case of incorrect value the limit is not applied - as expected.

For testing I used dashjs reference player:
Tools/Scripts/run-minibrowser --gtk https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

@pgorszkowski-igalia pgorszkowski-igalia added the request-merge-queue Request a pull request to be added to merge-queue once ready label Apr 26, 2023
@philn philn added merge-queue Applied to send a pull request to merge-queue and removed request-merge-queue Request a pull request to be added to merge-queue once ready labels Apr 26, 2023
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
@webkit-commit-queue webkit-commit-queue force-pushed the eng/GStreamer-refactor-video-decoder-limit-customization branch from 7e64ee9 to c367583 Compare April 26, 2023 08:18
@webkit-commit-queue
Copy link
Collaborator

Committed 263408@main (c367583): https://commits.webkit.org/263408@main

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

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 26, 2023
@webkit-commit-queue webkit-commit-queue merged commit c367583 into WebKit:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Media Bugs related to the HTML 5 Media elements.
Projects
None yet
5 participants