GNOME Bugzilla – Bug 645467
gst_element_make_for_uri should return a GError
Last modified: 2012-06-26 15:04:07 UTC
If the $HOME/.gstreamer-0.10/dvb-channels.conf is in an unsuitable format for parse_channels_conf_from_file (), then the end result is a very confusing error message for users: ERROR: from element /GstURIDecodeBin:uridecodebin0: No URI handler implemented for "dvb". While gst-inspect dvbbasebin shows an URI handler: Supported URI protocols: dvb (but many users who know gst-inspect may look into dvbsrc element instead like I did initially, which isn't a uri handler). Hopefully it could propagate and present a better error message in this case. Noticed this because a w_scan upgrade seemed to start generating a different format file now from old totem pre-gnome-dvb-daemon playing instructions. Nowadays need to pass -M for mplayer style for gstreamer to be happy about it. Full debug log with *dvb*:5 follows: $ GST_DEBUG=*dvb*:5 gst-launch-0.10 -v playbin2 uri=dvb://Kanal%202 Setting pipeline to PAUSED ... /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0 /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: buffer-size = -1 /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: buffer-duration = -1 /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: use-buffering = FALSE /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: download = FALSE /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: uri = "dvb://Kanal%202" /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: connection-speed = 0 0:00:00.619933789 28072 0x24160a0 DEBUG dvbsrc gstdvbsrc.c:881:gst_dvbsrc_plugin_init: binding text domain gst-plugins-bad-0.10 to locale dir /usr/local/share/locale 0:00:00.620216089 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:459:gst_dvbsrc_init:<GstDvbSrc@0x24c5b00> gst_dvbsrc_init 0:00:00.620232152 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:529:gst_dvbsrc_set_property:<dvbsrc0> Set Property: ARG_DVBSRC_POLARITY 0:00:00.621264692 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 0 usecount 1 0:00:00.621276285 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 1 usecount 1 0:00:00.621284317 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 17 usecount 1 0:00:00.621291860 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 16 usecount 1 0:00:00.621299333 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 20 usecount 1 0:00:00.621306946 28072 0x24160a0 DEBUG dvbbasebin dvbbasebin.c:626:foreach_stream_build_filter: stream 18 usecount 1 0:00:00.621315117 28072 0x24160a0 INFO dvbbasebin dvbbasebin.c:649:dvb_base_bin_rebuild_filter:<DvbBaseBin@0x24c6100> rebuilt filter 18:20:16:17:1:0 0:00:00.621325384 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:535:gst_dvbsrc_set_property:<dvbsrc0> Set Property: ARG_DVBSRC_PIDS 0:00:00.621335721 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:562:gst_dvbsrc_set_property:<dvbsrc0> Parsed Pid: 18 0:00:00.621343962 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:562:gst_dvbsrc_set_property:<dvbsrc0> Parsed Pid: 20 0:00:00.621351645 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:562:gst_dvbsrc_set_property:<dvbsrc0> Parsed Pid: 16 0:00:00.621359118 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:562:gst_dvbsrc_set_property:<dvbsrc0> Parsed Pid: 17 0:00:00.621367149 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:575:gst_dvbsrc_set_property:<dvbsrc0> checking if playing for setting pes filters 0:00:00.621378953 28072 0x24160a0 INFO dvbsrc gstdvbsrc.c:529:gst_dvbsrc_set_property:<dvbsrc0> Set Property: ARG_DVBSRC_POLARITY 0:00:00.621747927 28072 0x24160a0 DEBUG dvbsrc gstdvbsrc.c:846:gst_dvbsrc_finalize:<dvbsrc0> gst_dvbsrc_finalize ERROR: Pipeline doesn't want to pause. ERROR: from element /GstURIDecodeBin:uridecodebin0: No URI handler implemented for "dvb". Additional debug info: gsturidecodebin.c(1177): gen_source_element (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0 Setting pipeline to NULL ... Freeing pipeline ...
Unfortunately gst_element_make_from_uri() doesn't propagate/return a GError, so there is no way to make this clearer. Making the error message in grammar.y seems like the best option. Changing it to something like: "No source element, or source element refused URI, for %s"
I added error messages for the various issues, but then won't appear when you use gst-launch (explanation above). Moving this to core so we can add a GError field allowing better explanation.
Done: commit f8445bd2936536b63e7d468e2f18ff8e0269123c Author: Tim-Philipp Müller <tim@centricular.net> Date: Sat Jun 23 14:40:17 2012 +0100 uri: add error argument to gst_element_make_from_uri() So callers can differentiate between there not being a handler for the protocol, and them not accepting the URI for some reason. https://bugzilla.gnome.org/show_bug.cgi?id=645467 Now use it ;) On a sidenote, I'm not sure if whoever handles the DVB URI should reject it because of some file parsing error. IMHO it shouldn't parse the file at all at that point, just accept the URI if the syntax looks ok, and then error out with a proper error message on the bus if there's a problem with the file. It shouldn't parse the file in NULL state IMHO.