From: Mikko Rasa Date: Wed, 22 Oct 2008 06:58:42 +0000 (+0300) Subject: Handle multiple ways of setting an URI X-Git-Url: https://sandbox.movial.com/gitweb/?p=octopus.git;a=commitdiff_plain;h=6508d71ee729977760762c52bba6388765fd7349 Handle multiple ways of setting an URI --- 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) {