From: Alessandro Decina Date: Thu, 25 Oct 2007 16:19:05 +0000 (+0000) Subject: gst/: Patch from Alessandro Decina adding get_type_full and get_protocols_full privat... X-Git-Tag: RELEASE-0_10_15~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d3de77ba7c62df9c2e587483a2a237e0d16c966;p=platform%2Fupstream%2Fgstreamer.git gst/: Patch from Alessandro Decina adding get_type_full and get_protocols_full private vfuncs to the URIHandler inter... Original commit message from CVS: * gst/gstelementfactory.c: (gst_element_register): * gst/gsturi.h: Patch from Alessandro Decina adding get_type_full and get_protocols_full private vfuncs to the URIHandler interface to allow bindings to support creating URI handlers. Partially fixes: #339279 API: GstURIHandlerInterface::get_type_full API: GstURIHandlerInterface::get_protocols_full --- diff --git a/ChangeLog b/ChangeLog index 865fc4e..dd66e85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2007-10-25 Jan Schmidt + * gst/gstelementfactory.c: (gst_element_register): + * gst/gsturi.h: + Patch from Alessandro Decina adding get_type_full and + get_protocols_full private vfuncs to the URIHandler interface + to allow bindings to support creating URI handlers. + Partially fixes: #339279 + API: GstURIHandlerInterface::get_type_full + API: GstURIHandlerInterface::get_protocols_full + +2007-10-25 Jan Schmidt + * plugins/elements/gstmultiqueue.c: (gst_multi_queue_set_property), (gst_multi_queue_request_new_pad), (gst_single_queue_flush), (gst_multi_queue_loop), (gst_multi_queue_sink_activate_push): diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index cc6367e..aed6898 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -309,12 +309,19 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank, GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_type_interface_peek (klass, GST_TYPE_URI_HANDLER); - if (!iface || !iface->get_type || !iface->get_protocols) + if (!iface || (!iface->get_type && !iface->get_type_full) || + (!iface->get_protocols && !iface->get_protocols_full)) goto urierror; - factory->uri_type = iface->get_type (); + if (iface->get_type) + factory->uri_type = iface->get_type (); + else if (iface->get_type_full) + factory->uri_type = iface->get_type_full (factory->type); if (!GST_URI_TYPE_IS_VALID (factory->uri_type)) goto urierror; - factory->uri_protocols = g_strdupv (iface->get_protocols ()); + if (iface->get_protocols) + factory->uri_protocols = g_strdupv (iface->get_protocols ()); + else if (iface->get_protocols_full) + factory->uri_protocols = iface->get_protocols_full (factory->type); if (!factory->uri_protocols) goto urierror; } diff --git a/gst/gsturi.h b/gst/gsturi.h index 899bdad..eef0cf7 100644 --- a/gst/gsturi.h +++ b/gst/gsturi.h @@ -75,6 +75,14 @@ typedef struct _GstURIHandlerInterface GstURIHandlerInterface; * @get_protocols: Method to return the list of protocols handled by the element. * @get_uri: Method to return the URI currently handled by the element. * @set_uri: Method to set a new URI. + * @get_type_full: Variant of get_type which takes a GType argument. This is + * for use by bindings that need to pass context when creating a URI Handler. * If implemented, get_type will be used in preference to get_type_full. + * Since: 0.10.15 + * @get_protocols_full: Variant of get_type which takes a GType argument. + * This is for use by bindings that need to pass context when creating a URI + * Handler. If implemented, get_protocols will be used in preference to + * get_protocols_full. + * Since: 0.10.15 * * #GstElements using this interface should implement these methods. */ @@ -103,11 +111,14 @@ struct _GstURIHandlerInterface { gboolean (* set_uri) (GstURIHandler * handler, const gchar * uri); + GstURIType (* get_type_full) (GType type); + gchar ** (* get_protocols_full) (GType type); + /*< private >*/ /* we might want to add functions here to query features, * someone with gnome-vfs knowledge go ahead */ - gpointer _gst_reserved[GST_PADDING]; + gpointer _gst_reserved[GST_PADDING - 2]; }; /* general URI functions */