diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-10-01 14:52:06 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-10-01 14:52:06 +0200 |
commit | b67bc258c8fe9b8f231bba20d194195862bd4b4d (patch) | |
tree | 8c9f332c91ebe0be2725fd0cec143082337c753e | |
parent | 02fbd5b42a9f7515904755a1b45bceeaeb3639ec (diff) |
resindvdbin: Post missing decoder messages if one is missing
For video this is an error, for audio only a warning.
-rw-r--r-- | ext/resindvd/Makefile.am | 1 | ||||
-rw-r--r-- | ext/resindvd/resindvdbin.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ext/resindvd/Makefile.am b/ext/resindvd/Makefile.am index 89232a53e..c5f758f27 100644 --- a/ext/resindvd/Makefile.am +++ b/ext/resindvd/Makefile.am @@ -21,6 +21,7 @@ libresindvd_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \ $(GST_CFLAGS) $(DVDNAV_CFLAGS) libresindvd_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ -lgstinterfaces-$(GST_MAJORMINOR) -lgstvideo-$(GST_MAJORMINOR) \ +-lgstpbutils-$(GST_MAJORMINOR) \ $(GST_BASE_LIBS) $(GST_LIBS) $(DVDNAV_LIBS) libresindvd_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libresindvd_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c index 5f0d10303..bd04afe32 100644 --- a/ext/resindvd/resindvdbin.c +++ b/ext/resindvd/resindvdbin.c @@ -24,6 +24,7 @@ #include <string.h> #include <gst/gst.h> +#include <gst/pbutils/missing-plugins.h> #include "resindvdbin.h" #include "resindvdsrc.h" @@ -753,9 +754,21 @@ demux_pad_added (GstElement * element, GstPad * pad, RsnDvdBin * dvdbin) gst_element_get_request_pad (dvdbin->pieces[DVD_ELEM_AUD_SELECT], "sink%d"); } else { - /* FIXME: Consider and fire a missing-element message here */ + GstStructure *s; + GST_DEBUG_OBJECT (dvdbin, "Ignoring unusable pad w/ caps %" GST_PTR_FORMAT, caps); + gst_element_post_message (GST_ELEMENT_CAST (dvdbin), + gst_missing_decoder_message_new (GST_ELEMENT_CAST (dvdbin), caps)); + + s = gst_caps_get_structure (caps, 0); + if (g_str_has_prefix ("video/", gst_structure_get_name (s))) { + GST_ELEMENT_ERROR (dvdbin, STREAM, CODEC_NOT_FOUND, (NULL), + ("No MPEG video decoder found")); + } else { + GST_ELEMENT_WARNING (dvdbin, STREAM, CODEC_NOT_FOUND, (NULL), + ("No MPEG video decoder found")); + } } gst_caps_unref (caps); |