From: Tim-Philipp Müller Date: Mon, 2 Jan 2012 14:30:53 +0000 (+0000) Subject: playback, mixerutils: gst_registry_get_default() -> gst_registry_get() X-Git-Tag: 1.19.3~511^2~7002 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26e612aeda9c6d18aec6db65c7ec03d0f147c2d0;p=platform%2Fupstream%2Fgstreamer.git playback, mixerutils: gst_registry_get_default() -> gst_registry_get() --- diff --git a/gst-libs/gst/audio/mixerutils.c b/gst-libs/gst/audio/mixerutils.c index b531294..9653d01 100644 --- a/gst-libs/gst/audio/mixerutils.c +++ b/gst-libs/gst/audio/mixerutils.c @@ -217,7 +217,7 @@ gst_audio_default_registry_mixer_filter (GstAudioMixerFilterFunc filter_func, /* go through all elements of a certain class and check whether * they implement a mixer. If so, add it to the list. */ - feature_list = gst_registry_get_feature_list (gst_registry_get_default (), + feature_list = gst_registry_get_feature_list (gst_registry_get (), GST_TYPE_ELEMENT_FACTORY); feature_list = g_list_sort (feature_list, element_factory_rank_compare_func); diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 91c702c..d266d71 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -919,15 +919,16 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass) static void gst_decode_bin_update_factories_list (GstDecodeBin * dbin) { - if (!dbin->factories - || dbin->factories_cookie != - gst_default_registry_get_feature_list_cookie ()) { + guint cookie; + + cookie = gst_registry_get_feature_list_cookie (gst_registry_get ()); + if (!dbin->factories || dbin->factories_cookie != cookie) { if (dbin->factories) gst_plugin_feature_list_free (dbin->factories); dbin->factories = gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_DECODABLE, GST_RANK_MARGINAL); - dbin->factories_cookie = gst_default_registry_get_feature_list_cookie (); + dbin->factories_cookie = cookie; } } diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index e7ce0aa..ebdb055 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -1220,10 +1220,10 @@ static void gst_play_bin_update_elements_list (GstPlayBin * playbin) { GList *res, *tmp; + guint cookie; - if (!playbin->elements || - playbin->elements_cookie != - gst_default_registry_get_feature_list_cookie ()) { + cookie = gst_registry_get_feature_list_cookie (gst_registry_get ()); + if (!playbin->elements || playbin->elements_cookie != cookie) { if (playbin->elements) gst_plugin_feature_list_free (playbin->elements); res = @@ -1235,7 +1235,7 @@ gst_play_bin_update_elements_list (GstPlayBin * playbin) playbin->elements = g_list_concat (res, tmp); playbin->elements = g_list_sort (playbin->elements, gst_plugin_feature_rank_compare_func); - playbin->elements_cookie = gst_default_registry_get_feature_list_cookie (); + playbin->elements_cookie = cookie; } } diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index 0580a2d..f3d28a6 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -372,15 +372,18 @@ _factory_filter (GstPluginFeature * feature, GstCaps ** subcaps) static gboolean gst_subtitle_overlay_update_factory_list (GstSubtitleOverlay * self) { - if (!self->factories - || self->factories_cookie != - gst_default_registry_get_feature_list_cookie ()) { + GstRegistry *registry; + guint cookie; + + registry = gst_registry_get (); + cookie = gst_registry_get_feature_list_cookie (registry); + if (!self->factories || self->factories_cookie != cookie) { GstCaps *subcaps; GList *factories; subcaps = gst_caps_new_empty (); - factories = gst_default_registry_feature_filter ( + factories = gst_registry_feature_filter (registry, (GstPluginFeatureFilter) _factory_filter, FALSE, &subcaps); GST_DEBUG_OBJECT (self, "Created factory caps: %" GST_PTR_FORMAT, subcaps); gst_caps_replace (&self->factory_caps, subcaps); @@ -388,7 +391,7 @@ gst_subtitle_overlay_update_factory_list (GstSubtitleOverlay * self) if (self->factories) gst_plugin_feature_list_free (self->factories); self->factories = factories; - self->factories_cookie = gst_default_registry_get_feature_list_cookie (); + self->factories_cookie = cookie; } return (self->factories != NULL); @@ -401,22 +404,24 @@ static guint32 _factory_caps_cookie = 0; GstCaps * gst_subtitle_overlay_create_factory_caps (void) { + GstRegistry *registry; GList *factories; GstCaps *subcaps = NULL; + guint cookie; + registry = gst_registry_get (); + cookie = gst_registry_get_feature_list_cookie (registry); G_LOCK (_factory_caps); - if (!_factory_caps - || _factory_caps_cookie != - gst_default_registry_get_feature_list_cookie ()) { + if (!_factory_caps || _factory_caps_cookie != cookie) { if (_factory_caps) gst_caps_unref (_factory_caps); _factory_caps = gst_caps_new_empty (); - factories = gst_default_registry_feature_filter ( + factories = gst_registry_feature_filter (registry, (GstPluginFeatureFilter) _factory_filter, FALSE, &_factory_caps); GST_DEBUG ("Created factory caps: %" GST_PTR_FORMAT, _factory_caps); gst_plugin_feature_list_free (factories); - _factory_caps_cookie = gst_default_registry_get_feature_list_cookie (); + _factory_caps_cookie = cookie; } subcaps = gst_caps_ref (_factory_caps); G_UNLOCK (_factory_caps); diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index 4138d38..fcbf14f 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -280,15 +280,16 @@ gst_uri_decode_bin_autoplug_continue (GstElement * element, GstPad * pad, static void gst_uri_decode_bin_update_factories_list (GstURIDecodeBin * dec) { - if (!dec->factories || - dec->factories_cookie != - gst_default_registry_get_feature_list_cookie ()) { + guint32 cookie; + + 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); dec->factories = gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_DECODABLE, GST_RANK_MARGINAL); - dec->factories_cookie = gst_default_registry_get_feature_list_cookie (); + dec->factories_cookie = cookie; } } diff --git a/tests/check/elements/decodebin.c b/tests/check/elements/decodebin.c index ffa6b59..bec5abf 100644 --- a/tests/check/elements/decodebin.c +++ b/tests/check/elements/decodebin.c @@ -323,8 +323,8 @@ GST_START_TEST (test_mp3_parser_loop) "fakemp3parse", "fakemp3parse", plugin_init, VERSION, "LGPL", "gst-plugins-base", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); - feature = gst_default_registry_find_feature ("testmpegaudioparse", - GST_TYPE_ELEMENT_FACTORY); + feature = gst_registry_find_feature (gst_registry_get (), + "testmpegaudioparse", GST_TYPE_ELEMENT_FACTORY); gst_plugin_feature_set_rank (feature, GST_RANK_PRIMARY + 100); diff --git a/tests/check/elements/libvisual.c b/tests/check/elements/libvisual.c index f2f37d7..8185910 100644 --- a/tests/check/elements/libvisual.c +++ b/tests/check/elements/libvisual.c @@ -82,7 +82,9 @@ GST_START_TEST (test_shutdown) if (factory_to_test == NULL) { GList *list, *l; - list = gst_default_registry_feature_filter (filter_func, FALSE, NULL); + list = gst_registry_feature_filter (gst_registry_get (), filter_func, + FALSE, NULL); + if (list == NULL) { g_print ("No libvisual plugins installed.\n"); return; diff --git a/tests/check/generic/states.c b/tests/check/generic/states.c index 4db8a1b..5194655 100644 --- a/tests/check/generic/states.c +++ b/tests/check/generic/states.c @@ -45,7 +45,7 @@ setup (void) ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0); } - plugins = gst_registry_get_plugin_list (gst_registry_get_default ()); + plugins = gst_registry_get_plugin_list (gst_registry_get ()); for (p = plugins; p; p = p->next) { GstPlugin *plugin = p->data; @@ -54,7 +54,7 @@ setup (void) continue; features = - gst_registry_get_feature_list_by_plugin (gst_registry_get_default (), + gst_registry_get_feature_list_by_plugin (gst_registry_get (), gst_plugin_get_name (plugin)); for (f = features; f; f = f->next) { diff --git a/tests/examples/seek/jsseek.c b/tests/examples/seek/jsseek.c index bc91596..b803eb6 100644 --- a/tests/examples/seek/jsseek.c +++ b/tests/examples/seek/jsseek.c @@ -1928,7 +1928,7 @@ init_visualization_features (void) vis_entries = g_array_new (FALSE, FALSE, sizeof (VisEntry)); - list = gst_registry_feature_filter (gst_registry_get_default (), + list = gst_registry_feature_filter (gst_registry_get (), filter_features, FALSE, NULL); for (walk = list; walk; walk = g_list_next (walk)) { diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 7f205c9..126d88b 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1073,7 +1073,7 @@ init_visualization_features (void) vis_entries = g_array_new (FALSE, FALSE, sizeof (VisEntry)); - list = gst_registry_feature_filter (gst_registry_get_default (), + list = gst_registry_feature_filter (gst_registry_get (), filter_features, FALSE, NULL); for (walk = list; walk; walk = g_list_next (walk)) {