summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2013-04-18 12:20:08 +0300
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-04-18 14:00:06 +0200
commit504360fe36429a8a9a5628a91dbc3c35ba68b495 (patch)
tree16fd4c164c048e9578437ba0c8e2c4b2603f2797
parent3230182a6111751a43572ba918441e16c3bf4e9e (diff)
downloadgstreamer-plugins-good-504360fe36429a8a9a5628a91dbc3c35ba68b495.tar.gz
autodetect: use _plugin_feature_rank_compare API instead of duplicating the code.
-rw-r--r--gst/autodetect/gstautoaudiosink.c15
-rw-r--r--gst/autodetect/gstautoaudiosrc.c15
-rw-r--r--gst/autodetect/gstautovideosink.c15
-rw-r--r--gst/autodetect/gstautovideosrc.c15
4 files changed, 8 insertions, 52 deletions
diff --git a/gst/autodetect/gstautoaudiosink.c b/gst/autodetect/gstautoaudiosink.c
index b07479f0d..340e9a238 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 530253754..f20cf57e9 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 58a9fd5cd..f598986fb 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 c541e6d37..6c0ba09c4 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 ...");