mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
Add some UI feedback for the buffering messages
This commit is contained in:
parent
6184907bbf
commit
555c456e9e
1 changed files with 9 additions and 2 deletions
|
@ -165,10 +165,17 @@ static void buffering_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
|||
return;
|
||||
|
||||
gst_message_parse_buffering (msg, &percent);
|
||||
if (percent < 100 && data->target_state >= GST_STATE_PAUSED)
|
||||
if (percent < 100 && data->target_state >= GST_STATE_PAUSED) {
|
||||
gchar * message_string = g_strdup_printf ("Buffering %d %%", percent);
|
||||
gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
|
||||
else if (data->target_state >= GST_STATE_PLAYING)
|
||||
set_ui_message (message_string, data);
|
||||
g_free (message_string);
|
||||
} else if (data->target_state >= GST_STATE_PLAYING) {
|
||||
gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
|
||||
set_ui_message ("PLAYING", data);
|
||||
} else if (data->target_state >= GST_STATE_PAUSED) {
|
||||
set_ui_message ("PAUSED", data);
|
||||
}
|
||||
}
|
||||
|
||||
static void clock_lost_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
||||
|
|
Loading…
Reference in a new issue