After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313322 - [PATCH] filesrc doesn't handle file:// URIs
[PATCH] filesrc doesn't handle file:// URIs
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.x
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-12 12:18 UTC by Rene Wagner
Modified: 2006-01-16 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
filesrc-uri.patch (817 bytes, patch)
2005-08-12 12:22 UTC, Rene Wagner
none Details | Review

Description Rene Wagner 2005-08-12 12:18:53 UTC
filesrc advertises itself as understanding the file:// protocol through the 
registry. However, it assumes location to be a path and prepends file:// even
if it has a file:// prefix already.

The patch I'm going to attach fixes that so that code like the following will
work:

/* ... */
uri = "file:///home/r/test.ogg"
source = gst_element_make_from_uri (GST_URI_SRC, uri, "source");
/* ... */
g_object_set (G_OBJECT (source), "location", uri, NULL);
/* ... */
Comment 1 Rene Wagner 2005-08-12 12:22:56 UTC
Created attachment 50617 [details] [review]
filesrc-uri.patch

Patch against current BRANCH-GSTREAMER-0_8 to make filesrc handle file:// URIs
properly.
Comment 2 Tim-Philipp Müller 2005-09-03 10:06:08 UTC
You should be able to set file:// URIs on filesrc with

  gst_uri_handler_set_uri (GST_URI_HANDLER (filersrc), uri);

 Cheers
  -Tim
Comment 3 Andy Wingo 2006-01-13 18:22:08 UTC
The format of the location property of filesrc can't be changed now, we're in a stable series. Tim's comment should be sufficient info.
Comment 4 Rene Wagner 2006-01-16 12:15:58 UTC
I'm not exactly sure why this would change the format of the location property. 
It simply prevents nonsense like src->uri = "file://file://..." from happening, 
which seems rather unlikely to be desirable. The standard code path, where 
location doesn't start with "file://" isn't touched by the patch.

As far as setting the URI manually is concerned, that doesn't solve the problem.
filesrc advertizes itself as understanding "file://" URIs via the plugin
registry, so either that or the code is clearly buggy.

The plan behind this patch is to allow GStreamer based applications to be able
to load files with only the filesrc plugin and no gnomevfs plugin installed
which is a bit on the heavy side dependecy-wise and therefore not an option
for handheld devices etc.

It's all about making stuff like this (or any other application) work with 
filesrc:

$ gst-launch file://foo.ogg ! decodebin ! esdsink
Comment 5 Tim-Philipp Müller 2006-01-16 12:43:35 UTC
  gst-launch file://foo.ogg ! decodebin ! esdsink

should already work (and does here), minus a missing audioconvert ! audioscale at least. Also, playbin should pick filesrc for file:// URIs in current 0.8, as filesrc has a rank of PRIMARY and gnomevfssrc a rank of SECONDAY. There's also a utility function to create an element given a URI, which should return filesrc as well.

(Not that I can see much harm in checking for a file:// prefix, but I don't see why it should be necessary for what you want to achieve)