gst/playback/gstplaybin.c: Post missing-plugin messages also when we error out because converters, textoverlay or aut...

Original commit message from CVS:
* gst/playback/gstplaybin.c: (post_missing_element_message),
(gen_video_element), (gen_text_element), (gen_audio_element),
(gen_vis_element):
Post missing-plugin messages also when we error out because
converters, textoverlay or auto*sinks are missing (#161922).
This commit is contained in:
Tim-Philipp Müller 2007-01-11 13:12:17 +00:00
parent 3f147830e1
commit 9de43e8bc5
2 changed files with 26 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2007-01-11 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstplaybin.c: (post_missing_element_message),
(gen_video_element), (gen_text_element), (gen_audio_element),
(gen_vis_element):
Post missing-plugin messages also when we error out because
converters, textoverlay or auto*sinks are missing (#161922).
2007-01-10 Wim Taymans <wim@fluendo.com> 2007-01-10 Wim Taymans <wim@fluendo.com>
* gst/playback/gstdecodebin.c: (dynamic_add), (close_pad_link), * gst/playback/gstdecodebin.c: (dynamic_add), (close_pad_link),

View file

@ -795,6 +795,15 @@ handoff (GstElement * identity, GstBuffer * frame, gpointer data)
} }
} }
static void
post_missing_element_message (GstPlayBin * playbin, const gchar * name)
{
GstMessage *msg;
msg = gst_missing_element_message_new (GST_ELEMENT_CAST (playbin), name);
gst_element_post_message (GST_ELEMENT_CAST (playbin), msg);
}
/* make the element (bin) that contains the elements needed to perform /* make the element (bin) that contains the elements needed to perform
* video display. We connect a handoff signal to identity so that we * video display. We connect a handoff signal to identity so that we
* can grab snapshots. Identity's sinkpad is ghosted to vbin. * can grab snapshots. Identity's sinkpad is ghosted to vbin.
@ -882,8 +891,7 @@ gen_video_element (GstPlayBin * play_bin)
/* ERRORS */ /* ERRORS */
no_sinks: no_sinks:
{ {
/* FIXME: this warrants adding a CORE error category for missing post_missing_element_message (play_bin, "autovideosink");
* elements/plugins */
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Both autovideosink and xvimagesink elements are missing.")), (_("Both autovideosink and xvimagesink elements are missing.")),
(NULL)); (NULL));
@ -891,6 +899,7 @@ no_sinks:
} }
no_colorspace: no_colorspace:
{ {
post_missing_element_message (play_bin, "ffmpegcolorspace");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"ffmpegcolorspace"), (NULL)); "ffmpegcolorspace"), (NULL));
@ -900,6 +909,7 @@ no_colorspace:
no_videoscale: no_videoscale:
{ {
post_missing_element_message (play_bin, "videoscale");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"videoscale"), ("possibly a liboil version mismatch?")); "videoscale"), ("possibly a liboil version mismatch?"));
@ -987,6 +997,7 @@ gen_text_element (GstPlayBin * play_bin)
/* ERRORS */ /* ERRORS */
no_overlay: no_overlay:
{ {
post_missing_element_message (play_bin, "textoverlay");
GST_WARNING_OBJECT (play_bin, GST_WARNING_OBJECT (play_bin,
"No overlay (pango) element, subtitles disabled"); "No overlay (pango) element, subtitles disabled");
return vbin; return vbin;
@ -1076,12 +1087,14 @@ gen_audio_element (GstPlayBin * play_bin)
/* ERRORS */ /* ERRORS */
no_sinks: no_sinks:
{ {
post_missing_element_message (play_bin, "autoaudiosink");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Both autoaudiosink and alsasink elements are missing.")), (NULL)); (_("Both autoaudiosink and alsasink elements are missing.")), (NULL));
return NULL; return NULL;
} }
no_audioconvert: no_audioconvert:
{ {
post_missing_element_message (play_bin, "audioconvert");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"audioconvert"), ("possibly a liboil version mismatch?")); "audioconvert"), ("possibly a liboil version mismatch?"));
@ -1091,6 +1104,7 @@ no_audioconvert:
no_audioresample: no_audioresample:
{ {
post_missing_element_message (play_bin, "audioresample");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"audioresample"), ("possibly a liboil version mismatch?")); "audioresample"), ("possibly a liboil version mismatch?"));
@ -1207,6 +1221,7 @@ gen_vis_element (GstPlayBin * play_bin)
/* ERRORS */ /* ERRORS */
no_audioconvert: no_audioconvert:
{ {
post_missing_element_message (play_bin, "audioconvert");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"audioconvert"), ("possibly a liboil version mismatch?")); "audioconvert"), ("possibly a liboil version mismatch?"));
@ -1215,6 +1230,7 @@ no_audioconvert:
} }
no_goom: no_goom:
{ {
post_missing_element_message (play_bin, "goom");
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN, GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."), (_("Missing element '%s' - check your GStreamer installation."),
"goom"), (NULL)); "goom"), (NULL));