playbin: improve error message when plugins are missing
@hadess
Submitted by Bastien Nocera Link to original bug (#679462)
Description
Using totem-video-thumbnailer ported to GStreamer 1.0. I get:
TotemVideoThumbnailer-Message: Initialised libraries, about to create video widget
TotemVideoThumbnailer-Message: setting URI file:///home/hadess/example.y4m
TotemVideoThumbnailer-Message: Video widget created
TotemVideoThumbnailer-Message: About to open video file
0:00:00.128743859 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:61:totem_gst_message_print:[00m message = Your GStreamer installation is missing a plug-in.
0:00:00.128784255 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:63:totem_gst_message_print:[00m domain = 2591 (gst-core-error-quark)
0:00:00.128799413 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:64:totem_gst_message_print:[00m code = 12
0:00:00.128808122 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:65:totem_gst_message_print:[00m debug = gstdecodebin2.c(3686): gst_decode_bin_expose (): /GstPlayBin:play/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found
0:00:00.128817996 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:66:totem_gst_message_print:[00m source = <decodebin0>
0:00:00.128833565 [331m13692[00m 0xfe4a10 [31;01mERROR [00m [00;04m default totem-gst-helpers.c:67:totem_gst_message_print:[00m uri = (NULL)
totem-video-thumbnailer couldn't open file '/home/hadess/example.y4m'
But in the debug I can see:
0:00:00.439854033 ^
[[334m13671^
[[00m 0x1794990 ^
[[37mDEBUG ^
[[00m ^
[[00;43m GST_BUS gstbus.c:314:gst_bus_post:<bus3>``^
[[00m [msg 0x179c700] posting on bus error message from element 'decodebin0': GstMessageError, gerror=(GError)NULL, debug=(string)"gstdecodebin2.c(1726):\ analyze_new_pad\ ():\ /GstPlayBin:play/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
No\ decoder\ to\ handle\ media\ type\ 'application/x-yuv4mpeg'";
Which is a much better error message. How come that more helpful message isn't getting posted to the bus?
This is the debug print code:
http://git.gnome.org/browse/totem/tree/src/gst/totem-gst-helpers.c#n36
The changes for GStreamer 1.0 are minimal, see patch in bug 674078