resindvdbin: Post missing decoder messages if one is missing

For video this is an error, for audio only a warning.
This commit is contained in:
Sebastian Dröge 2009-10-01 14:52:06 +02:00
parent 02fbd5b42a
commit b67bc258c8
2 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -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);