From: Wim Taymans Date: Wed, 9 Sep 2009 14:21:57 +0000 (+0200) Subject: seek: make stop state configurable X-Git-Tag: 1.19.3~511^2~9220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ba0a36a07bf19025866e490bab30a029bc092a9;p=platform%2Fupstream%2Fgstreamer.git seek: make stop state configurable Make it easy to experiment with different stop states (NULL and READY) --- diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 0ce31a6..8ea5da9 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -67,6 +67,9 @@ GST_DEBUG_CATEGORY_STATIC (seek_debug); #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 *rate_pads = NULL; @@ -1518,18 +1521,18 @@ failed: static void stop_cb (GtkButton * button, gpointer data) { - if (state != GST_STATE_READY) { + if (state != STOP_STATE) { GstStateChangeReturn ret; g_print ("READY pipeline\n"); gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); 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) goto failed; - state = GST_STATE_READY; + state = STOP_STATE; gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped"); is_live = FALSE; @@ -1559,7 +1562,7 @@ stop_cb (GtkButton * button, gpointer data) pipeline = pipelines[pipeline_type].func (pipeline_spec); g_assert (pipeline); - gst_element_set_state (pipeline, GST_STATE_READY); + gst_element_set_state (pipeline, STOP_STATE); connect_bus_signals (pipeline); } #endif