API: let client decide what to do on EOS #52

This commit is contained in:
Rafał Dzięgiel
2021-04-27 09:24:13 +02:00
parent ec1d4619a7
commit 997e47b93c
2 changed files with 7 additions and 4 deletions

View File

@@ -1323,14 +1323,13 @@ eos_cb (G_GNUC_UNUSED GstBus * bus, G_GNUC_UNUSED GstMessage * msg,
tick_cb (self);
remove_tick_source (self);
/* When connected client should handle what to do (stop/repeat) */
if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID,
signals[SIGNAL_END_OF_STREAM], 0, NULL, NULL, NULL) != 0) {
gst_clapper_signal_dispatcher_dispatch (self->signal_dispatcher, self,
eos_dispatch, g_object_ref (self), (GDestroyNotify) g_object_unref);
}
/* TODO: repeat instead of stop */
gst_clapper_stop_internal (self, FALSE);
} else
gst_clapper_stop_internal (self, FALSE);
}
typedef struct

View File

@@ -568,6 +568,10 @@ class ClapperPlayer extends GstClapper.Clapper
this.quitOnStop = true;
this._performCloseCleanup(this.widget.get_root());
}
/* When this signal is connected player
* wants us to decide if it should stop */
this.stop();
}
_onUriLoaded(player, uri)