- 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");
+ }