From 074ecb22270d907afe0615009130926303c12e59 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 26 Jan 2004 03:44:14 +0000 Subject: [PATCH] gst/gstelement.h: remove gst_element_factory_get_version. It doesn't exist anymore. Original commit message from CVS: 2004-01-26 Benjamin Otte * gst/gstelement.h: remove gst_element_factory_get_version. It doesn't exist anymore. * gst/gstplugin.c: * gst/gstplugin.h: remove gst_plugin_set_name and change gst_plugin_get_longname to gst_plugin_get_description to match code. * gst/gsterror.h: remove GST_LIBRARY_ERROR_ENCODE. It's GST_STREAM_ERROR_ENCODE. * gst/gstpad.c: (gst_pad_try_set_caps): make it work with nonfixed caps. Note that even in the nonfixed case the link function of the pad that tries to set caps isn't called. --- ChangeLog | 15 +++++++++++++++ gst/gstelement.h | 5 +++-- gst/gsterror.h | 1 - gst/gstpad.c | 25 +++++++++---------------- gst/gstplugin.c | 2 +- gst/gstplugin.h | 3 +-- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e3e5d97ad..eaf89aee95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2004-01-26 Benjamin Otte + + * gst/gstelement.h: + remove gst_element_factory_get_version. It doesn't exist anymore. + * gst/gstplugin.c: + * gst/gstplugin.h: + remove gst_plugin_set_name and change gst_plugin_get_longname to + gst_plugin_get_description to match code. + * gst/gsterror.h: + remove GST_LIBRARY_ERROR_ENCODE. It's GST_STREAM_ERROR_ENCODE. + * gst/gstpad.c: (gst_pad_try_set_caps): + make it work with nonfixed caps. + Note that even in the nonfixed case the link function of the pad + that tries to set caps isn't called. + 2004-01-25 Benjamin Otte * gst/elements/gstbufferstore.c: (gst_buffer_store_get_buffer): diff --git a/gst/gstelement.h b/gst/gstelement.h index f03a67743a..13eb2f4798 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -366,7 +366,9 @@ void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstCloc void gst_element_set_eos (GstElement *element); gchar * _gst_element_error_printf (const gchar *format, ...); -void gst_element_error_full (GstElement *element, GQuark domain, gint code, gchar *message, gchar *debug, const gchar *file, const gchar *function, gint line); +void gst_element_error_full (GstElement *element, GQuark domain, gint code, + gchar *message, gchar *debug, + const gchar *file, const gchar *function, gint line); gboolean gst_element_is_locked_state (GstElement *element); void gst_element_set_locked_state (GstElement *element, gboolean locked_state); @@ -435,7 +437,6 @@ GType gst_element_factory_get_element_type (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory); -G_CONST_RETURN gchar * gst_element_factory_get_version (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory); guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory); diff --git a/gst/gsterror.h b/gst/gsterror.h index e173fef622..d82ac3c729 100644 --- a/gst/gsterror.h +++ b/gst/gsterror.h @@ -64,7 +64,6 @@ typedef enum { GST_LIBRARY_ERROR_INIT, GST_LIBRARY_ERROR_SHUTDOWN, GST_LIBRARY_ERROR_SETTINGS, - GST_LIBRARY_ERROR_ENCODE, GST_LIBRARY_ERROR_NUM_ERRORS } GstLibraryError; diff --git a/gst/gstpad.c b/gst/gstpad.c index db6d0d7e47..6d1a346964 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1322,28 +1322,21 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps) g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED); g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING), GST_PAD_LINK_REFUSED); - - /* setting non-fixed caps on a pad is not allowed */ - if (!gst_caps_is_fixed (caps)) { - GST_CAT_INFO (GST_CAT_CAPS, - "trying to set unfixed caps on pad %s:%s, not allowed", - GST_DEBUG_PAD_NAME (pad)); - g_warning ("trying to set non fixed caps on pad %s:%s, not allowed", - GST_DEBUG_PAD_NAME (pad)); - - gst_caps_debug (caps, "unfixed caps"); - return GST_PAD_LINK_REFUSED; - } - + /* we allow setting caps on non-linked pads. It's ignored */ if (!GST_PAD_PEER (pad)) { return GST_PAD_LINK_OK; } /* if the desired caps are already there, it's trivially ok */ - if (GST_PAD_CAPS (pad) && gst_caps_is_equal_fixed (caps, - GST_PAD_CAPS (pad))) { - return GST_PAD_LINK_OK; + if (GST_PAD_CAPS (pad)) { + GstCaps *intersection; + intersection = gst_caps_intersect (caps, GST_PAD_CAPS (pad)); + if (!gst_caps_is_empty (intersection)) { + gst_caps_free (intersection); + return GST_PAD_LINK_OK; + } + gst_caps_free (intersection); } g_return_val_if_fail (GST_PAD_LINK_SRC (pad), GST_PAD_LINK_REFUSED); diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 6bd66638b3..fcbda6c19e 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -476,7 +476,7 @@ gst_plugin_get_name (GstPlugin *plugin) } /** - * gst_plugin_get_longname: + * gst_plugin_get_description: * @plugin: plugin to get long name of * * Get the long descriptive name of the plugin diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 8d31d29b01..c9cdc644ae 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -128,8 +128,7 @@ void _gst_plugin_initialize (void); void _gst_plugin_register_static (GstPluginDesc *desc); G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin); -void gst_plugin_set_name (GstPlugin *plugin, const gchar *name); -G_CONST_RETURN gchar* gst_plugin_get_longname (GstPlugin *plugin); +G_CONST_RETURN gchar* gst_plugin_get_description (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);