limit the gstreamer backend to simple self-contained media

The adaptive-streaming cases follow a more complicated indirect route of
a manifest to further resources which is atypical for our use.

Change-Id: I1a3e51d23cc4e8e2912304d5d1c3337c71c1029e
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7008
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit c7eada5bc2233369e196f2c93e7606b56e3acc62)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208330
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2026-07-21 11:37:01 +02:00
committed by Xisco Fauli
parent 98140e40d3
commit 939af1c1c7
+33
View File
@@ -33,6 +33,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <sal/log.hxx>
#include <rtl/string.hxx>
#include <o3tl/string_view.hxx>
#include <salhelper/thread.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
@@ -329,6 +330,38 @@ Player::Player() :
mbInitialized = gst_init_check( &argc, &argv, &pError );
if (mbInitialized)
{
// Drop the "Adaptive" ones to rank none as a crude but simple way to
// drop the cases that take a manifest to further resources that it
// names. Otherwise an option is to follow more closely what browsers
// probably do here and register a handler for fetching data.
GstRegistry* pRegistry = gst_registry_get();
GList* pFactories = gst_registry_get_feature_list(pRegistry, GST_TYPE_ELEMENT_FACTORY);
for (GList* pItem = pFactories; pItem; pItem = pItem->next)
{
GstElementFactory* pFactory = GST_ELEMENT_FACTORY(pItem->data);
const gchar* pKlass = gst_element_factory_get_metadata(pFactory, GST_ELEMENT_METADATA_KLASS);
if (!pKlass)
continue;
OString aKlass(pKlass);
bool bAdaptive = false;
for (sal_Int32 nIndex = 0; nIndex >= 0;)
{
if (o3tl::getToken(aKlass, 0, '/', nIndex) == "Adaptive")
{
bAdaptive = true;
break;
}
}
if (bAdaptive)
gst_plugin_feature_set_rank(GST_PLUGIN_FEATURE(pFactory), GST_RANK_NONE);
}
gst_plugin_feature_list_free(pFactories);
}
SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::Player" );
if (pError != nullptr)