diff --git a/check/elements/audioconvert.c b/check/elements/audioconvert.c index ca2a5304f8..a1f2d17d63 100644 --- a/check/elements/audioconvert.c +++ b/check/elements/audioconvert.c @@ -143,7 +143,8 @@ verify_convert (GstElement * audioconvert, void *in, int inlength, void *out, GstBuffer *inbuffer, *outbuffer; fail_unless (gst_element_set_state (audioconvert, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); GST_DEBUG ("Creating buffer of %d bytes", inlength); inbuffer = gst_buffer_new_and_alloc (inlength); diff --git a/check/elements/audioresample.c b/check/elements/audioresample.c index dd87b614f0..297243388b 100644 --- a/check/elements/audioresample.c +++ b/check/elements/audioresample.c @@ -151,7 +151,8 @@ test_perfect_stream_instance (int inrate, int outrate, int samples, fail_unless (gst_caps_is_fixed (caps)); fail_unless (gst_element_set_state (audioresample, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); for (j = 1; j <= numbuffers; ++j) { diff --git a/check/elements/volume.c b/check/elements/volume.c index 047338de5e..8a6d34d22c 100644 --- a/check/elements/volume.c +++ b/check/elements/volume.c @@ -109,7 +109,8 @@ GST_START_TEST (test_unity) volume = setup_volume (); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -142,7 +143,8 @@ GST_START_TEST (test_half) volume = setup_volume (); g_object_set (G_OBJECT (volume), "volume", 0.5, NULL); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -181,7 +183,8 @@ GST_START_TEST (test_double) volume = setup_volume (); g_object_set (G_OBJECT (volume), "volume", 2.0, NULL); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps) bus = gst_bus_new (); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); diff --git a/check/elements/vorbisdec.c b/check/elements/vorbisdec.c index 02f135f9dd..ea8e403e6f 100644 --- a/check/elements/vorbisdec.c +++ b/check/elements/vorbisdec.c @@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header) vorbisdec = setup_vorbisdec (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); bus = gst_bus_new (); inbuffer = gst_buffer_new_and_alloc (30); @@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header) bus = gst_bus_new (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (0); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header) vorbisdec = setup_vorbisdec (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); bus = gst_bus_new (); inbuffer = gst_buffer_new_and_alloc (30); diff --git a/docs/libs/tmpl/gstcolorbalance.sgml b/docs/libs/tmpl/gstcolorbalance.sgml index 6190e66544..59fb98aa53 100644 --- a/docs/libs/tmpl/gstcolorbalance.sgml +++ b/docs/libs/tmpl/gstcolorbalance.sgml @@ -23,6 +23,15 @@ interface for elements that provide color balance operations + + + + + +@gstcolorbalance: the object which received the signal. +@arg1: +@arg2: + diff --git a/docs/libs/tmpl/gstmixer.sgml b/docs/libs/tmpl/gstmixer.sgml index 8987543de9..6c1c9e3ea1 100644 --- a/docs/libs/tmpl/gstmixer.sgml +++ b/docs/libs/tmpl/gstmixer.sgml @@ -47,18 +47,12 @@ gstmixer -@parent: -@values: -@_gst_reserved: -@parent: -@label: -@flags: diff --git a/examples/seeking/cdplayer.c b/examples/seeking/cdplayer.c index 190f17b029..7dd5ffed9e 100644 --- a/examples/seeking/cdplayer.c +++ b/examples/seeking/cdplayer.c @@ -189,7 +189,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) static void play_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PLAYING) { @@ -202,7 +202,7 @@ play_cb (GtkButton * button, gpointer data) static void pause_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PAUSED) { @@ -214,7 +214,7 @@ pause_cb (GtkButton * button, gpointer data) static void stop_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_READY) { diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index 30746fdc6c..326aac0a35 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -1083,7 +1083,7 @@ stop_seek (GtkWidget * widget, gpointer user_data) static void play_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PLAYING) { @@ -1097,7 +1097,7 @@ play_cb (GtkButton * button, gpointer data) static void pause_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PAUSED) { @@ -1110,7 +1110,7 @@ pause_cb (GtkButton * button, gpointer data) static void stop_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_READY) { diff --git a/examples/stats/mp2ogg.c b/examples/stats/mp2ogg.c index f62fe5d472..d39323cab0 100644 --- a/examples/stats/mp2ogg.c +++ b/examples/stats/mp2ogg.c @@ -59,7 +59,8 @@ main (gint argc, gchar * argv[]) dec_sink = gst_element_get_pad (decoder, "sink"); enc_src = gst_element_get_pad (encoder, "src"); - if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) { + if (gst_element_set_state (pipeline, + GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) { g_print ("pipeline doesn't want to play\n"); return -1; } diff --git a/ext/alsa/gstalsamixerelement.c b/ext/alsa/gstalsamixerelement.c index 6bbe6c313c..72a16650c8 100644 --- a/ext/alsa/gstalsamixerelement.c +++ b/ext/alsa/gstalsamixerelement.c @@ -38,8 +38,8 @@ GST_BOILERPLATE_WITH_INTERFACE (GstAlsaMixerElement, gst_alsa_mixer_element, GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element); -static GstElementStateReturn gst_alsa_mixer_element_change_state (GstElement * - element); +static GstStateChangeReturn gst_alsa_mixer_element_change_state (GstElement * + element, GstStateChange transition); static void gst_alsa_mixer_element_base_init (gpointer klass) @@ -65,18 +65,19 @@ gst_alsa_mixer_element_init (GstAlsaMixerElement * this, this->mixer = NULL; } -static GstElementStateReturn -gst_alsa_mixer_element_change_state (GstElement * element) +static GstStateChangeReturn +gst_alsa_mixer_element_change_state (GstElement * element, + GstStateChange transition) { GstAlsaMixerElement *this = GST_ALSA_MIXER_ELEMENT (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: if (!this->mixer) { this->mixer = gst_alsa_mixer_new ("hw:0", GST_ALSA_MIXER_ALL); } break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: if (this->mixer) { gst_alsa_mixer_free (this->mixer); this->mixer = NULL; @@ -87,7 +88,7 @@ gst_alsa_mixer_element_change_state (GstElement * element) } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/ext/cdparanoia/gstcdparanoia.c b/ext/cdparanoia/gstcdparanoia.c index eda93cee20..19065b543c 100644 --- a/ext/cdparanoia/gstcdparanoia.c +++ b/ext/cdparanoia/gstcdparanoia.c @@ -174,7 +174,8 @@ _do_init (GType cdparanoia_type) GST_BOILERPLATE_FULL (CDParanoia, cdparanoia, GstElement, GST_TYPE_ELEMENT, _do_init); -static GstElementStateReturn cdparanoia_change_state (GstElement * element); +static GstStateChangeReturn cdparanoia_change_state (GstElement * element, + GstStateChange transition); static guint cdparanoia_signals[LAST_SIGNAL] = { 0 }; @@ -787,35 +788,35 @@ cdparanoia_close (CDParanoia * src) GST_FLAG_UNSET (src, CDPARANOIA_OPEN); } -static GstElementStateReturn -cdparanoia_change_state (GstElement * element) +static GstStateChangeReturn +cdparanoia_change_state (GstElement * element, GstStateChange transition) { CDParanoia *cdparanoia; - g_return_val_if_fail (GST_IS_CDPARANOIA (element), GST_STATE_FAILURE); + g_return_val_if_fail (GST_IS_CDPARANOIA (element), GST_STATE_CHANGE_FAILURE); cdparanoia = CDPARANOIA (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: if (!cdparanoia_open (CDPARANOIA (element))) { g_warning ("cdparanoia: failed opening cd"); - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: if (cdparanoia->uri_track > 0) { cdparanoia->seek_request = cdparanoia->uri_track; } break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: /* FIXME: Need code here to reset element to start of cd */ break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: cdparanoia_close (CDPARANOIA (element)); cdparanoia->seek_request = -1; break; @@ -825,9 +826,9 @@ cdparanoia_change_state (GstElement * element) /* if we haven't failed already, give the parent class a chance too ;-) */ if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } static const GstEventMask * diff --git a/ext/gnomevfs/gstgnomevfssink.c b/ext/gnomevfs/gstgnomevfssink.c index 05918b2b3d..4900effea4 100644 --- a/ext/gnomevfs/gstgnomevfssink.c +++ b/ext/gnomevfs/gstgnomevfssink.c @@ -117,7 +117,7 @@ static void gst_gnomevfssink_close_file (GstGnomeVFSSink * sink); static void gst_gnomevfssink_chain (GstPad * pad, GstData * _data); -static GstElementStateReturn gst_gnomevfssink_change_state (GstElement * +static GstStateChangeReturn gst_gnomevfssink_change_state (GstElement * element); static GstElementClass *parent_class = NULL; @@ -616,19 +616,20 @@ gst_gnomevfssink_chain (GstPad * pad, GstData * _data) gst_data_unref (_data); } -static GstElementStateReturn -gst_gnomevfssink_change_state (GstElement * element) +static GstStateChangeReturn +gst_gnomevfssink_change_state (GstElement * element, GstStateChange transition) { - g_return_val_if_fail (GST_IS_GNOMEVFSSINK (element), GST_STATE_FAILURE); + g_return_val_if_fail (GST_IS_GNOMEVFSSINK (element), + GST_STATE_CHANGE_FAILURE); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_READY_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: if (!GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN)) { if (!gst_gnomevfssink_open_file (GST_GNOMEVFSSINK (element))) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: if (GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN)) gst_gnomevfssink_close_file (GST_GNOMEVFSSINK (element)); break; @@ -637,7 +638,7 @@ gst_gnomevfssink_change_state (GstElement * element) } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/ext/libvisual/visual.c b/ext/libvisual/visual.c index 28219020b3..c6126d9af6 100644 --- a/ext/libvisual/visual.c +++ b/ext/libvisual/visual.c @@ -102,7 +102,8 @@ static void gst_visual_class_init (gpointer g_class, gpointer class_data); static void gst_visual_init (GstVisual * visual); static void gst_visual_dispose (GObject * object); -static GstElementStateReturn gst_visual_change_state (GstElement * element); +static GstStateChangeReturn gst_visual_change_state (GstElement * element, + GstStateChange transition); static void gst_visual_chain (GstPad * pad, GstData * _data); static GstPadLinkReturn gst_visual_sinklink (GstPad * pad, @@ -338,36 +339,36 @@ gst_visual_chain (GstPad * pad, GstData * _data) visual_video_set_buffer (visual->video, NULL); } -static GstElementStateReturn -gst_visual_change_state (GstElement * element) +static GstStateChangeReturn +gst_visual_change_state (GstElement * element, GstStateChange transition) { GstVisual *visual = GST_VISUAL (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: visual->actor = visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info-> plugname); if (!visual->actor) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; if (visual_actor_realize (visual->actor) != 0) { visual_object_unref (VISUAL_OBJECT (visual->actor)); visual->actor = NULL; - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: gst_adapter_clear (visual->adapter); visual->count = 0; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: visual_object_unref (VISUAL_OBJECT (visual->actor)); visual->actor = NULL; break; @@ -376,9 +377,9 @@ gst_visual_change_state (GstElement * element) } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } static void diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index b8351bbab2..7713c5a64c 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1053,7 +1053,8 @@ static gboolean gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, gboolean active); static gboolean gst_ogg_demux_sink_activate_push (GstPad * sinkpad, gboolean active); -static GstElementStateReturn gst_ogg_demux_change_state (GstElement * element); +static GstStateChangeReturn gst_ogg_demux_change_state (GstElement * element, + GstStateChange transition); static void gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event); static void gst_ogg_print (GstOggDemux * demux); @@ -2348,37 +2349,39 @@ gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, gboolean active) } } -static GstElementStateReturn -gst_ogg_demux_change_state (GstElement * element) +static GstStateChangeReturn +gst_ogg_demux_change_state (GstElement * element, GstStateChange transition) { GstOggDemux *ogg; - GstElementStateReturn result = GST_STATE_FAILURE; + GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE; ogg = GST_OGG_DEMUX (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: ogg_sync_init (&ogg->sync); break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: ogg_sync_reset (&ogg->sync); break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + break; + default: break; } - result = parent_class->change_state (element); + result = parent_class->change_state (element, transition); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PLAYING_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_ogg_demux_clear_chains (ogg); GST_LOCK (ogg); ogg->running = FALSE; GST_UNLOCK (ogg); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: ogg_sync_clear (&ogg->sync); break; default: diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 807eb5f055..c6545e8c0b 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -167,7 +167,8 @@ static void gst_ogg_mux_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_ogg_mux_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_ogg_mux_change_state (GstElement * element); +static GstStateChangeReturn gst_ogg_mux_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -1126,34 +1127,32 @@ gst_ogg_mux_set_property (GObject * object, } } -static GstElementStateReturn -gst_ogg_mux_change_state (GstElement * element) +static GstStateChangeReturn +gst_ogg_mux_change_state (GstElement * element, GstStateChange transition) { GstOggMux *ogg_mux; - gint transition; - GstElementStateReturn ret; + GstStateChangeReturn ret; - transition = GST_STATE_TRANSITION (element); ogg_mux = GST_OGG_MUX (element); switch (transition) { - case GST_STATE_NULL_TO_READY: - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_NULL_TO_READY: + case GST_STATE_CHANGE_READY_TO_PAUSED: ogg_mux->next_ts = 0; ogg_mux->offset = 0; ogg_mux->pulling = NULL; gst_collectpads_start (ogg_mux->collect); break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_collectpads_stop (ogg_mux->collect); break; default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); return ret; } diff --git a/ext/ogg/gstoggparse.c b/ext/ogg/gstoggparse.c index b0fffb683d..f8e7e3c35c 100644 --- a/ext/ogg/gstoggparse.c +++ b/ext/ogg/gstoggparse.c @@ -203,7 +203,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); static void gst_ogg_parse_dispose (GObject * object); -static GstElementStateReturn gst_ogg_parse_change_state (GstElement * element); +static GstStateChangeReturn gst_ogg_parse_change_state (GstElement * element, + GstStateChange transition); static GstFlowReturn gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer); static void @@ -618,33 +619,35 @@ failure: return GST_FLOW_ERROR; } -static GstElementStateReturn -gst_ogg_parse_change_state (GstElement * element) +static GstStateChangeReturn +gst_ogg_parse_change_state (GstElement * element, GstStateChange transition) { GstOggParse *ogg; - GstElementStateReturn result = GST_STATE_FAILURE; + GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE; ogg = GST_OGG_PARSE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: ogg_sync_init (&ogg->sync); break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: ogg_sync_reset (&ogg->sync); break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + break; + default: break; } - result = parent_class->change_state (element); + result = parent_class->change_state (element, transition); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PLAYING_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: ogg_sync_clear (&ogg->sync); break; default: diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index e5e38930f1..05aebefd5b 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -151,7 +151,8 @@ static gboolean gst_ogm_parse_sink_convert (GstPad * pad, GstFormat src_format, static GstFlowReturn gst_ogm_parse_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn gst_ogm_parse_change_state (GstElement * element); +static GstStateChangeReturn gst_ogm_parse_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -703,13 +704,13 @@ gst_ogm_parse_chain (GstPad * pad, GstBuffer * buffer) return GST_FLOW_OK; } -static GstElementStateReturn -gst_ogm_parse_change_state (GstElement * element) +static GstStateChangeReturn +gst_ogm_parse_change_state (GstElement * element, GstStateChange transition) { GstOgmParse *ogm = GST_OGM_PARSE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PAUSED_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: if (ogm->srcpad) { gst_element_remove_pad (element, ogm->srcpad); ogm->srcpad = NULL; @@ -721,7 +722,7 @@ gst_ogm_parse_change_state (GstElement * element) break; } - return parent_class->change_state (element); + return parent_class->change_state (element, transition); } gboolean diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index 0bf49c833c..f7e03e956d 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -119,7 +119,8 @@ static void theora_dec_set_property (GObject * object, guint prop_id, static gboolean theora_dec_sink_event (GstPad * pad, GstEvent * event); static GstFlowReturn theora_dec_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn theora_dec_change_state (GstElement * element); +static GstStateChangeReturn theora_dec_change_state (GstElement * element, + GstStateChange transition); static gboolean theora_dec_src_event (GstPad * pad, GstEvent * event); static gboolean theora_dec_src_query (GstPad * pad, GstQuery * query); static gboolean theora_dec_src_convert (GstPad * pad, @@ -1044,19 +1045,17 @@ done: return result; } -static GstElementStateReturn -theora_dec_change_state (GstElement * element) +static GstStateChangeReturn +theora_dec_change_state (GstElement * element, GstStateChange transition) { GstTheoraDec *dec = GST_THEORA_DEC (element); - gint transition; - GstElementStateReturn ret; + GstStateChangeReturn ret; - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: theora_info_init (&dec->info); theora_comment_init (&dec->comment); dec->have_header = FALSE; @@ -1064,25 +1063,25 @@ theora_dec_change_state (GstElement * element) dec->last_timestamp = -1; dec->granulepos = -1; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - ret = parent_class->change_state (element); + ret = parent_class->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: theora_clear (&dec->state); theora_comment_clear (&dec->comment); theora_info_clear (&dec->info); dec->have_header = FALSE; dec->granulepos = -1; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; default: break; diff --git a/ext/theora/theoraenc.c b/ext/theora/theoraenc.c index 6733772a3c..85f002d6e7 100644 --- a/ext/theora/theoraenc.c +++ b/ext/theora/theoraenc.c @@ -175,7 +175,8 @@ GST_BOILERPLATE (GstTheoraEnc, gst_theora_enc, GstElement, GST_TYPE_ELEMENT); static gboolean theora_enc_sink_event (GstPad * pad, GstEvent * event); static GstFlowReturn theora_enc_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn theora_enc_change_state (GstElement * element); +static GstStateChangeReturn theora_enc_change_state (GstElement * element, + GstStateChange transition); static gboolean theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps); static void theora_enc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); @@ -711,44 +712,42 @@ data_push: } } -static GstElementStateReturn -theora_enc_change_state (GstElement * element) +static GstStateChangeReturn +theora_enc_change_state (GstElement * element, GstStateChange transition) { GstTheoraEnc *enc; - gint transition; - GstElementStateReturn ret; + GstStateChangeReturn ret; - transition = GST_STATE_TRANSITION (element); enc = GST_THEORA_ENC (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: theora_info_init (&enc->info); theora_comment_init (&enc->comment); enc->packetno = 0; enc->initial_delay = 0; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - ret = parent_class->change_state (element); + ret = parent_class->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: GST_STREAM_LOCK (enc->sinkpad); theora_clear (&enc->state); theora_comment_clear (&enc->comment); theora_info_clear (&enc->info); GST_STREAM_UNLOCK (enc->sinkpad); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; default: break; diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 1ca2fa4b73..52e14a45d3 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -75,7 +75,8 @@ GST_BOILERPLATE (GstVorbisDec, gst_vorbis_dec, GstElement, GST_TYPE_ELEMENT); static void vorbisdec_finalize (GObject * object); static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event); static GstFlowReturn vorbis_dec_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn vorbis_dec_change_state (GstElement * element); +static GstStateChangeReturn vorbis_dec_change_state (GstElement * element, + GstStateChange transition); #if 0 static const GstFormat *vorbis_dec_get_formats (GstPad * pad); @@ -864,44 +865,42 @@ done: return result; } -static GstElementStateReturn -vorbis_dec_change_state (GstElement * element) +static GstStateChangeReturn +vorbis_dec_change_state (GstElement * element, GstStateChange transition) { GstVorbisDec *vd = GST_VORBIS_DEC (element); - GstElementState transition; - GstElementStateReturn res; + GstStateChangeReturn res; - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: vorbis_info_init (&vd->vi); vorbis_comment_init (&vd->vc); vd->initialized = FALSE; vd->granulepos = -1; vd->packetno = 0; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - res = parent_class->change_state (element); + res = parent_class->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: GST_DEBUG_OBJECT (vd, "PAUSED -> READY, clearing vorbis structures"); vorbis_block_clear (&vd->vb); vorbis_dsp_clear (&vd->vd); vorbis_comment_clear (&vd->vc); vorbis_info_clear (&vd->vi); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; default: break; diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 7a3c0e4087..0969088072 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -120,7 +120,8 @@ static void gst_vorbisenc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_vorbisenc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_vorbisenc_change_state (GstElement * element); +static GstStateChangeReturn gst_vorbisenc_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -1086,37 +1087,35 @@ gst_vorbisenc_set_property (GObject * object, guint prop_id, } } -static GstElementStateReturn -gst_vorbisenc_change_state (GstElement * element) +static GstStateChangeReturn +gst_vorbisenc_change_state (GstElement * element, GstStateChange transition) { GstVorbisEnc *vorbisenc = GST_VORBISENC (element); - GstElementState transition; - GstElementStateReturn res; + GstStateChangeReturn res; - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: vorbisenc->tags = gst_tag_list_new (); break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: vorbisenc->eos = FALSE; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: default: break; } - res = GST_ELEMENT_CLASS (parent_class)->change_state (element); + res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: vorbisenc->setup = FALSE; vorbisenc->header_sent = FALSE; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_tag_list_free (vorbisenc->tags); vorbisenc->tags = NULL; default: diff --git a/ext/vorbis/vorbisparse.c b/ext/vorbis/vorbisparse.c index af25a94bf7..a9d605ae4a 100644 --- a/ext/vorbis/vorbisparse.c +++ b/ext/vorbis/vorbisparse.c @@ -63,7 +63,8 @@ GST_BOILERPLATE (GstVorbisParse, gst_vorbis_parse, GstElement, GST_TYPE_ELEMENT); static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn vorbis_parse_change_state (GstElement * element); +static GstStateChangeReturn vorbis_parse_change_state (GstElement * element, + GstStateChange transition); static void gst_vorbis_parse_base_init (gpointer g_class) @@ -186,18 +187,18 @@ vorbis_parse_chain (GstPad * pad, GstBuffer * buffer) return GST_FLOW_OK; } -static GstElementStateReturn -vorbis_parse_change_state (GstElement * element) +static GstStateChangeReturn +vorbis_parse_change_state (GstElement * element, GstStateChange transition) { GstVorbisParse *parse = GST_VORBIS_PARSE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PAUSED_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: parse->packetno = 0; break; default: break; } - return parent_class->change_state (element); + return parent_class->change_state (element, transition); } diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index f8b1d7eccb..b64e4f7622 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -56,8 +56,8 @@ static void gst_base_audio_sink_set_property (GObject * object, guint prop_id, static void gst_base_audio_sink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_base_audio_sink_change_state (GstElement * - element); +static GstStateChangeReturn gst_base_audio_sink_change_state (GstElement * + element, GstStateChange transition); static GstClock *gst_base_audio_sink_get_clock (GstElement * elem); static GstClockTime gst_base_audio_sink_get_time (GstClock * clock, @@ -416,43 +416,43 @@ gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len, //GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (data); } -static GstElementStateReturn -gst_base_audio_sink_change_state (GstElement * element) +static GstStateChangeReturn +gst_base_audio_sink_change_state (GstElement * element, + GstStateChange transition) { - GstElementStateReturn ret = GST_STATE_SUCCESS; + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (element); - GstElementState transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: if (sink->ringbuffer == NULL) { sink->ringbuffer = gst_base_audio_sink_create_ringbuffer (sink); gst_ring_buffer_set_callback (sink->ringbuffer, gst_base_audio_sink_callback, sink); } if (!gst_ring_buffer_open_device (sink->ringbuffer)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: gst_ring_buffer_pause (sink->ringbuffer); break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_ring_buffer_stop (sink->ringbuffer); gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL); gst_ring_buffer_release (sink->ringbuffer); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_ring_buffer_close_device (sink->ringbuffer); break; default: diff --git a/gst-libs/gst/audio/gstbaseaudiosrc.c b/gst-libs/gst/audio/gstbaseaudiosrc.c index 735f8f0187..ef4f1e5eef 100644 --- a/gst-libs/gst/audio/gstbaseaudiosrc.c +++ b/gst-libs/gst/audio/gstbaseaudiosrc.c @@ -56,8 +56,8 @@ static void gst_base_audio_src_get_property (GObject * object, guint prop_id, static void gst_base_audio_src_fixate (GstPad * pad, GstCaps * caps); -static GstElementStateReturn gst_base_audio_src_change_state (GstElement * - element); +static GstStateChangeReturn gst_base_audio_src_change_state (GstElement * + element, GstStateChange transition); static GstClock *gst_base_audio_src_get_clock (GstElement * elem); static GstClockTime gst_base_audio_src_get_time (GstClock * clock, @@ -362,42 +362,42 @@ gst_base_audio_src_callback (GstRingBuffer * rbuf, guint8 * data, guint len, //GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (data); } -static GstElementStateReturn -gst_base_audio_src_change_state (GstElement * element) +static GstStateChangeReturn +gst_base_audio_src_change_state (GstElement * element, + GstStateChange transition) { - GstElementStateReturn ret = GST_STATE_SUCCESS; + GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (element); - GstElementState transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: if (src->ringbuffer == NULL) { src->ringbuffer = gst_base_audio_src_create_ringbuffer (src); gst_ring_buffer_set_callback (src->ringbuffer, gst_base_audio_src_callback, src); } if (!gst_ring_buffer_open_device (src->ringbuffer)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: gst_ring_buffer_pause (src->ringbuffer); break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_ring_buffer_stop (src->ringbuffer); gst_ring_buffer_release (src->ringbuffer); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_ring_buffer_close_device (src->ringbuffer); gst_object_unref (GST_OBJECT (src->ringbuffer)); src->ringbuffer = NULL; diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c index c24f1b28b6..e1440f49df 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.c +++ b/gst-libs/gst/rtp/gstbasertpdepayload.c @@ -76,7 +76,7 @@ gst_base_rtp_depayload_get_type (void) return plugin_type; } -//static GstElementStateReturn gst_base_rtp_depayload_change_state (GstElement * element); +//static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * element, GstStateChange transition); static void gst_base_rtp_depayload_finalize (GObject * object); static void gst_base_rtp_depayload_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -88,8 +88,8 @@ static gboolean gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps); static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in); -static GstElementStateReturn gst_base_rtp_depayload_change_state (GstElement * - element); +static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement * + element, GstStateChange transition); static GstFlowReturn gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter, GstBuffer * in); @@ -413,53 +413,55 @@ gst_base_rtp_depayload_stop_thread (GstBaseRTPDepayload * filter) return TRUE; } -static GstElementStateReturn -gst_base_rtp_depayload_change_state (GstElement * element) +static GstStateChangeReturn +gst_base_rtp_depayload_change_state (GstElement * element, + GstStateChange transition) { GstBaseRTPDepayload *filter; - gint transition; -// GstElementStateReturn ret; +// GstStateChangeReturn ret; - g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (element), GST_STATE_FAILURE); + g_return_val_if_fail (GST_IS_BASE_RTP_DEPAYLOAD (element), + GST_STATE_CHANGE_FAILURE); filter = GST_BASE_RTP_DEPAYLOAD (element); /* we disallow changing the state from the thread */ if (g_thread_self () == filter->thread) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: if (!gst_base_rtp_depayload_start_thread (filter)) goto start_failed; break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } -// ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); +// ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_base_rtp_depayload_stop_thread (filter); break; + default: + break; } - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; /* ERRORS */ start_failed: { - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } } diff --git a/gst-libs/gst/tag/gstvorbistag.c b/gst-libs/gst/tag/gstvorbistag.c index 520965abbb..61637ec052 100644 --- a/gst-libs/gst/tag/gstvorbistag.c +++ b/gst-libs/gst/tag/gstvorbistag.c @@ -98,7 +98,8 @@ static void gst_vorbis_tag_init (GTypeInstance * instance, gpointer g_class); static GstFlowReturn gst_vorbis_tag_chain (GstPad * pad, GstBuffer * buffer); -static GstElementStateReturn gst_vorbis_tag_change_state (GstElement * element); +static GstStateChangeReturn gst_vorbis_tag_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -645,29 +646,29 @@ gst_vorbis_tag_chain (GstPad * pad, GstBuffer * buffer) return GST_FLOW_OK; } -static GstElementStateReturn -gst_vorbis_tag_change_state (GstElement * element) +static GstStateChangeReturn +gst_vorbis_tag_change_state (GstElement * element, GstStateChange transition) { GstVorbisTag *tag; tag = GST_VORBIS_TAG (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: /* do something to get out of the chain function faster */ break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: tag->output = OUTPUT_UNKNOWN; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; } - return parent_class->change_state (element); + return parent_class->change_state (element, transition); } diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 4682987c24..8d44864cf7 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -87,7 +87,8 @@ static void gst_adder_init (GstAdder * adder); static GstPad *gst_adder_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); -static GstElementStateReturn gst_adder_change_state (GstElement * element); +static GstStateChangeReturn gst_adder_change_state (GstElement * element, + GstStateChange transition); static gboolean gst_adder_setcaps (GstPad * pad, GstCaps * caps); @@ -400,34 +401,32 @@ not_negotiated: } } -static GstElementStateReturn -gst_adder_change_state (GstElement * element) +static GstStateChangeReturn +gst_adder_change_state (GstElement * element, GstStateChange transition) { GstAdder *adder; - GstElementStateReturn ret; - gint transition; + GstStateChangeReturn ret; adder = GST_ADDER (element); - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: adder->timestamp = 0; adder->offset = 0; gst_collectpads_start (adder->collect); break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_collectpads_stop (adder->collect); break; default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); return ret; } diff --git a/gst/audioconvert/bufferframesconvert.c b/gst/audioconvert/bufferframesconvert.c index f8b3425944..9363b7ccdd 100644 --- a/gst/audioconvert/bufferframesconvert.c +++ b/gst/audioconvert/bufferframesconvert.c @@ -87,8 +87,8 @@ static void buffer_frames_convert_class_init (BufferFramesConvertClass * klass); static void buffer_frames_convert_base_init (BufferFramesConvertClass * klass); static void buffer_frames_convert_init (BufferFramesConvert * this); -static GstElementStateReturn buffer_frames_convert_change_state (GstElement * - element); +static GstStateChangeReturn buffer_frames_convert_change_state (GstElement * + element, GstStateChange transition); static GstCaps *buffer_frames_convert_getcaps (GstPad * pad); static gboolean buffer_frames_convert_setcaps (GstPad * pad, GstCaps * caps); @@ -171,17 +171,18 @@ buffer_frames_convert_init (BufferFramesConvert * this) this->samples_out_remaining = 0; } -static GstElementStateReturn -buffer_frames_convert_change_state (GstElement * element) +static GstStateChangeReturn +buffer_frames_convert_change_state (GstElement * element, + GstStateChange transition) { BufferFramesConvert *this = (BufferFramesConvert *) element; - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_READY_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: this->offset = 0; break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: if (this->buf_out) gst_buffer_unref (this->buf_out); this->buf_out = NULL; @@ -193,8 +194,8 @@ buffer_frames_convert_change_state (GstElement * element) } if (parent_class->change_state) - return parent_class->change_state (element); - return GST_STATE_SUCCESS; + return parent_class->change_state (element, transition); + return GST_STATE_CHANGE_SUCCESS; } static GstCaps * diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c index aa8bf9aede..286c79115c 100644 --- a/gst/audiorate/gstaudiorate.c +++ b/gst/audiorate/gstaudiorate.c @@ -110,7 +110,8 @@ static void gst_audiorate_set_property (GObject * object, static void gst_audiorate_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_audiorate_change_state (GstElement * element); +static GstStateChangeReturn gst_audiorate_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -379,15 +380,15 @@ gst_audiorate_get_property (GObject * object, } } -static GstElementStateReturn -gst_audiorate_change_state (GstElement * element) +static GstStateChangeReturn +gst_audiorate_change_state (GstElement * element, GstStateChange transition) { GstAudiorate *audiorate = GST_AUDIORATE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PAUSED_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: audiorate->next_offset = 0; break; default: @@ -395,9 +396,9 @@ gst_audiorate_change_state (GstElement * element) } if (parent_class->change_state) - return parent_class->change_state (element); + return parent_class->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } static gboolean diff --git a/gst/audioscale/gstaudioscale.c b/gst/audioscale/gstaudioscale.c index 124cab2808..1b706c0ce5 100644 --- a/gst/audioscale/gstaudioscale.c +++ b/gst/audioscale/gstaudioscale.c @@ -110,7 +110,8 @@ static void gst_audioscale_init (Audioscale * audioscale); static void gst_audioscale_dispose (GObject * object); static void gst_audioscale_chain (GstPad * pad, GstData * _data); -static GstElementStateReturn gst_audioscale_change_state (GstElement * element); +static GstStateChangeReturn gst_audioscale_change_state (GstElement * element, + GstStateChange transition); static void gst_audioscale_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -654,20 +655,20 @@ gst_audioscale_chain (GstPad * pad, GstData * _data) } -static GstElementStateReturn -gst_audioscale_change_state (GstElement * element) +static GstStateChangeReturn +gst_audioscale_change_state (GstElement * element, GstStateChange transition) { Audioscale *audioscale = GST_AUDIOSCALE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PAUSED_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: audioscale->gst_resample_offset = 0; break; default: break; } - return parent_class->change_state (element); + return parent_class->change_state (element, transition); } static void diff --git a/gst/playback/decodetest.c b/gst/playback/decodetest.c index eeb82f9bf0..988e32354d 100644 --- a/gst/playback/decodetest.c +++ b/gst/playback/decodetest.c @@ -24,7 +24,7 @@ main (gint argc, gchar * argv[]) GstElement *decoder; GstElement *source; GstElement *pipeline; - GstElementStateReturn res; + GstStateChangeReturn res; gst_init (&argc, &argv); @@ -43,7 +43,7 @@ main (gint argc, gchar * argv[]) gst_element_link_pads (source, "src", decoder, "sink"); res = gst_element_set_state (pipeline, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 3e2359343d..7f90275926 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -119,7 +119,8 @@ static void gst_decode_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * spec); static void gst_decode_bin_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * spec); -static GstElementStateReturn gst_decode_bin_change_state (GstElement * element); +static GstStateChangeReturn gst_decode_bin_change_state (GstElement * element, + GstStateChange transition); static void type_found (GstElement * typefind, guint probability, GstCaps * caps, GstDecodeBin * decode_bin); @@ -1041,36 +1042,34 @@ gst_decode_bin_get_property (GObject * object, guint prop_id, GValue * value, } } -static GstElementStateReturn -gst_decode_bin_change_state (GstElement * element) +static GstStateChangeReturn +gst_decode_bin_change_state (GstElement * element, GstStateChange transition) { - GstElementStateReturn ret; + GstStateChangeReturn ret; GstDecodeBin *decode_bin; GList *dyns; - gint transition; decode_bin = GST_DECODE_BIN (element); - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: decode_bin->numpads = 0; decode_bin->dynamics = NULL; break; - case GST_STATE_READY_TO_PAUSED: - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_READY_TO_PAUSED: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: for (dyns = decode_bin->dynamics; dyns; dyns = g_list_next (dyns)) { GstDynamic *dynamic = (GstDynamic *) dyns->data; diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index d21cdfd981..d361dcc7a4 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -63,8 +63,8 @@ static void gst_play_base_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * spec); static void gst_play_base_bin_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * spec); -static GstElementStateReturn gst_play_base_bin_change_state (GstElement * - element); +static GstStateChangeReturn gst_play_base_bin_change_state (GstElement * + element, GstStateChange transition); const GList *gst_play_base_bin_get_streaminfo (GstPlayBaseBin * play_base_bin); static gboolean prepare_output (GstPlayBaseBin * play_base_bin); @@ -1166,7 +1166,7 @@ setup_source (GstPlayBaseBin * play_base_bin, gchar ** new_location) */ g_mutex_lock (play_base_bin->group_lock); if (gst_element_set_state (subbin, GST_STATE_PLAYING) == - GST_STATE_SUCCESS) { + GST_STATE_CHANGE_SUCCESS) { GST_DEBUG ("waiting for first group..."); sig6 = g_signal_connect (G_OBJECT (subbin), "state-changed", G_CALLBACK (state_change), play_base_bin); @@ -1650,18 +1650,17 @@ gst_play_base_bin_get_property (GObject * object, guint prop_id, GValue * value, } } -static GstElementStateReturn -gst_play_base_bin_change_state (GstElement * element) +static GstStateChangeReturn +gst_play_base_bin_change_state (GstElement * element, GstStateChange transition) { - GstElementStateReturn ret; + GstStateChangeReturn ret; GstPlayBaseBin *play_base_bin; - gint transition = GST_STATE_TRANSITION (element); gchar *new_location = NULL; play_base_bin = GST_PLAY_BASE_BIN (element); switch (transition) { - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: if (!setup_source (play_base_bin, &new_location)) goto source_failed; break; @@ -1669,11 +1668,11 @@ gst_play_base_bin_change_state (GstElement * element) break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_READY_TO_PAUSED: - if (ret == GST_STATE_SUCCESS) { + case GST_STATE_CHANGE_READY_TO_PAUSED: + if (ret == GST_STATE_CHANGE_SUCCESS) { finish_source (play_base_bin); } else { /* clean up leftover groups */ @@ -1681,7 +1680,7 @@ gst_play_base_bin_change_state (GstElement * element) play_base_bin->need_rebuild = TRUE; } break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: play_base_bin->need_rebuild = TRUE; remove_groups (play_base_bin); break; @@ -1695,7 +1694,7 @@ source_failed: { play_base_bin->need_rebuild = TRUE; - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } } diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index 25738fd648..4bd904acb2 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -101,7 +101,8 @@ static void gst_play_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * spec); static void gst_play_bin_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * spec); -static GstElementStateReturn gst_play_bin_change_state (GstElement * element); +static GstStateChangeReturn gst_play_bin_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class; @@ -842,19 +843,17 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group) } } -static GstElementStateReturn -gst_play_bin_change_state (GstElement * element) +static GstStateChangeReturn +gst_play_bin_change_state (GstElement * element, GstStateChange transition) { - GstElementStateReturn ret; + GstStateChangeReturn ret; GstPlayBin *play_bin; - int transition; play_bin = GST_PLAY_BIN (element); - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: /* this really is the easiest way to make the state change return * ASYNC until we added the sinks */ if (!play_bin->fakesink) { @@ -866,12 +865,12 @@ gst_play_bin_change_state (GstElement * element) break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); - if (ret == GST_STATE_FAILURE) + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + if (ret == GST_STATE_CHANGE_FAILURE) return ret; switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: /* Set audio sink state to NULL to release the sound device, * but only if we own it (else we might be in chain-transition). */ //if (play_bin->audio_sink != NULL && @@ -879,7 +878,7 @@ gst_play_bin_change_state (GstElement * element) // gst_element_set_state (play_bin->audio_sink, GST_STATE_NULL); //} break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: /* Check for NULL because the state transition may be done by * gst_bin_dispose which is called by gst_play_bin_dispose, and in that * case, we don't want to run remove_sinks. diff --git a/gst/playback/test.c b/gst/playback/test.c index c4d3a229c4..321684b3a6 100644 --- a/gst/playback/test.c +++ b/gst/playback/test.c @@ -67,7 +67,7 @@ gint main (gint argc, gchar * argv[]) { GstElement *player; - GstElementStateReturn res; + GstStateChangeReturn res; gint streams; GList *streaminfo; GList *s; @@ -80,7 +80,7 @@ main (gint argc, gchar * argv[]) g_object_set (G_OBJECT (player), "uri", argv[1], NULL); res = gst_element_set_state (player, GST_STATE_PAUSED); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not pause\n"); return -1; } @@ -126,7 +126,7 @@ main (gint argc, gchar * argv[]) /* set effects sinks */ res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } diff --git a/gst/playback/test2.c b/gst/playback/test2.c index c636e66d1d..86f3c4cc6e 100644 --- a/gst/playback/test2.c +++ b/gst/playback/test2.c @@ -22,7 +22,7 @@ gint main (gint argc, gchar * argv[]) { GstElement *player; - GstElementStateReturn res; + GstStateChangeReturn res; gst_init (&argc, &argv); @@ -32,7 +32,7 @@ main (gint argc, gchar * argv[]) g_object_set (G_OBJECT (player), "uri", argv[1], NULL); res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } diff --git a/gst/playback/test3.c b/gst/playback/test3.c index aaba4f65eb..da2bf9f5ec 100644 --- a/gst/playback/test3.c +++ b/gst/playback/test3.c @@ -38,7 +38,7 @@ gint main (gint argc, gchar * argv[]) { GstElement *player; - GstElementStateReturn res; + GstStateChangeReturn res; gst_init (&argc, &argv); @@ -48,7 +48,7 @@ main (gint argc, gchar * argv[]) g_object_set (G_OBJECT (player), "uri", argv[1], NULL); res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } diff --git a/gst/playback/test4.c b/gst/playback/test4.c index 9ee0793412..37d7fa2af3 100644 --- a/gst/playback/test4.c +++ b/gst/playback/test4.c @@ -24,7 +24,7 @@ gint main (gint argc, gchar * argv[]) { GstElement *player; - GstElementStateReturn res; + GstStateChangeReturn res; gst_init (&argc, &argv); @@ -40,7 +40,7 @@ main (gint argc, gchar * argv[]) g_print ("play...\n"); res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } @@ -50,7 +50,7 @@ main (gint argc, gchar * argv[]) g_print ("pause...\n"); res = gst_element_set_state (player, GST_STATE_PAUSED); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } @@ -60,7 +60,7 @@ main (gint argc, gchar * argv[]) g_print ("play...\n"); res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } @@ -70,7 +70,7 @@ main (gint argc, gchar * argv[]) g_print ("ready...\n"); res = gst_element_set_state (player, GST_STATE_READY); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } @@ -80,7 +80,7 @@ main (gint argc, gchar * argv[]) g_print ("play...\n"); res = gst_element_set_state (player, GST_STATE_PLAYING); - if (res != GST_STATE_SUCCESS) { + if (res != GST_STATE_CHANGE_SUCCESS) { g_print ("could not play\n"); return -1; } diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index a295914892..2217058412 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -54,7 +54,8 @@ static const GstEventMask *gst_subparse_src_eventmask (GstPad * pad); #endif static gboolean gst_subparse_src_event (GstPad * pad, GstEvent * event); -static GstElementStateReturn gst_subparse_change_state (GstElement * element); +static GstStateChangeReturn gst_subparse_change_state (GstElement * element, + GstStateChange transition); #if 0 static void gst_subparse_loop (GstPad * sinkpad); @@ -630,17 +631,17 @@ gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf) return ret; } -static GstElementStateReturn -gst_subparse_change_state (GstElement * element) +static GstStateChangeReturn +gst_subparse_change_state (GstElement * element, GstStateChange transition) { GstSubparse *self = GST_SUBPARSE (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_PAUSED_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: parser_state_dispose (&self->state); self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN; break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: /* format detection will init the parser state */ self->offset = self->next_offset = 0; self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN; @@ -649,7 +650,7 @@ gst_subparse_change_state (GstElement * element) break; } - return parent_class->change_state (element); + return parent_class->change_state (element, transition); } #if 0 diff --git a/gst/tcp/gstmultifdsink.c b/gst/tcp/gstmultifdsink.c index 00003de2ee..44d5877499 100644 --- a/gst/tcp/gstmultifdsink.c +++ b/gst/tcp/gstmultifdsink.c @@ -230,8 +230,8 @@ static void gst_multifdsink_remove_client_link (GstMultiFdSink * sink, static GstFlowReturn gst_multifdsink_render (GstBaseSink * bsink, GstBuffer * buf); -static GstElementStateReturn gst_multifdsink_change_state (GstElement * - element); +static GstStateChangeReturn gst_multifdsink_change_state (GstElement * + element, GstStateChange transition); static void gst_multifdsink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -1771,50 +1771,50 @@ gst_multifdsink_stop (GstBaseSink * bsink) return TRUE; } -static GstElementStateReturn -gst_multifdsink_change_state (GstElement * element) +static GstStateChangeReturn +gst_multifdsink_change_state (GstElement * element, GstStateChange transition) { GstMultiFdSink *sink; - gint transition; - GstElementStateReturn ret; + GstStateChangeReturn ret; sink = GST_MULTIFDSINK (element); /* we disallow changing the state from the streaming thread */ if (g_thread_self () == sink->thread) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: + case GST_STATE_CHANGE_NULL_TO_READY: if (!gst_multifdsink_start (GST_BASE_SINK (sink))) goto start_failed; break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; default: break; } - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_multifdsink_stop (GST_BASE_SINK (sink)); break; + default: + break; } return ret; /* ERRORS */ start_failed: { - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } } diff --git a/gst/tcp/gsttcpclientsink.c b/gst/tcp/gsttcpclientsink.c index 89334467f7..d1bf5218e6 100644 --- a/gst/tcp/gsttcpclientsink.c +++ b/gst/tcp/gsttcpclientsink.c @@ -61,8 +61,8 @@ static void gst_tcpclientsink_finalize (GObject * gobject); static gboolean gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps); static GstFlowReturn gst_tcpclientsink_render (GstBaseSink * bsink, GstBuffer * buf); -static GstElementStateReturn gst_tcpclientsink_change_state (GstElement * - element); +static GstStateChangeReturn gst_tcpclientsink_change_state (GstElement * + element, GstStateChange transition); static void gst_tcpclientsink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -403,29 +403,27 @@ gst_tcpclientsink_stop (GstTCPClientSink * this) return TRUE; } -static GstElementStateReturn -gst_tcpclientsink_change_state (GstElement * element) +static GstStateChangeReturn +gst_tcpclientsink_change_state (GstElement * element, GstStateChange transition) { GstTCPClientSink *sink; - gint transition; - GstElementStateReturn res; + GstStateChangeReturn res; sink = GST_TCPCLIENTSINK (element); - transition = GST_STATE_TRANSITION (element); switch (transition) { - case GST_STATE_NULL_TO_READY: - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_NULL_TO_READY: + case GST_STATE_CHANGE_READY_TO_PAUSED: if (!gst_tcpclientsink_start (GST_TCPCLIENTSINK (element))) goto start_failure; break; default: break; } - res = GST_ELEMENT_CLASS (parent_class)->change_state (element); + res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: gst_tcpclientsink_stop (GST_TCPCLIENTSINK (element)); default: break; @@ -434,6 +432,6 @@ gst_tcpclientsink_change_state (GstElement * element) start_failure: { - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; } } diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index 42f1174f8b..cf71280696 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -116,7 +116,8 @@ static void gst_videorate_set_property (GObject * object, static void gst_videorate_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_videorate_change_state (GstElement * element); +static GstStateChangeReturn gst_videorate_change_state (GstElement * element, + GstStateChange transition); static GstElementClass *parent_class = NULL; @@ -572,25 +573,23 @@ gst_videorate_get_property (GObject * object, } } -static GstElementStateReturn -gst_videorate_change_state (GstElement * element) +static GstStateChangeReturn +gst_videorate_change_state (GstElement * element, GstStateChange transition) { - GstElementStateReturn ret; + GstStateChangeReturn ret; GstVideorate *videorate; - gint transition; videorate = GST_VIDEORATE (element); - transition = GST_STATE_TRANSITION (videorate); switch (transition) { default: break; } - ret = parent_class->change_state (element); + ret = parent_class->change_state (element, transition); switch (transition) { - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: gst_videorate_blank_data (videorate); break; default: diff --git a/sys/v4l/gstv4lmjpegsink.c b/sys/v4l/gstv4lmjpegsink.c index b4713b906c..1e421989b8 100644 --- a/sys/v4l/gstv4lmjpegsink.c +++ b/sys/v4l/gstv4lmjpegsink.c @@ -72,7 +72,7 @@ static void gst_v4lmjpegsink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_v4lmjpegsink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_v4lmjpegsink_change_state (GstElement * +static GstStateChangeReturn gst_v4lmjpegsink_change_state (GstElement * element); static void gst_v4lmjpegsink_set_clock (GstElement * element, GstClock * clock); @@ -387,46 +387,48 @@ gst_v4lmjpegsink_get_property (GObject * object, } -static GstElementStateReturn -gst_v4lmjpegsink_change_state (GstElement * element) +static GstStateChangeReturn +gst_v4lmjpegsink_change_state (GstElement * element, GstStateChange transition) { GstV4lMjpegSink *v4lmjpegsink; - GstElementStateReturn parent_value; + GstStateChangeReturn parent_value; - g_return_val_if_fail (GST_IS_V4LMJPEGSINK (element), GST_STATE_FAILURE); + g_return_val_if_fail (GST_IS_V4LMJPEGSINK (element), + GST_STATE_CHANGE_FAILURE); v4lmjpegsink = GST_V4LMJPEGSINK (element); /* set up change state */ - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_READY_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: /* we used to do buffer setup here, but that's now done * right after capsnego */ break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: /* start */ if (!gst_v4lmjpegsink_playback_start (v4lmjpegsink)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: /* de-queue all queued buffers */ if (!gst_v4lmjpegsink_playback_stop (v4lmjpegsink)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: /* stop playback, unmap all buffers */ if (!gst_v4lmjpegsink_playback_deinit (v4lmjpegsink)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; } if (GST_ELEMENT_CLASS (parent_class)->change_state) { - parent_value = GST_ELEMENT_CLASS (parent_class)->change_state (element); + parent_value = + GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); } else { - parent_value = GST_STATE_FAILURE; + parent_value = GST_STATE_CHANGE_FAILURE; } if (GST_ELEMENT_CLASS (parent_class)->change_state) return parent_value; - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/sys/v4l/gstv4lmjpegsrc.c b/sys/v4l/gstv4lmjpegsrc.c index ec10fd3914..6a5c1f7811 100644 --- a/sys/v4l/gstv4lmjpegsrc.c +++ b/sys/v4l/gstv4lmjpegsrc.c @@ -99,8 +99,7 @@ static void gst_v4lmjpegsrc_get_property (GObject * object, static void gst_v4lmjpegsrc_set_clock (GstElement * element, GstClock * clock); /* state handling */ -static GstElementStateReturn gst_v4lmjpegsrc_change_state (GstElement * - element); +static GstStateChangeReturn gst_v4lmjpegsrc_change_state (GstElement * element); /* requeue buffer after use */ static void gst_v4lmjpegsrc_buffer_free (GstBuffer * buffer); @@ -736,18 +735,18 @@ gst_v4lmjpegsrc_get_property (GObject * object, } -static GstElementStateReturn -gst_v4lmjpegsrc_change_state (GstElement * element) +static GstStateChangeReturn +gst_v4lmjpegsrc_change_state (GstElement * element, GstStateChange transition) { GstV4lMjpegSrc *v4lmjpegsrc; GTimeVal time; - g_return_val_if_fail (GST_IS_V4LMJPEGSRC (element), GST_STATE_FAILURE); + g_return_val_if_fail (GST_IS_V4LMJPEGSRC (element), GST_STATE_CHANGE_FAILURE); v4lmjpegsrc = GST_V4LMJPEGSRC (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_READY_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: /* actual buffer set-up used to be done here - but I moved * it to capsnego itself */ v4lmjpegsrc->handled = 0; @@ -755,37 +754,37 @@ gst_v4lmjpegsrc_change_state (GstElement * element) v4lmjpegsrc->last_frame = 0; v4lmjpegsrc->substract_time = 0; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: /* queue all buffer, start streaming capture */ if (GST_V4LELEMENT (v4lmjpegsrc)->buffer && !gst_v4lmjpegsrc_capture_start (v4lmjpegsrc)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; g_get_current_time (&time); v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) - v4lmjpegsrc->substract_time; v4lmjpegsrc->last_seq = 0; break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: g_get_current_time (&time); v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) - v4lmjpegsrc->substract_time; /* de-queue all queued buffers */ if (v4lmjpegsrc->is_capturing && !gst_v4lmjpegsrc_capture_stop (v4lmjpegsrc)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: /* stop capturing, unmap all buffers */ if (GST_V4LELEMENT (v4lmjpegsrc)->buffer && !gst_v4lmjpegsrc_capture_deinit (v4lmjpegsrc)) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; break; } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 046245a16f..993b560c62 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1115,20 +1115,20 @@ wrong_aspect: } } -static GstElementStateReturn -gst_ximagesink_change_state (GstElement * element) +static GstStateChangeReturn +gst_ximagesink_change_state (GstElement * element, GstStateChange transition) { GstXImageSink *ximagesink; ximagesink = GST_XIMAGESINK (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: /* Initializing the XContext */ if (!ximagesink->xcontext) ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink); if (!ximagesink->xcontext) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; /* call XSynchronize with the current value of synchronous */ GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s", ximagesink->synchronous ? "TRUE" : "FALSE"); @@ -1136,14 +1136,14 @@ gst_ximagesink_change_state (GstElement * element) XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous); g_mutex_unlock (ximagesink->x_lock); break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: ximagesink->time = 0; break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: g_mutex_lock (ximagesink->stream_lock); if (ximagesink->xwindow) gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow); @@ -1153,7 +1153,7 @@ gst_ximagesink_change_state (GstElement * element) GST_VIDEO_SINK_HEIGHT (ximagesink) = 0; g_mutex_unlock (ximagesink->stream_lock); break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: /* We are cleaning our resources here, yes i know chain is not running but the interface can be called to set a window from a different thread and that would crash */ @@ -1180,9 +1180,9 @@ gst_ximagesink_change_state (GstElement * element) } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } static void diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 92084c884c..50f6080b5c 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1424,19 +1424,19 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) return TRUE; } -static GstElementStateReturn -gst_xvimagesink_change_state (GstElement * element) +static GstStateChangeReturn +gst_xvimagesink_change_state (GstElement * element, GstStateChange transition) { GstXvImageSink *xvimagesink; xvimagesink = GST_XVIMAGESINK (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: /* Initializing the XContext */ if (!xvimagesink->xcontext && !(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink))) - return GST_STATE_FAILURE; + return GST_STATE_CHANGE_FAILURE; /* update object's par with calculated one if not set yet */ if (!xvimagesink->par) { xvimagesink->par = g_new0 (GValue, 1); @@ -1449,20 +1449,20 @@ gst_xvimagesink_change_state (GstElement * element) XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous); gst_xvimagesink_update_colorbalance (xvimagesink); break; - case GST_STATE_READY_TO_PAUSED: + case GST_STATE_CHANGE_READY_TO_PAUSED: if (xvimagesink->xwindow) gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow); break; - case GST_STATE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; - case GST_STATE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: xvimagesink->framerate = 0; GST_VIDEO_SINK_WIDTH (xvimagesink) = 0; GST_VIDEO_SINK_HEIGHT (xvimagesink) = 0; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: if (xvimagesink->xvimage) { gst_xvimage_buffer_free (xvimagesink->xvimage); xvimagesink->xvimage = NULL; @@ -1483,7 +1483,7 @@ gst_xvimagesink_change_state (GstElement * element) break; } - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); } static void diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index ca2a5304f8..a1f2d17d63 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -143,7 +143,8 @@ verify_convert (GstElement * audioconvert, void *in, int inlength, void *out, GstBuffer *inbuffer, *outbuffer; fail_unless (gst_element_set_state (audioconvert, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); GST_DEBUG ("Creating buffer of %d bytes", inlength); inbuffer = gst_buffer_new_and_alloc (inlength); diff --git a/tests/check/elements/audioresample.c b/tests/check/elements/audioresample.c index dd87b614f0..297243388b 100644 --- a/tests/check/elements/audioresample.c +++ b/tests/check/elements/audioresample.c @@ -151,7 +151,8 @@ test_perfect_stream_instance (int inrate, int outrate, int samples, fail_unless (gst_caps_is_fixed (caps)); fail_unless (gst_element_set_state (audioresample, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); for (j = 1; j <= numbuffers; ++j) { diff --git a/tests/check/elements/volume.c b/tests/check/elements/volume.c index 047338de5e..8a6d34d22c 100644 --- a/tests/check/elements/volume.c +++ b/tests/check/elements/volume.c @@ -109,7 +109,8 @@ GST_START_TEST (test_unity) volume = setup_volume (); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -142,7 +143,8 @@ GST_START_TEST (test_half) volume = setup_volume (); g_object_set (G_OBJECT (volume), "volume", 0.5, NULL); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -181,7 +183,8 @@ GST_START_TEST (test_double) volume = setup_volume (); g_object_set (G_OBJECT (volume), "volume", 2.0, NULL); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); @@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps) bus = gst_bus_new (); fail_unless (gst_element_set_state (volume, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4); diff --git a/tests/check/elements/vorbisdec.c b/tests/check/elements/vorbisdec.c index 02f135f9dd..ea8e403e6f 100644 --- a/tests/check/elements/vorbisdec.c +++ b/tests/check/elements/vorbisdec.c @@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header) vorbisdec = setup_vorbisdec (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); bus = gst_bus_new (); inbuffer = gst_buffer_new_and_alloc (30); @@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header) bus = gst_bus_new (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); inbuffer = gst_buffer_new_and_alloc (0); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); @@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header) vorbisdec = setup_vorbisdec (); fail_unless (gst_element_set_state (vorbisdec, - GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing"); + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); bus = gst_bus_new (); inbuffer = gst_buffer_new_and_alloc (30); diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 30746fdc6c..326aac0a35 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1083,7 +1083,7 @@ stop_seek (GtkWidget * widget, gpointer user_data) static void play_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PLAYING) { @@ -1097,7 +1097,7 @@ play_cb (GtkButton * button, gpointer data) static void pause_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PAUSED) { @@ -1110,7 +1110,7 @@ pause_cb (GtkButton * button, gpointer data) static void stop_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_READY) { diff --git a/tests/old/examples/seek/cdplayer.c b/tests/old/examples/seek/cdplayer.c index 190f17b029..7dd5ffed9e 100644 --- a/tests/old/examples/seek/cdplayer.c +++ b/tests/old/examples/seek/cdplayer.c @@ -189,7 +189,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) static void play_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PLAYING) { @@ -202,7 +202,7 @@ play_cb (GtkButton * button, gpointer data) static void pause_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_PAUSED) { @@ -214,7 +214,7 @@ pause_cb (GtkButton * button, gpointer data) static void stop_cb (GtkButton * button, gpointer data) { - GstElementState state; + GstState state; gst_element_get_state (pipeline, &state, NULL, NULL); if (state != GST_STATE_READY) { diff --git a/tests/old/examples/stats/mp2ogg.c b/tests/old/examples/stats/mp2ogg.c index f62fe5d472..d39323cab0 100644 --- a/tests/old/examples/stats/mp2ogg.c +++ b/tests/old/examples/stats/mp2ogg.c @@ -59,7 +59,8 @@ main (gint argc, gchar * argv[]) dec_sink = gst_element_get_pad (decoder, "sink"); enc_src = gst_element_get_pad (encoder, "src"); - if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) { + if (gst_element_set_state (pipeline, + GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) { g_print ("pipeline doesn't want to play\n"); return -1; } diff --git a/tests/old/testsuite/alsa/sinesrc.c b/tests/old/testsuite/alsa/sinesrc.c index 92dd3bdda5..f0f5d86122 100644 --- a/tests/old/testsuite/alsa/sinesrc.c +++ b/tests/old/testsuite/alsa/sinesrc.c @@ -47,7 +47,8 @@ static void sinesrc_init (SineSrc * src); static void sinesrc_class_init (SineSrcClass * klass); static GstData *sinesrc_get (GstPad * pad); -static GstElementStateReturn sinesrc_change_state (GstElement * element); +static GstStateChangeReturn sinesrc_change_state (GstElement * element, + GstStateChange transition); GType @@ -318,31 +319,31 @@ sinesrc_set_pre_get_func (SineSrc * src, PreGetFunc func) src->pre_get_func = func; } -static GstElementStateReturn -sinesrc_change_state (GstElement * element) +static GstStateChangeReturn +sinesrc_change_state (GstElement * element, GstStateChange transition) { SineSrc *sinesrc; g_return_val_if_fail (element != NULL, FALSE); sinesrc = SINESRC (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: - case GST_STATE_READY_TO_PAUSED: - case GST_STATE_PAUSED_TO_PLAYING: - case GST_STATE_PLAYING_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + case GST_STATE_CHANGE_READY_TO_PAUSED: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: sinesrc->newcaps = TRUE; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; default: g_assert_not_reached (); } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/tests/old/testsuite/alsa/srcstate.c b/tests/old/testsuite/alsa/srcstate.c index de7ef9c8cd..4ae536dadb 100644 --- a/tests/old/testsuite/alsa/srcstate.c +++ b/tests/old/testsuite/alsa/srcstate.c @@ -22,9 +22,9 @@ GstElement *pipeline; static void -set_state (GstElementState state) +set_state (GstState state) { - GstElementState old_state = gst_element_get_state (pipeline); + GstState old_state = gst_element_get_state (pipeline); g_print ("Setting state from %s to %s...", gst_element_state_get_name (old_state), diff --git a/tests/old/testsuite/alsa/state.c b/tests/old/testsuite/alsa/state.c index 7462633b75..9cbd8acfca 100644 --- a/tests/old/testsuite/alsa/state.c +++ b/tests/old/testsuite/alsa/state.c @@ -23,9 +23,9 @@ GstElement *pipeline; static void -set_state (GstElementState state) +set_state (GstState state) { - GstElementState old_state = gst_element_get_state (pipeline); + GstState old_state = gst_element_get_state (pipeline); g_print ("Setting state from %s to %s...", gst_element_state_get_name (old_state), diff --git a/testsuite/alsa/sinesrc.c b/testsuite/alsa/sinesrc.c index 92dd3bdda5..f0f5d86122 100644 --- a/testsuite/alsa/sinesrc.c +++ b/testsuite/alsa/sinesrc.c @@ -47,7 +47,8 @@ static void sinesrc_init (SineSrc * src); static void sinesrc_class_init (SineSrcClass * klass); static GstData *sinesrc_get (GstPad * pad); -static GstElementStateReturn sinesrc_change_state (GstElement * element); +static GstStateChangeReturn sinesrc_change_state (GstElement * element, + GstStateChange transition); GType @@ -318,31 +319,31 @@ sinesrc_set_pre_get_func (SineSrc * src, PreGetFunc func) src->pre_get_func = func; } -static GstElementStateReturn -sinesrc_change_state (GstElement * element) +static GstStateChangeReturn +sinesrc_change_state (GstElement * element, GstStateChange transition) { SineSrc *sinesrc; g_return_val_if_fail (element != NULL, FALSE); sinesrc = SINESRC (element); - switch (GST_STATE_TRANSITION (element)) { - case GST_STATE_NULL_TO_READY: - case GST_STATE_READY_TO_PAUSED: - case GST_STATE_PAUSED_TO_PLAYING: - case GST_STATE_PLAYING_TO_PAUSED: + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + case GST_STATE_CHANGE_READY_TO_PAUSED: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_READY: sinesrc->newcaps = TRUE; break; - case GST_STATE_READY_TO_NULL: + case GST_STATE_CHANGE_READY_TO_NULL: break; default: g_assert_not_reached (); } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - return GST_STATE_SUCCESS; + return GST_STATE_CHANGE_SUCCESS; } diff --git a/testsuite/alsa/srcstate.c b/testsuite/alsa/srcstate.c index de7ef9c8cd..4ae536dadb 100644 --- a/testsuite/alsa/srcstate.c +++ b/testsuite/alsa/srcstate.c @@ -22,9 +22,9 @@ GstElement *pipeline; static void -set_state (GstElementState state) +set_state (GstState state) { - GstElementState old_state = gst_element_get_state (pipeline); + GstState old_state = gst_element_get_state (pipeline); g_print ("Setting state from %s to %s...", gst_element_state_get_name (old_state), diff --git a/testsuite/alsa/state.c b/testsuite/alsa/state.c index 7462633b75..9cbd8acfca 100644 --- a/testsuite/alsa/state.c +++ b/testsuite/alsa/state.c @@ -23,9 +23,9 @@ GstElement *pipeline; static void -set_state (GstElementState state) +set_state (GstState state) { - GstElementState old_state = gst_element_get_state (pipeline); + GstState old_state = gst_element_get_state (pipeline); g_print ("Setting state from %s to %s...", gst_element_state_get_name (old_state),