From 6508d71ee729977760762c52bba6388765fd7349 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 22 Oct 2008 09:58:42 +0300 Subject: [PATCH] Handle multiple ways of setting an URI --- src/octopus-backend-gst.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/octopus-backend-gst.c b/src/octopus-backend-gst.c index 4558014..cd3f9d1 100644 --- a/src/octopus-backend-gst.c +++ b/src/octopus-backend-gst.c @@ -320,7 +320,23 @@ configure_endpoint(GstElement *elem, { if(endpoint->uri) { g_debug("Setting URI '%s'", endpoint->uri); - g_object_set(G_OBJECT(elem), "location", endpoint->uri, NULL); + if(GST_IS_URI_HANDLER(elem)) { + GstURIHandler *uri_handler; + + uri_handler = GST_URI_HANDLER(elem); + gst_uri_handler_set_uri(uri_handler, endpoint->uri); + } else { + gchar *loc; + + loc=gst_uri_get_location(endpoint->uri); + + if(g_object_class_find_property(G_OBJECT_GET_CLASS(elem), "location")) + g_object_set(G_OBJECT(elem), "location", loc, NULL); + else if(g_object_class_find_property(G_OBJECT_GET_CLASS(elem), "file-name")) + g_object_set(G_OBJECT(elem), "file-name", loc, NULL); + else + g_warning("Don't know how to set URI"); + } } if(endpoint->window) { -- 2.25.1