mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
playbin2: better error message on sink failure
If we could create the sinks, but the don't work, don't send the missing plugin message and report that the state-changed failed.
This commit is contained in:
parent
ff9ee1dc5a
commit
509256dce5
1 changed files with 25 additions and 11 deletions
|
@ -849,6 +849,7 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async,
|
||||||
elem = gst_element_factory_make ("autovideosink", "videosink");
|
elem = gst_element_factory_make ("autovideosink", "videosink");
|
||||||
chain->sink = try_element (playsink, elem);
|
chain->sink = try_element (playsink, elem);
|
||||||
}
|
}
|
||||||
|
/* FIXME: if DEFAULT_VIDEOSINK != "autovideosink" try this now */
|
||||||
if (chain->sink == NULL) {
|
if (chain->sink == NULL) {
|
||||||
GST_DEBUG_OBJECT (playsink, "trying xvimagesink");
|
GST_DEBUG_OBJECT (playsink, "trying xvimagesink");
|
||||||
elem = gst_element_factory_make ("xvimagesink", "videosink");
|
elem = gst_element_factory_make ("xvimagesink", "videosink");
|
||||||
|
@ -948,10 +949,16 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async,
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_sinks:
|
no_sinks:
|
||||||
{
|
{
|
||||||
post_missing_element_message (playsink, "autovideosink");
|
if (!elem) {
|
||||||
GST_ELEMENT_ERROR (playsink, CORE, MISSING_PLUGIN,
|
post_missing_element_message (playsink, "autovideosink");
|
||||||
(_("Both autovideosink and xvimagesink elements are missing.")),
|
GST_ELEMENT_ERROR (playsink, CORE, MISSING_PLUGIN,
|
||||||
(NULL));
|
(_("Both autovideosink and xvimagesink elements are missing.")),
|
||||||
|
(NULL));
|
||||||
|
} else {
|
||||||
|
GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE,
|
||||||
|
(_("Both autovideosink and xvimagesink elements are not working.")),
|
||||||
|
(NULL));
|
||||||
|
}
|
||||||
free_chain ((GstPlayChain *) chain);
|
free_chain ((GstPlayChain *) chain);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1329,6 +1336,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean queue)
|
||||||
elem = gst_element_factory_make ("autoaudiosink", "audiosink");
|
elem = gst_element_factory_make ("autoaudiosink", "audiosink");
|
||||||
chain->sink = try_element (playsink, elem);
|
chain->sink = try_element (playsink, elem);
|
||||||
}
|
}
|
||||||
|
/* FIXME: if DEFAULT_AUDIOSINK != "autoaudiosink" try this now */
|
||||||
if (chain->sink == NULL) {
|
if (chain->sink == NULL) {
|
||||||
GST_DEBUG_OBJECT (playsink, "trying alsasink");
|
GST_DEBUG_OBJECT (playsink, "trying alsasink");
|
||||||
elem = gst_element_factory_make ("alsasink", "audiosink");
|
elem = gst_element_factory_make ("alsasink", "audiosink");
|
||||||
|
@ -1473,9 +1481,15 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean queue)
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_sinks:
|
no_sinks:
|
||||||
{
|
{
|
||||||
post_missing_element_message (playsink, "autoaudiosink");
|
if (!elem) {
|
||||||
GST_ELEMENT_ERROR (playsink, CORE, MISSING_PLUGIN,
|
post_missing_element_message (playsink, "autoaudiosink");
|
||||||
(_("Both autoaudiosink and alsasink elements are missing.")), (NULL));
|
GST_ELEMENT_ERROR (playsink, CORE, MISSING_PLUGIN,
|
||||||
|
(_("Both autoaudiosink and alsasink elements are missing.")), (NULL));
|
||||||
|
} else {
|
||||||
|
GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE,
|
||||||
|
(_("Both autoaudiosink and alsasink elements are not working.")),
|
||||||
|
(NULL));
|
||||||
|
}
|
||||||
free_chain ((GstPlayChain *) chain);
|
free_chain ((GstPlayChain *) chain);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1762,8 +1776,8 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
|
||||||
playsink->audio_tee_vissrc = NULL;
|
playsink->audio_tee_vissrc = NULL;
|
||||||
}
|
}
|
||||||
srcpad =
|
srcpad =
|
||||||
gst_element_get_static_pad (GST_ELEMENT_CAST (playsink->
|
gst_element_get_static_pad (GST_ELEMENT_CAST (playsink->vischain->
|
||||||
vischain->chain.bin), "src");
|
chain.bin), "src");
|
||||||
gst_pad_unlink (srcpad, playsink->videochain->sinkpad);
|
gst_pad_unlink (srcpad, playsink->videochain->sinkpad);
|
||||||
}
|
}
|
||||||
add_chain (GST_PLAY_CHAIN (playsink->videochain), FALSE);
|
add_chain (GST_PLAY_CHAIN (playsink->videochain), FALSE);
|
||||||
|
@ -1928,8 +1942,8 @@ gst_play_sink_reconfigure (GstPlaySink * playsink)
|
||||||
if (playsink->vischain) {
|
if (playsink->vischain) {
|
||||||
GST_DEBUG_OBJECT (playsink, "setting up vis chain");
|
GST_DEBUG_OBJECT (playsink, "setting up vis chain");
|
||||||
srcpad =
|
srcpad =
|
||||||
gst_element_get_static_pad (GST_ELEMENT_CAST (playsink->
|
gst_element_get_static_pad (GST_ELEMENT_CAST (playsink->vischain->
|
||||||
vischain->chain.bin), "src");
|
chain.bin), "src");
|
||||||
add_chain (GST_PLAY_CHAIN (playsink->vischain), TRUE);
|
add_chain (GST_PLAY_CHAIN (playsink->vischain), TRUE);
|
||||||
activate_chain (GST_PLAY_CHAIN (playsink->vischain), TRUE);
|
activate_chain (GST_PLAY_CHAIN (playsink->vischain), TRUE);
|
||||||
if (playsink->audio_tee_vissrc == NULL) {
|
if (playsink->audio_tee_vissrc == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue