mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
playbin3: Use STREAMS_SELECTED message to update selected stream types
Application might choose only specific type among all available types using select-streams event. In this case, it is desired that reconfigure of playsink to clear unused stream path. https://bugzilla.gnome.org/show_bug.cgi?id=778015
This commit is contained in:
parent
3de5fd4342
commit
969ab3f48c
1 changed files with 15 additions and 6 deletions
|
@ -2567,7 +2567,8 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAMS_SELECTED) {
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAMS_SELECTED) {
|
||||||
GstStreamCollection *collection = NULL;
|
GstStreamCollection *collection = NULL;
|
||||||
GstObject *src = GST_MESSAGE_SRC (msg);
|
GstObject *src = GST_MESSAGE_SRC (msg);
|
||||||
gboolean pstate = playbin->do_stream_selections;
|
GstStreamType chosen_stream_types = 0;
|
||||||
|
gboolean reconfigure_playsink = FALSE;
|
||||||
|
|
||||||
gst_message_parse_streams_selected (msg, &collection);
|
gst_message_parse_streams_selected (msg, &collection);
|
||||||
if (collection) {
|
if (collection) {
|
||||||
|
@ -2584,16 +2585,24 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
|
|
||||||
stream = gst_message_streams_selected_get_stream (msg, i);
|
stream = gst_message_streams_selected_get_stream (msg, i);
|
||||||
set_selected_stream (playbin, stream);
|
set_selected_stream (playbin, stream);
|
||||||
|
chosen_stream_types |= gst_stream_get_stream_type (stream);
|
||||||
gst_object_unref (stream);
|
gst_object_unref (stream);
|
||||||
}
|
}
|
||||||
if (pstate)
|
|
||||||
playbin->do_stream_selections = FALSE;
|
if (playbin->selected_stream_types != chosen_stream_types) {
|
||||||
do_stream_selection (playbin);
|
GST_DEBUG_OBJECT (playbin, "Chosen stream types are changed");
|
||||||
if (pstate)
|
reconfigure_playsink = TRUE;
|
||||||
playbin->do_stream_selections = TRUE;
|
}
|
||||||
|
playbin->selected_stream_types = chosen_stream_types;
|
||||||
GST_PLAY_BIN3_UNLOCK (playbin);
|
GST_PLAY_BIN3_UNLOCK (playbin);
|
||||||
|
|
||||||
gst_object_unref (collection);
|
gst_object_unref (collection);
|
||||||
|
|
||||||
|
if (reconfigure_playsink &&
|
||||||
|
(playbin->selected_stream_types & ~playbin->active_stream_types &
|
||||||
|
(GST_STREAM_TYPE_VIDEO | GST_STREAM_TYPE_AUDIO)) == 0) {
|
||||||
|
no_more_pads_cb (playbin->decodebin, playbin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue