Skip to content

Commit

Permalink
[GStreamer] Downrank dashdemux when native DASH has been disabled
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=257649

Reviewed by Xabier Rodriguez-Calvar.

This is needed when the UA attempts to load a DASH manifest without checking the support with
`canPlay()` beforehand.

* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements):

Canonical link: https://commits.webkit.org/264856@main
  • Loading branch information
philn committed Jun 5, 2023
1 parent 0dfd18e commit 1e30f54
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -384,6 +384,14 @@ void registerWebKitGStreamerElements()
gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE_CAST(factory.get()), GST_RANK_NONE);
}

// Prevent decodebin(3) from auto-plugging dashdemux if it was disabled. UAs should be able
// to fallback to MSE when this happens.
const char* dashSupport = g_getenv("WEBKIT_GST_ENABLE_DASH_SUPPORT");
if (!dashSupport || !g_strcmp0(dashSupport, "0")) {
if (auto factory = adoptGRef(gst_element_factory_find("dashdemux")))
gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE_CAST(factory.get()), GST_RANK_NONE);
}

// The new demuxers based on adaptivedemux2 cannot be used in WebKit yet because this new
// base class does not abstract away network access. They can't work in a sandboxed
// media process, so demote their rank in order to prevent decodebin3 from auto-plugging them.
Expand Down

0 comments on commit 1e30f54

Please sign in to comment.