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
This commit is contained in:
Alessandro Decina 2007-10-25 16:19:05 +00:00 committed by Jan Schmidt
parent f37e97764b
commit 9d3de77ba7
3 changed files with 33 additions and 4 deletions

View file

@ -1,3 +1,14 @@
2007-10-25 Jan Schmidt <Jan.Schmidt@sun.com>
* 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 <Jan.Schmidt@sun.com>
* plugins/elements/gstmultiqueue.c: (gst_multi_queue_set_property),

View file

@ -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;
}

View file

@ -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 */