}
static gboolean
-_filter_factories_for_caps (GstElementFactory * factory, const GstCaps * caps)
+check_factory_for_caps (GstElementFactory * factory, const GstCaps * caps)
{
GstCaps *fcaps = _get_sub_caps (factory);
gboolean ret = (fcaps) ? gst_caps_can_intersect (fcaps, caps) : FALSE;
return ret;
}
+static GList *
+gst_subtitle_overlay_get_factories_for_caps (const GList * list,
+ const GstCaps * caps)
+{
+ const GList *walk = list;
+ GList *result = NULL;
+
+ while (walk) {
+ GstElementFactory *factory = walk->data;
+
+ walk = g_list_next (walk);
+
+ if (check_factory_for_caps (factory, caps)) {
+ result = g_list_prepend (result, factory);
+ }
+ }
+
+ return result;
+}
+
static gint
_sort_by_ranks (GstPluginFeature * f1, GstPluginFeature * f2)
{
g_mutex_lock (self->factories_lock);
gst_subtitle_overlay_update_factory_list (self);
if (subcaps) {
- factories = gst_filter_run (self->factories,
- (GstFilterFunc) _filter_factories_for_caps, FALSE, subcaps);
+ factories =
+ gst_subtitle_overlay_get_factories_for_caps (self->factories, subcaps);
if (!factories) {
GstMessage *msg;