#include <gst/gst.h>
#include <gst/gst-i18n-plugin.h>
+#include <gst/pbutils/missing-plugins.h>
#include "gstfactorylists.h"
#include "gstplay-marshal.h"
/* whoops, could not create the source element, dig a little deeper to
* figure out what might be wrong. */
if (prot) {
- GST_ELEMENT_ERROR (decoder, RESOURCE, FAILED,
+ GstMessage *msg;
+
+ msg =
+ gst_missing_uri_source_message_new (GST_ELEMENT_CAST (decoder), prot);
+ gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
+
+ GST_ELEMENT_ERROR (decoder, CORE, MISSING_PLUGIN,
(_("No URI handler implemented for \"%s\"."), prot), (NULL));
g_free (prot);
} else
gboolean done = FALSE;
gboolean res = TRUE;
GstCaps *rawcaps;
+ GstPad *pad;
*have_out = FALSE;
*is_raw = FALSE;
pads_iter = gst_element_iterate_src_pads (decoder->source);
while (!done) {
- GstPad *pad;
-
switch (gst_iterator_next (pads_iter, (gpointer) & pad)) {
case GST_ITERATOR_ERROR:
res = FALSE;
/* insert a queue element right before the raw pad */
outelem = gst_element_factory_make ("queue2", NULL);
+ if (!outelem)
+ goto no_queue2;
+
gst_bin_add (GST_BIN_CAST (decoder), outelem);
sinkpad = gst_element_get_static_pad (outelem, "sink");
}
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));
+
+ gst_object_unref (pad);
+ gst_iterator_free (pads_iter);
+ gst_caps_unref (rawcaps);
+
+ return FALSE;
+ }
}
/* Remove all decodebin2 from ourself
/* 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));
return NULL;
}
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));
return;
/* 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));
return FALSE;