From c003165b7624d5c72517211d6fac2896f2b6676f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 7 May 2009 09:28:15 +0200 Subject: [PATCH] GstURIHandler: Use get_type_full() vmethod if specified instead of get_type() This fixes bug #581281 and makes it easier for bindings to implement GstURIHandlers. get_protocols_full() was already used like this. --- gst/gsturi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/gsturi.c b/gst/gsturi.c index c6d3f14d09..5c0c91c488 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -643,8 +643,13 @@ gst_uri_handler_get_uri_type (GstURIHandler * handler) iface = GST_URI_HANDLER_GET_INTERFACE (handler); g_return_val_if_fail (iface != NULL, GST_URI_UNKNOWN); - g_return_val_if_fail (iface->get_type != NULL, GST_URI_UNKNOWN); - ret = iface->get_type (); + g_return_val_if_fail (iface->get_type != NULL + || iface->get_type_full != NULL, GST_URI_UNKNOWN); + + if (iface->get_type != NULL) + ret = iface->get_type (); + else + ret = iface->get_type_full (G_OBJECT_TYPE (handler)); g_return_val_if_fail (GST_URI_TYPE_IS_VALID (ret), GST_URI_UNKNOWN); return ret;