From 50b44cdd16ef094d0614df06ecc360048425339b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 25 Apr 2005 13:00:47 +0000 Subject: [PATCH] gst/: Remove gst_library_load as it does more harm than good with the new g_module flags. Original commit message from CVS: * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), (gst_pad_set_checkgetrange_function), (gst_pad_link_check_compatible_unlocked), (gst_pad_link_prepare), (gst_pad_check_pull_range), (gst_pad_pull_range), (gst_static_pad_template_get_caps), (gst_pad_start_task), (gst_pad_pause_task), (gst_pad_stop_task): * gst/gstplugin.c: (gst_plugin_load): * gst/gstplugin.h: Remove gst_library_load as it does more harm than good with the new g_module flags. Revert bogus caps template check in pad linking, pad caps are important when linking not the template, which is more general than the current caps. --- ChangeLog | 16 ++++++++++++++++ gst/gstpad.c | 38 +++++++++++++------------------------- gst/gstplugin.c | 20 -------------------- gst/gstplugin.h | 1 - 4 files changed, 29 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43740de..faf36b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-04-25 Wim Taymans + + * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), + (gst_pad_set_checkgetrange_function), + (gst_pad_link_check_compatible_unlocked), (gst_pad_link_prepare), + (gst_pad_check_pull_range), (gst_pad_pull_range), + (gst_static_pad_template_get_caps), (gst_pad_start_task), + (gst_pad_pause_task), (gst_pad_stop_task): + * gst/gstplugin.c: (gst_plugin_load): + * gst/gstplugin.h: + Remove gst_library_load as it does more harm than good with + the new g_module flags. + Revert bogus caps template check in pad linking, pad caps + are important when linking not the template, which is more + general than the current caps. + 2005-04-25 Ronald S. Bultje * gst/autoplug/.cvsignore: diff --git a/gst/gstpad.c b/gst/gstpad.c index 14508bf..f5236dd 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1382,39 +1382,27 @@ lost_ghostpad: } static gboolean -gst_pad_link_check_templates_compatible_unlocked (GstRealPad * src, - GstRealPad * sink) +gst_pad_link_check_compatible_unlocked (GstRealPad * src, GstRealPad * sink) { GstCaps *srccaps; GstCaps *sinkcaps; - GstCaps *icaps; - gboolean ret; - if (!GST_PAD_PAD_TEMPLATE (src)) { - /* FIXME causes check failure */ - //g_warning ("pad has no pad template"); - return FALSE; - } - if (!GST_PAD_PAD_TEMPLATE (sink)) { - /* FIXME causes check failure */ - //g_warning ("pad has no pad template"); - return FALSE; - } + srccaps = gst_real_pad_get_caps_unlocked (src); + sinkcaps = gst_real_pad_get_caps_unlocked (sink); + GST_CAT_DEBUG (GST_CAT_CAPS, "got caps %p and %p", srccaps, sinkcaps); - srccaps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (src)); - sinkcaps = GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (sink)); + if (srccaps && sinkcaps) { + GstCaps *icaps; - icaps = gst_caps_intersect (srccaps, sinkcaps); + icaps = gst_caps_intersect (srccaps, sinkcaps); + GST_CAT_DEBUG (GST_CAT_CAPS, + "intersection caps %p %" GST_PTR_FORMAT, icaps, icaps); - if (gst_caps_is_empty (icaps)) { - ret = FALSE; - } else { - ret = TRUE; + if (!icaps || gst_caps_is_empty (icaps)) + return FALSE; } - gst_caps_unref (icaps); - - return ret; + return TRUE; } @@ -1457,7 +1445,7 @@ gst_pad_link_prepare (GstPad * srcpad, GstPad * sinkpad, *outrealsink = realsink; /* check pad caps for non-empty intersection */ - if (!gst_pad_link_check_templates_compatible_unlocked (realsrc, realsink)) { + if (!gst_pad_link_check_compatible_unlocked (realsrc, realsink)) { goto no_format; } diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 5c4dbb9..26cdeb5 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -884,23 +884,3 @@ gst_plugin_load (const gchar * name) GST_DEBUG ("Could not find %s in registry pool", name); return FALSE; } - -/** - * gst_library_load: - * @name: name of library to load - * - * Load the named library. Name should be given as - * "liblibrary.so". (exception to this rule is 'riff', which .so name is 'gstriff') - * - * Returns: whether the library was loaded or not (and returns TRUE if it was already loaded) - */ -gboolean -gst_library_load (const gchar * name) -{ - gboolean res; - - /* for now this is the same */ - res = gst_plugin_load (name); - - return res; -} diff --git a/gst/gstplugin.h b/gst/gstplugin.h index bf5d8c6..cd87102 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -158,7 +158,6 @@ void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature); /* shortcuts to load from the registry pool */ gboolean gst_plugin_load (const gchar *name); -gboolean gst_library_load (const gchar *name); G_END_DECLS -- 2.7.4