diff --git a/gst/autodetect/gstautoaudiosink.c b/gst/autodetect/gstautoaudiosink.c index b07479f0db..340e9a2382 100644 --- a/gst/autodetect/gstautoaudiosink.c +++ b/gst/autodetect/gstautoaudiosink.c @@ -204,18 +204,6 @@ gst_auto_audio_sink_factory_filter (GstPluginFeature * feature, gpointer data) return TRUE; } -static gint -gst_auto_audio_sink_compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2) -{ - gint diff; - - diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1); - if (diff != 0) - return diff; - return strcmp (gst_plugin_feature_get_name (f2), - gst_plugin_feature_get_name (f1)); -} - static GstElement * gst_auto_audio_sink_create_element_with_pretty_name (GstAutoAudioSink * sink, GstElementFactory * factory) @@ -251,7 +239,8 @@ gst_auto_audio_sink_find_best (GstAutoAudioSink * sink) list = gst_registry_feature_filter (gst_registry_get (), (GstPluginFeatureFilter) gst_auto_audio_sink_factory_filter, FALSE, sink); - list = g_list_sort (list, (GCompareFunc) gst_auto_audio_sink_compare_ranks); + list = + g_list_sort (list, (GCompareFunc) gst_plugin_feature_rank_compare_func); /* We don't treat sound server sinks special. Our policy is that sound * server sinks that have a rank must not auto-spawn a daemon under any diff --git a/gst/autodetect/gstautoaudiosrc.c b/gst/autodetect/gstautoaudiosrc.c index 530253754b..f20cf57e9f 100644 --- a/gst/autodetect/gstautoaudiosrc.c +++ b/gst/autodetect/gstautoaudiosrc.c @@ -198,18 +198,6 @@ gst_auto_audio_src_factory_filter (GstPluginFeature * feature, gpointer data) return TRUE; } -static gint -gst_auto_audio_src_compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2) -{ - gint diff; - - diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1); - if (diff != 0) - return diff; - return strcmp (gst_plugin_feature_get_name (f2), - gst_plugin_feature_get_name (f1)); -} - static GstElement * gst_auto_audio_src_create_element_with_pretty_name (GstAutoAudioSrc * src, GstElementFactory * factory) @@ -245,7 +233,8 @@ gst_auto_audio_src_find_best (GstAutoAudioSrc * src) list = gst_registry_feature_filter (gst_registry_get (), (GstPluginFeatureFilter) gst_auto_audio_src_factory_filter, FALSE, src); - list = g_list_sort (list, (GCompareFunc) gst_auto_audio_src_compare_ranks); + list = + g_list_sort (list, (GCompareFunc) gst_plugin_feature_rank_compare_func); /* We don't treat sound server sources special. Our policy is that sound * server sources that have a rank must not auto-spawn a daemon under any diff --git a/gst/autodetect/gstautovideosink.c b/gst/autodetect/gstautovideosink.c index 58a9fd5cd3..f598986fbf 100644 --- a/gst/autodetect/gstautovideosink.c +++ b/gst/autodetect/gstautovideosink.c @@ -203,18 +203,6 @@ gst_auto_video_sink_factory_filter (GstPluginFeature * feature, gpointer data) return TRUE; } -static gint -gst_auto_video_sink_compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2) -{ - gint diff; - - diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1); - if (diff != 0) - return diff; - return strcmp (gst_plugin_feature_get_name (f2), - gst_plugin_feature_get_name (f1)); -} - static GstElement * gst_auto_video_sink_create_element_with_pretty_name (GstAutoVideoSink * sink, GstElementFactory * factory) @@ -250,7 +238,8 @@ gst_auto_video_sink_find_best (GstAutoVideoSink * sink) list = gst_registry_feature_filter (gst_registry_get (), (GstPluginFeatureFilter) gst_auto_video_sink_factory_filter, FALSE, sink); - list = g_list_sort (list, (GCompareFunc) gst_auto_video_sink_compare_ranks); + list = + g_list_sort (list, (GCompareFunc) gst_plugin_feature_rank_compare_func); GST_LOG_OBJECT (sink, "Trying to find usable video devices ..."); diff --git a/gst/autodetect/gstautovideosrc.c b/gst/autodetect/gstautovideosrc.c index c541e6d377..6c0ba09c4a 100644 --- a/gst/autodetect/gstautovideosrc.c +++ b/gst/autodetect/gstautovideosrc.c @@ -197,18 +197,6 @@ gst_auto_video_src_factory_filter (GstPluginFeature * feature, gpointer data) return TRUE; } -static gint -gst_auto_video_src_compare_ranks (GstPluginFeature * f1, GstPluginFeature * f2) -{ - gint diff; - - diff = gst_plugin_feature_get_rank (f2) - gst_plugin_feature_get_rank (f1); - if (diff != 0) - return diff; - return strcmp (gst_plugin_feature_get_name (f2), - gst_plugin_feature_get_name (f1)); -} - static GstElement * gst_auto_video_src_create_element_with_pretty_name (GstAutoVideoSrc * src, GstElementFactory * factory) @@ -244,7 +232,8 @@ gst_auto_video_src_find_best (GstAutoVideoSrc * src) list = gst_registry_feature_filter (gst_registry_get (), (GstPluginFeatureFilter) gst_auto_video_src_factory_filter, FALSE, src); - list = g_list_sort (list, (GCompareFunc) gst_auto_video_src_compare_ranks); + list = + g_list_sort (list, (GCompareFunc) gst_plugin_feature_rank_compare_func); GST_LOG_OBJECT (src, "Trying to find usable video devices ...");