summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-02-16 10:09:54 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-02-16 10:09:54 +0000
commit3be20d7a5e5cac23fd162702bad49ff911c76c37 (patch)
tree3455cc4092c33b3588e7afa16391697989004a42
parent0230f7ed9e3c976a614a9108945b7746437c3559 (diff)
uridecodebin: use same message string for missing elements as in playbin
Use the same translated message string for missing core elements as playbin uses, which is a bit nicer and also indicates that there is something wrong with the user's GStreamer installation (which arguably is the case if elements like typefind or queue2 are missing).
-rw-r--r--gst/playback/gsturidecodebin.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c
index 71dbc750..09f24afb 100644
--- a/gst/playback/gsturidecodebin.c
+++ b/gst/playback/gsturidecodebin.c
@@ -1037,6 +1037,19 @@ done:
return res;
}
+static void
+post_missing_plugin_error (GstElement * dec, const gchar * element_name)
+{
+ GstMessage *msg;
+
+ msg = gst_missing_element_message_new (dec, element_name);
+ gst_element_post_message (dec, msg);
+
+ GST_ELEMENT_ERROR (dec, CORE, MISSING_PLUGIN,
+ (_("Missing element '%s' - check your GStreamer installation."),
+ element_name), (NULL));
+}
+
/**
* analyse_source:
* @decoder: a #GstURIDecodeBin
@@ -1163,14 +1176,7 @@ analyse_source (GstURIDecodeBin * decoder, gboolean * is_raw,
return res;
no_queue2:
{
- GstMessage *msg;
-
- msg =
- gst_missing_element_message_new (GST_ELEMENT_CAST (decoder), "queue2");
- gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
-
- GST_ELEMENT_ERROR (decoder, CORE, MISSING_PLUGIN,
- (_("Could not create \"queue2\" element.")), (NULL));
+ post_missing_plugin_error (GST_ELEMENT_CAST (decoder), "queue2");
gst_object_unref (pad);
gst_iterator_free (pads_iter);
@@ -1392,15 +1398,7 @@ make_decoder (GstURIDecodeBin * decoder)
/* ERRORS */
no_decodebin:
{
- GstMessage *msg;
-
- msg =
- gst_missing_element_message_new (GST_ELEMENT_CAST (decoder),
- "decodebin2");
- gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
-
- GST_ELEMENT_ERROR (decoder, CORE, MISSING_PLUGIN,
- (_("Could not create \"decodebin2\" element.")), (NULL));
+ post_missing_plugin_error (GST_ELEMENT_CAST (decoder), "decodebin2");
return NULL;
}
}
@@ -1503,14 +1501,7 @@ could_not_link:
}
no_queue2:
{
- GstMessage *msg;
-
- msg =
- gst_missing_element_message_new (GST_ELEMENT_CAST (decoder), "queue2");
- gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
-
- GST_ELEMENT_ERROR (decoder, CORE, MISSING_PLUGIN,
- (_("Could not create \"queue2\" element.")), (NULL));
+ post_missing_plugin_error (GST_ELEMENT_CAST (decoder), "queue2");
return;
}
}
@@ -1548,15 +1539,7 @@ setup_streaming (GstURIDecodeBin * decoder)
/* ERRORS */
no_typefind:
{
- GstMessage *msg;
-
- msg =
- gst_missing_element_message_new (GST_ELEMENT_CAST (decoder),
- "typefind");
- gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
-
- GST_ELEMENT_ERROR (decoder, CORE, MISSING_PLUGIN,
- (_("Could not create \"typefind\" element.")), (NULL));
+ post_missing_plugin_error (GST_ELEMENT_CAST (decoder), "typefind");
return FALSE;
}
could_not_link: