def get_uri(source):
import gst<EOL>src_info = source_info(source)<EOL>if src_info['<STR_LIT>']:  <EOL><INDENT>return get_uri(src_info['<STR_LIT>'])<EOL><DEDENT>elif gst.uri_is_valid(source):  <EOL><INDENT>uri_protocol = gst.uri_get_protocol(source)<EOL>if gst.uri_protocol_is_supported(gst.URI_SRC, uri_protocol):<EOL><INDENT>return source<EOL><DEDENT>else:<EOL><INDENT>raise IOError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise IOError('<STR_LIT>' % source)<EOL><DEDENT>
Check a media source as a valid file or uri and return the proper uri