GStreamer源码剖析——uridecodebin(1)
How to enable software decoder with uridecedebin.
force-sw-decoders
/* Must be called with factories lock! */
static void
gst_uri_decode_bin_update_factories_list (GstURIDecodeBin * dec)
{
guint32 cookie;
GList *factories, *tmp;
cookie = gst_registry_get_feature_list_cookie (gst_registry_get ());
if (!dec->factories || dec->factories_cookie != cookie) {
if (dec->factories)
gst_plugin_feature_list_free (dec->factories);
factories =
gst_element_factory_list_get_elements
(GST_ELEMENT_FACTORY_TYPE_DECODABLE, GST_RANK_MARGINAL);
if (dec->force_sw_decoders) {
/* filter out Hardware class elements */
dec->factories = NULL;
for (tmp = factories; tmp; tmp = g_list_next (tmp)) {
GstElementFactory *factory = GST_ELEMENT_FACTORY_CAST (tmp->data);
if (!gst_element_factory_list_is_type (factory,
GST_ELEMENT_FACTORY_TYPE_HARDWARE)) {
dec->factories = g_list_prepend (dec->factories, factory);
} else {
gst_object_unref (factory);
}
}
g_list_free (factories);
} else {
dec->factories = factories;
}
dec->factories =
g_list_sort (dec->factories, gst_playback_utils_compare_factories_func);
dec->factories_cookie = cookie;
}
}autoplug-sort

autoplug-select

后记
Last updated