summaryrefslogtreecommitdiff
path: root/playback
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-08-12 16:00:15 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-08-12 18:13:31 +0200
commit6ed6b5892925c2b1b7aca5068964b8f8607b206e (patch)
tree6a9b9f5d16694e17edb7f65d1ea0552de3a2d208 /playback
parentf68bac6318085b051221bc1db1084ab8fce06d3a (diff)
playback/player: player: Abstract the signal emission dispatching to a new interface
This allows to implement signal dispatching to other event loop systems than GLib without having direct GLib support in the base GstPlayer class. A implementation for the GLib main context is provided and used in the applications and tests.
Diffstat (limited to 'playback')
-rw-r--r--playback/player/gst-play/gst-play.c10
-rw-r--r--playback/player/gtk/gtk-play.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/playback/player/gst-play/gst-play.c b/playback/player/gst-play/gst-play.c
index f22e3f2..368b814 100644
--- a/playback/player/gst-play/gst-play.c
+++ b/playback/player/gst-play/gst-play.c
@@ -351,9 +351,10 @@ play_new (gchar ** uris, gdouble initial_volume)
play->num_uris = g_strv_length (uris);
play->cur_idx = -1;
- play->player = gst_player_new ();
+ play->player =
+ gst_player_new_full (gst_player_g_main_context_signal_dispatcher_new
+ (NULL));
- g_object_set (play->player, "dispatch-to-main-context", TRUE, NULL);
g_signal_connect (play->player, "position-updated",
G_CALLBACK (position_updated_cb), play);
g_signal_connect (play->player, "state-changed",
@@ -447,9 +448,8 @@ play_next (GstPlay * play)
if (play->repeat) {
g_print ("Looping playlist \n");
play->cur_idx = -1;
- }
- else
- return FALSE;
+ } else
+ return FALSE;
}
play_uri (play, play->uris[++play->cur_idx]);
diff --git a/playback/player/gtk/gtk-play.c b/playback/player/gtk/gtk-play.c
index b1ad7ac..c601f32 100644
--- a/playback/player/gtk/gtk-play.c
+++ b/playback/player/gtk/gtk-play.c
@@ -1730,7 +1730,9 @@ gtk_play_constructor (GType type, guint n_construct_params,
(GtkPlay *) G_OBJECT_CLASS (gtk_play_parent_class)->constructor (type,
n_construct_params, construct_params);
- self->player = gst_player_new ();
+ self->player =
+ gst_player_new_full (gst_player_g_main_context_signal_dispatcher_new
+ (NULL));
self->playing = TRUE;
if (self->inhibit_cookie)
@@ -1740,8 +1742,6 @@ gtk_play_constructor (GType type, guint n_construct_params,
gtk_application_inhibit (GTK_APPLICATION (g_application_get_default ()),
GTK_WINDOW (self), GTK_APPLICATION_INHIBIT_IDLE, "Playing media");
- g_object_set (self->player, "dispatch-to-main-context", TRUE, NULL);
-
create_ui (self);
g_signal_connect (self->player, "position-updated",