mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-03 02:33:53 +00:00
seek: make stop state configurable
Make it easy to experiment with different stop states (NULL and READY)
This commit is contained in:
parent
fe47c6c4d5
commit
7ba0a36a07
1 changed files with 7 additions and 4 deletions
|
@ -67,6 +67,9 @@ GST_DEBUG_CATEGORY_STATIC (seek_debug);
|
||||||
|
|
||||||
#define DEFAULT_VIDEO_HEIGHT 300
|
#define DEFAULT_VIDEO_HEIGHT 300
|
||||||
|
|
||||||
|
/* the state to go to when stop is pressed */
|
||||||
|
#define STOP_STATE GST_STATE_READY
|
||||||
|
|
||||||
|
|
||||||
static GList *seekable_pads = NULL;
|
static GList *seekable_pads = NULL;
|
||||||
static GList *rate_pads = NULL;
|
static GList *rate_pads = NULL;
|
||||||
|
@ -1518,18 +1521,18 @@ failed:
|
||||||
static void
|
static void
|
||||||
stop_cb (GtkButton * button, gpointer data)
|
stop_cb (GtkButton * button, gpointer data)
|
||||||
{
|
{
|
||||||
if (state != GST_STATE_READY) {
|
if (state != STOP_STATE) {
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
g_print ("READY pipeline\n");
|
g_print ("READY pipeline\n");
|
||||||
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id);
|
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id);
|
||||||
|
|
||||||
g_static_mutex_lock (&state_mutex);
|
g_static_mutex_lock (&state_mutex);
|
||||||
ret = gst_element_set_state (pipeline, GST_STATE_READY);
|
ret = gst_element_set_state (pipeline, STOP_STATE);
|
||||||
if (ret == GST_STATE_CHANGE_FAILURE)
|
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|
||||||
state = GST_STATE_READY;
|
state = STOP_STATE;
|
||||||
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped");
|
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped");
|
||||||
|
|
||||||
is_live = FALSE;
|
is_live = FALSE;
|
||||||
|
@ -1559,7 +1562,7 @@ stop_cb (GtkButton * button, gpointer data)
|
||||||
|
|
||||||
pipeline = pipelines[pipeline_type].func (pipeline_spec);
|
pipeline = pipelines[pipeline_type].func (pipeline_spec);
|
||||||
g_assert (pipeline);
|
g_assert (pipeline);
|
||||||
gst_element_set_state (pipeline, GST_STATE_READY);
|
gst_element_set_state (pipeline, STOP_STATE);
|
||||||
connect_bus_signals (pipeline);
|
connect_bus_signals (pipeline);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue