All plugins updated for element state changes.

Original commit message from CVS:
2005-09-02  Andy Wingo  <wingo@pobox.com>

* All plugins updated for element state changes.
This commit is contained in:
Andy Wingo 2005-09-02 15:43:18 +00:00
parent 66cbf07abf
commit 6665c3084c
59 changed files with 492 additions and 459 deletions

View file

@ -143,7 +143,8 @@ verify_convert (GstElement * audioconvert, void *in, int inlength, void *out,
GstBuffer *inbuffer, *outbuffer; GstBuffer *inbuffer, *outbuffer;
fail_unless (gst_element_set_state (audioconvert, 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); GST_DEBUG ("Creating buffer of %d bytes", inlength);
inbuffer = gst_buffer_new_and_alloc (inlength); inbuffer = gst_buffer_new_and_alloc (inlength);

View file

@ -151,7 +151,8 @@ test_perfect_stream_instance (int inrate, int outrate, int samples,
fail_unless (gst_caps_is_fixed (caps)); fail_unless (gst_caps_is_fixed (caps));
fail_unless (gst_element_set_state (audioresample, 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) { for (j = 1; j <= numbuffers; ++j) {

View file

@ -109,7 +109,8 @@ GST_START_TEST (test_unity)
volume = setup_volume (); volume = setup_volume ();
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -142,7 +143,8 @@ GST_START_TEST (test_half)
volume = setup_volume (); volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 0.5, NULL); g_object_set (G_OBJECT (volume), "volume", 0.5, NULL);
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -181,7 +183,8 @@ GST_START_TEST (test_double)
volume = setup_volume (); volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 2.0, NULL); g_object_set (G_OBJECT (volume), "volume", 2.0, NULL);
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps)
bus = gst_bus_new (); bus = gst_bus_new ();
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);

View file

@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header)
vorbisdec = setup_vorbisdec (); vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (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 (); bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30); inbuffer = gst_buffer_new_and_alloc (30);
@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header)
bus = gst_bus_new (); bus = gst_bus_new ();
fail_unless (gst_element_set_state (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");
inbuffer = gst_buffer_new_and_alloc (0); inbuffer = gst_buffer_new_and_alloc (0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header)
vorbisdec = setup_vorbisdec (); vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (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 (); bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30); inbuffer = gst_buffer_new_and_alloc (30);

View file

@ -23,6 +23,15 @@ interface for elements that provide color balance operations
</para> </para>
<!-- ##### SIGNAL GstColorBalance::value-changed ##### -->
<para>
</para>
@gstcolorbalance: the object which received the signal.
@arg1:
@arg2:
<!-- ##### STRUCT GstColorBalanceClass ##### --> <!-- ##### STRUCT GstColorBalanceClass ##### -->
<para> <para>

View file

@ -47,18 +47,12 @@ gstmixer
</para> </para>
@parent:
@values:
@_gst_reserved:
<!-- ##### STRUCT GstMixerTrack ##### --> <!-- ##### STRUCT GstMixerTrack ##### -->
<para> <para>
</para> </para>
@parent:
@label:
@flags:
<!-- ##### FUNCTION gst_mixer_list_tracks ##### --> <!-- ##### FUNCTION gst_mixer_list_tracks ##### -->
<para> <para>

View file

@ -189,7 +189,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
static void static void
play_cb (GtkButton * button, gpointer data) play_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PLAYING) { if (state != GST_STATE_PLAYING) {
@ -202,7 +202,7 @@ play_cb (GtkButton * button, gpointer data)
static void static void
pause_cb (GtkButton * button, gpointer data) pause_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PAUSED) { if (state != GST_STATE_PAUSED) {
@ -214,7 +214,7 @@ pause_cb (GtkButton * button, gpointer data)
static void static void
stop_cb (GtkButton * button, gpointer data) stop_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_READY) { if (state != GST_STATE_READY) {

View file

@ -1083,7 +1083,7 @@ stop_seek (GtkWidget * widget, gpointer user_data)
static void static void
play_cb (GtkButton * button, gpointer data) play_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PLAYING) { if (state != GST_STATE_PLAYING) {
@ -1097,7 +1097,7 @@ play_cb (GtkButton * button, gpointer data)
static void static void
pause_cb (GtkButton * button, gpointer data) pause_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PAUSED) { if (state != GST_STATE_PAUSED) {
@ -1110,7 +1110,7 @@ pause_cb (GtkButton * button, gpointer data)
static void static void
stop_cb (GtkButton * button, gpointer data) stop_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_READY) { if (state != GST_STATE_READY) {

View file

@ -59,7 +59,8 @@ main (gint argc, gchar * argv[])
dec_sink = gst_element_get_pad (decoder, "sink"); dec_sink = gst_element_get_pad (decoder, "sink");
enc_src = gst_element_get_pad (encoder, "src"); 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"); g_print ("pipeline doesn't want to play\n");
return -1; return -1;
} }

View file

@ -38,8 +38,8 @@ GST_BOILERPLATE_WITH_INTERFACE (GstAlsaMixerElement, gst_alsa_mixer_element,
GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element); GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element);
static GstElementStateReturn gst_alsa_mixer_element_change_state (GstElement * static GstStateChangeReturn gst_alsa_mixer_element_change_state (GstElement *
element); element, GstStateChange transition);
static void static void
gst_alsa_mixer_element_base_init (gpointer klass) gst_alsa_mixer_element_base_init (gpointer klass)
@ -65,18 +65,19 @@ gst_alsa_mixer_element_init (GstAlsaMixerElement * this,
this->mixer = NULL; this->mixer = NULL;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_alsa_mixer_element_change_state (GstElement * element) gst_alsa_mixer_element_change_state (GstElement * element,
GstStateChange transition)
{ {
GstAlsaMixerElement *this = GST_ALSA_MIXER_ELEMENT (element); GstAlsaMixerElement *this = GST_ALSA_MIXER_ELEMENT (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (!this->mixer) { if (!this->mixer) {
this->mixer = gst_alsa_mixer_new ("hw:0", GST_ALSA_MIXER_ALL); this->mixer = gst_alsa_mixer_new ("hw:0", GST_ALSA_MIXER_ALL);
} }
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
if (this->mixer) { if (this->mixer) {
gst_alsa_mixer_free (this->mixer); gst_alsa_mixer_free (this->mixer);
this->mixer = NULL; this->mixer = NULL;
@ -87,7 +88,7 @@ gst_alsa_mixer_element_change_state (GstElement * element)
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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;
} }

View file

@ -174,7 +174,8 @@ _do_init (GType cdparanoia_type)
GST_BOILERPLATE_FULL (CDParanoia, cdparanoia, GstElement, GST_TYPE_ELEMENT, GST_BOILERPLATE_FULL (CDParanoia, cdparanoia, GstElement, GST_TYPE_ELEMENT,
_do_init); _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 }; static guint cdparanoia_signals[LAST_SIGNAL] = { 0 };
@ -787,35 +788,35 @@ cdparanoia_close (CDParanoia * src)
GST_FLAG_UNSET (src, CDPARANOIA_OPEN); GST_FLAG_UNSET (src, CDPARANOIA_OPEN);
} }
static GstElementStateReturn static GstStateChangeReturn
cdparanoia_change_state (GstElement * element) cdparanoia_change_state (GstElement * element, GstStateChange transition)
{ {
CDParanoia *cdparanoia; 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); cdparanoia = CDPARANOIA (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (!cdparanoia_open (CDPARANOIA (element))) { if (!cdparanoia_open (CDPARANOIA (element))) {
g_warning ("cdparanoia: failed opening cd"); g_warning ("cdparanoia: failed opening cd");
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (cdparanoia->uri_track > 0) { if (cdparanoia->uri_track > 0) {
cdparanoia->seek_request = cdparanoia->uri_track; cdparanoia->seek_request = cdparanoia->uri_track;
} }
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; 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 */ /* FIXME: Need code here to reset element to start of cd */
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
cdparanoia_close (CDPARANOIA (element)); cdparanoia_close (CDPARANOIA (element));
cdparanoia->seek_request = -1; cdparanoia->seek_request = -1;
break; break;
@ -825,9 +826,9 @@ cdparanoia_change_state (GstElement * element)
/* if we haven't failed already, give the parent class a chance too ;-) */ /* if we haven't failed already, give the parent class a chance too ;-) */
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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 * static const GstEventMask *

View file

@ -117,7 +117,7 @@ static void gst_gnomevfssink_close_file (GstGnomeVFSSink * sink);
static void gst_gnomevfssink_chain (GstPad * pad, GstData * _data); static void gst_gnomevfssink_chain (GstPad * pad, GstData * _data);
static GstElementStateReturn gst_gnomevfssink_change_state (GstElement * static GstStateChangeReturn gst_gnomevfssink_change_state (GstElement *
element); element);
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
@ -616,19 +616,20 @@ gst_gnomevfssink_chain (GstPad * pad, GstData * _data)
gst_data_unref (_data); gst_data_unref (_data);
} }
static GstElementStateReturn static GstStateChangeReturn
gst_gnomevfssink_change_state (GstElement * element) 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)) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (!GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN)) { if (!GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN)) {
if (!gst_gnomevfssink_open_file (GST_GNOMEVFSSINK (element))) if (!gst_gnomevfssink_open_file (GST_GNOMEVFSSINK (element)))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN)) if (GST_FLAG_IS_SET (element, GST_GNOMEVFSSINK_OPEN))
gst_gnomevfssink_close_file (GST_GNOMEVFSSINK (element)); gst_gnomevfssink_close_file (GST_GNOMEVFSSINK (element));
break; break;
@ -637,7 +638,7 @@ gst_gnomevfssink_change_state (GstElement * element)
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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;
} }

View file

@ -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_init (GstVisual * visual);
static void gst_visual_dispose (GObject * object); 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 void gst_visual_chain (GstPad * pad, GstData * _data);
static GstPadLinkReturn gst_visual_sinklink (GstPad * pad, 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); visual_video_set_buffer (visual->video, NULL);
} }
static GstElementStateReturn static GstStateChangeReturn
gst_visual_change_state (GstElement * element) gst_visual_change_state (GstElement * element, GstStateChange transition)
{ {
GstVisual *visual = GST_VISUAL (element); GstVisual *visual = GST_VISUAL (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
visual->actor = visual->actor =
visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info-> visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info->
plugname); plugname);
if (!visual->actor) if (!visual->actor)
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
if (visual_actor_realize (visual->actor) != 0) { if (visual_actor_realize (visual->actor) != 0) {
visual_object_unref (VISUAL_OBJECT (visual->actor)); visual_object_unref (VISUAL_OBJECT (visual->actor));
visual->actor = NULL; visual->actor = NULL;
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_adapter_clear (visual->adapter); gst_adapter_clear (visual->adapter);
visual->count = 0; visual->count = 0;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
visual_object_unref (VISUAL_OBJECT (visual->actor)); visual_object_unref (VISUAL_OBJECT (visual->actor));
visual->actor = NULL; visual->actor = NULL;
break; break;
@ -376,9 +377,9 @@ gst_visual_change_state (GstElement * element)
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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 static void

View file

@ -1053,7 +1053,8 @@ static gboolean gst_ogg_demux_sink_activate_pull (GstPad * sinkpad,
gboolean active); gboolean active);
static gboolean gst_ogg_demux_sink_activate_push (GstPad * sinkpad, static gboolean gst_ogg_demux_sink_activate_push (GstPad * sinkpad,
gboolean active); 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_demux_send_event (GstOggDemux * ogg, GstEvent * event);
static void gst_ogg_print (GstOggDemux * demux); static void gst_ogg_print (GstOggDemux * demux);
@ -2348,37 +2349,39 @@ gst_ogg_demux_sink_activate_pull (GstPad * sinkpad, gboolean active)
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ogg_demux_change_state (GstElement * element) gst_ogg_demux_change_state (GstElement * element, GstStateChange transition)
{ {
GstOggDemux *ogg; GstOggDemux *ogg;
GstElementStateReturn result = GST_STATE_FAILURE; GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
ogg = GST_OGG_DEMUX (element); ogg = GST_OGG_DEMUX (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
ogg_sync_init (&ogg->sync); ogg_sync_init (&ogg->sync);
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
ogg_sync_reset (&ogg->sync); ogg_sync_reset (&ogg->sync);
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
default:
break; break;
} }
result = parent_class->change_state (element); result = parent_class->change_state (element, transition);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ogg_demux_clear_chains (ogg); gst_ogg_demux_clear_chains (ogg);
GST_LOCK (ogg); GST_LOCK (ogg);
ogg->running = FALSE; ogg->running = FALSE;
GST_UNLOCK (ogg); GST_UNLOCK (ogg);
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
ogg_sync_clear (&ogg->sync); ogg_sync_clear (&ogg->sync);
break; break;
default: default:

View file

@ -167,7 +167,8 @@ static void gst_ogg_mux_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_ogg_mux_get_property (GObject * object, static void gst_ogg_mux_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); 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; static GstElementClass *parent_class = NULL;
@ -1126,34 +1127,32 @@ gst_ogg_mux_set_property (GObject * object,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ogg_mux_change_state (GstElement * element) gst_ogg_mux_change_state (GstElement * element, GstStateChange transition)
{ {
GstOggMux *ogg_mux; GstOggMux *ogg_mux;
gint transition; GstStateChangeReturn ret;
GstElementStateReturn ret;
transition = GST_STATE_TRANSITION (element);
ogg_mux = GST_OGG_MUX (element); ogg_mux = GST_OGG_MUX (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
ogg_mux->next_ts = 0; ogg_mux->next_ts = 0;
ogg_mux->offset = 0; ogg_mux->offset = 0;
ogg_mux->pulling = NULL; ogg_mux->pulling = NULL;
gst_collectpads_start (ogg_mux->collect); gst_collectpads_start (ogg_mux->collect);
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collectpads_stop (ogg_mux->collect); gst_collectpads_stop (ogg_mux->collect);
break; break;
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
return ret; return ret;
} }

View file

@ -203,7 +203,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
); );
static void gst_ogg_parse_dispose (GObject * object); 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 GstFlowReturn gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer);
static void static void
@ -618,33 +619,35 @@ failure:
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ogg_parse_change_state (GstElement * element) gst_ogg_parse_change_state (GstElement * element, GstStateChange transition)
{ {
GstOggParse *ogg; GstOggParse *ogg;
GstElementStateReturn result = GST_STATE_FAILURE; GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
ogg = GST_OGG_PARSE (element); ogg = GST_OGG_PARSE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
ogg_sync_init (&ogg->sync); ogg_sync_init (&ogg->sync);
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
ogg_sync_reset (&ogg->sync); ogg_sync_reset (&ogg->sync);
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
default:
break; break;
} }
result = parent_class->change_state (element); result = parent_class->change_state (element, transition);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
ogg_sync_clear (&ogg->sync); ogg_sync_clear (&ogg->sync);
break; break;
default: default:

View file

@ -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 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; static GstElementClass *parent_class = NULL;
@ -703,13 +704,13 @@ gst_ogm_parse_chain (GstPad * pad, GstBuffer * buffer)
return GST_FLOW_OK; return GST_FLOW_OK;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ogm_parse_change_state (GstElement * element) gst_ogm_parse_change_state (GstElement * element, GstStateChange transition)
{ {
GstOgmParse *ogm = GST_OGM_PARSE (element); GstOgmParse *ogm = GST_OGM_PARSE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (ogm->srcpad) { if (ogm->srcpad) {
gst_element_remove_pad (element, ogm->srcpad); gst_element_remove_pad (element, ogm->srcpad);
ogm->srcpad = NULL; ogm->srcpad = NULL;
@ -721,7 +722,7 @@ gst_ogm_parse_change_state (GstElement * element)
break; break;
} }
return parent_class->change_state (element); return parent_class->change_state (element, transition);
} }
gboolean gboolean

View file

@ -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 gboolean theora_dec_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn theora_dec_chain (GstPad * pad, GstBuffer * buffer); 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_event (GstPad * pad, GstEvent * event);
static gboolean theora_dec_src_query (GstPad * pad, GstQuery * query); static gboolean theora_dec_src_query (GstPad * pad, GstQuery * query);
static gboolean theora_dec_src_convert (GstPad * pad, static gboolean theora_dec_src_convert (GstPad * pad,
@ -1044,19 +1045,17 @@ done:
return result; return result;
} }
static GstElementStateReturn static GstStateChangeReturn
theora_dec_change_state (GstElement * element) theora_dec_change_state (GstElement * element, GstStateChange transition)
{ {
GstTheoraDec *dec = GST_THEORA_DEC (element); GstTheoraDec *dec = GST_THEORA_DEC (element);
gint transition; GstStateChangeReturn ret;
GstElementStateReturn ret;
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
theora_info_init (&dec->info); theora_info_init (&dec->info);
theora_comment_init (&dec->comment); theora_comment_init (&dec->comment);
dec->have_header = FALSE; dec->have_header = FALSE;
@ -1064,25 +1063,25 @@ theora_dec_change_state (GstElement * element)
dec->last_timestamp = -1; dec->last_timestamp = -1;
dec->granulepos = -1; dec->granulepos = -1;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
ret = parent_class->change_state (element); ret = parent_class->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
theora_clear (&dec->state); theora_clear (&dec->state);
theora_comment_clear (&dec->comment); theora_comment_clear (&dec->comment);
theora_info_clear (&dec->info); theora_info_clear (&dec->info);
dec->have_header = FALSE; dec->have_header = FALSE;
dec->granulepos = -1; dec->granulepos = -1;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default:
break; break;

View file

@ -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 gboolean theora_enc_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn theora_enc_chain (GstPad * pad, GstBuffer * buffer); 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 gboolean theora_enc_sink_setcaps (GstPad * pad, GstCaps * caps);
static void theora_enc_get_property (GObject * object, guint prop_id, static void theora_enc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
@ -711,44 +712,42 @@ data_push:
} }
} }
static GstElementStateReturn static GstStateChangeReturn
theora_enc_change_state (GstElement * element) theora_enc_change_state (GstElement * element, GstStateChange transition)
{ {
GstTheoraEnc *enc; GstTheoraEnc *enc;
gint transition; GstStateChangeReturn ret;
GstElementStateReturn ret;
transition = GST_STATE_TRANSITION (element);
enc = GST_THEORA_ENC (element); enc = GST_THEORA_ENC (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
theora_info_init (&enc->info); theora_info_init (&enc->info);
theora_comment_init (&enc->comment); theora_comment_init (&enc->comment);
enc->packetno = 0; enc->packetno = 0;
enc->initial_delay = 0; enc->initial_delay = 0;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
ret = parent_class->change_state (element); ret = parent_class->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_STREAM_LOCK (enc->sinkpad); GST_STREAM_LOCK (enc->sinkpad);
theora_clear (&enc->state); theora_clear (&enc->state);
theora_comment_clear (&enc->comment); theora_comment_clear (&enc->comment);
theora_info_clear (&enc->info); theora_info_clear (&enc->info);
GST_STREAM_UNLOCK (enc->sinkpad); GST_STREAM_UNLOCK (enc->sinkpad);
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default:
break; break;

View file

@ -75,7 +75,8 @@ GST_BOILERPLATE (GstVorbisDec, gst_vorbis_dec, GstElement, GST_TYPE_ELEMENT);
static void vorbisdec_finalize (GObject * object); static void vorbisdec_finalize (GObject * object);
static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event); static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn vorbis_dec_chain (GstPad * pad, GstBuffer * buffer); 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 #if 0
static const GstFormat *vorbis_dec_get_formats (GstPad * pad); static const GstFormat *vorbis_dec_get_formats (GstPad * pad);
@ -864,44 +865,42 @@ done:
return result; return result;
} }
static GstElementStateReturn static GstStateChangeReturn
vorbis_dec_change_state (GstElement * element) vorbis_dec_change_state (GstElement * element, GstStateChange transition)
{ {
GstVorbisDec *vd = GST_VORBIS_DEC (element); GstVorbisDec *vd = GST_VORBIS_DEC (element);
GstElementState transition; GstStateChangeReturn res;
GstElementStateReturn res;
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
vorbis_info_init (&vd->vi); vorbis_info_init (&vd->vi);
vorbis_comment_init (&vd->vc); vorbis_comment_init (&vd->vc);
vd->initialized = FALSE; vd->initialized = FALSE;
vd->granulepos = -1; vd->granulepos = -1;
vd->packetno = 0; vd->packetno = 0;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
res = parent_class->change_state (element); res = parent_class->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_DEBUG_OBJECT (vd, "PAUSED -> READY, clearing vorbis structures"); GST_DEBUG_OBJECT (vd, "PAUSED -> READY, clearing vorbis structures");
vorbis_block_clear (&vd->vb); vorbis_block_clear (&vd->vb);
vorbis_dsp_clear (&vd->vd); vorbis_dsp_clear (&vd->vd);
vorbis_comment_clear (&vd->vc); vorbis_comment_clear (&vd->vc);
vorbis_info_clear (&vd->vi); vorbis_info_clear (&vd->vi);
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default:
break; break;

View file

@ -120,7 +120,8 @@ static void gst_vorbisenc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static void gst_vorbisenc_set_property (GObject * object, guint prop_id, static void gst_vorbisenc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); 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; static GstElementClass *parent_class = NULL;
@ -1086,37 +1087,35 @@ gst_vorbisenc_set_property (GObject * object, guint prop_id,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_vorbisenc_change_state (GstElement * element) gst_vorbisenc_change_state (GstElement * element, GstStateChange transition)
{ {
GstVorbisEnc *vorbisenc = GST_VORBISENC (element); GstVorbisEnc *vorbisenc = GST_VORBISENC (element);
GstElementState transition; GstStateChangeReturn res;
GstElementStateReturn res;
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
vorbisenc->tags = gst_tag_list_new (); vorbisenc->tags = gst_tag_list_new ();
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
vorbisenc->eos = FALSE; vorbisenc->eos = FALSE;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
default: default:
break; break;
} }
res = GST_ELEMENT_CLASS (parent_class)->change_state (element); res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
vorbisenc->setup = FALSE; vorbisenc->setup = FALSE;
vorbisenc->header_sent = FALSE; vorbisenc->header_sent = FALSE;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_tag_list_free (vorbisenc->tags); gst_tag_list_free (vorbisenc->tags);
vorbisenc->tags = NULL; vorbisenc->tags = NULL;
default: default:

View file

@ -63,7 +63,8 @@ GST_BOILERPLATE (GstVorbisParse, gst_vorbis_parse, GstElement,
GST_TYPE_ELEMENT); GST_TYPE_ELEMENT);
static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer); 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 static void
gst_vorbis_parse_base_init (gpointer g_class) gst_vorbis_parse_base_init (gpointer g_class)
@ -186,18 +187,18 @@ vorbis_parse_chain (GstPad * pad, GstBuffer * buffer)
return GST_FLOW_OK; return GST_FLOW_OK;
} }
static GstElementStateReturn static GstStateChangeReturn
vorbis_parse_change_state (GstElement * element) vorbis_parse_change_state (GstElement * element, GstStateChange transition)
{ {
GstVorbisParse *parse = GST_VORBIS_PARSE (element); GstVorbisParse *parse = GST_VORBIS_PARSE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
parse->packetno = 0; parse->packetno = 0;
break; break;
default: default:
break; break;
} }
return parent_class->change_state (element); return parent_class->change_state (element, transition);
} }

View file

@ -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, static void gst_base_audio_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GstElementStateReturn gst_base_audio_sink_change_state (GstElement * static GstStateChangeReturn gst_base_audio_sink_change_state (GstElement *
element); element, GstStateChange transition);
static GstClock *gst_base_audio_sink_get_clock (GstElement * elem); static GstClock *gst_base_audio_sink_get_clock (GstElement * elem);
static GstClockTime gst_base_audio_sink_get_time (GstClock * clock, 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); //GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (data);
} }
static GstElementStateReturn static GstStateChangeReturn
gst_base_audio_sink_change_state (GstElement * element) 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); GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (sink->ringbuffer == NULL) { if (sink->ringbuffer == NULL) {
sink->ringbuffer = gst_base_audio_sink_create_ringbuffer (sink); sink->ringbuffer = gst_base_audio_sink_create_ringbuffer (sink);
gst_ring_buffer_set_callback (sink->ringbuffer, gst_ring_buffer_set_callback (sink->ringbuffer,
gst_base_audio_sink_callback, sink); gst_base_audio_sink_callback, sink);
} }
if (!gst_ring_buffer_open_device (sink->ringbuffer)) if (!gst_ring_buffer_open_device (sink->ringbuffer))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
gst_ring_buffer_pause (sink->ringbuffer); gst_ring_buffer_pause (sink->ringbuffer);
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ring_buffer_stop (sink->ringbuffer); gst_ring_buffer_stop (sink->ringbuffer);
gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL); gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL);
gst_ring_buffer_release (sink->ringbuffer); gst_ring_buffer_release (sink->ringbuffer);
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_ring_buffer_close_device (sink->ringbuffer); gst_ring_buffer_close_device (sink->ringbuffer);
break; break;
default: default:

View file

@ -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 void gst_base_audio_src_fixate (GstPad * pad, GstCaps * caps);
static GstElementStateReturn gst_base_audio_src_change_state (GstElement * static GstStateChangeReturn gst_base_audio_src_change_state (GstElement *
element); element, GstStateChange transition);
static GstClock *gst_base_audio_src_get_clock (GstElement * elem); static GstClock *gst_base_audio_src_get_clock (GstElement * elem);
static GstClockTime gst_base_audio_src_get_time (GstClock * clock, 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); //GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (data);
} }
static GstElementStateReturn static GstStateChangeReturn
gst_base_audio_src_change_state (GstElement * element) 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); GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (src->ringbuffer == NULL) { if (src->ringbuffer == NULL) {
src->ringbuffer = gst_base_audio_src_create_ringbuffer (src); src->ringbuffer = gst_base_audio_src_create_ringbuffer (src);
gst_ring_buffer_set_callback (src->ringbuffer, gst_ring_buffer_set_callback (src->ringbuffer,
gst_base_audio_src_callback, src); gst_base_audio_src_callback, src);
} }
if (!gst_ring_buffer_open_device (src->ringbuffer)) if (!gst_ring_buffer_open_device (src->ringbuffer))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
gst_ring_buffer_pause (src->ringbuffer); gst_ring_buffer_pause (src->ringbuffer);
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_ring_buffer_stop (src->ringbuffer); gst_ring_buffer_stop (src->ringbuffer);
gst_ring_buffer_release (src->ringbuffer); gst_ring_buffer_release (src->ringbuffer);
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_ring_buffer_close_device (src->ringbuffer); gst_ring_buffer_close_device (src->ringbuffer);
gst_object_unref (GST_OBJECT (src->ringbuffer)); gst_object_unref (GST_OBJECT (src->ringbuffer));
src->ringbuffer = NULL; src->ringbuffer = NULL;

View file

@ -76,7 +76,7 @@ gst_base_rtp_depayload_get_type (void)
return plugin_type; 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_finalize (GObject * object);
static void gst_base_rtp_depayload_set_property (GObject * object, static void gst_base_rtp_depayload_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); 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, static GstFlowReturn gst_base_rtp_depayload_chain (GstPad * pad,
GstBuffer * in); GstBuffer * in);
static GstElementStateReturn gst_base_rtp_depayload_change_state (GstElement * static GstStateChangeReturn gst_base_rtp_depayload_change_state (GstElement *
element); element, GstStateChange transition);
static GstFlowReturn gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * static GstFlowReturn gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload *
filter, GstBuffer * in); filter, GstBuffer * in);
@ -413,53 +413,55 @@ gst_base_rtp_depayload_stop_thread (GstBaseRTPDepayload * filter)
return TRUE; return TRUE;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_base_rtp_depayload_change_state (GstElement * element) gst_base_rtp_depayload_change_state (GstElement * element,
GstStateChange transition)
{ {
GstBaseRTPDepayload *filter; 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); filter = GST_BASE_RTP_DEPAYLOAD (element);
/* we disallow changing the state from the thread */ /* we disallow changing the state from the thread */
if (g_thread_self () == filter->thread) if (g_thread_self () == filter->thread)
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_base_rtp_depayload_start_thread (filter)) if (!gst_base_rtp_depayload_start_thread (filter))
goto start_failed; goto start_failed;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
// ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); // ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_base_rtp_depayload_stop_thread (filter); gst_base_rtp_depayload_stop_thread (filter);
break; break;
default:
break;
} }
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
/* ERRORS */ /* ERRORS */
start_failed: start_failed:
{ {
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
} }

View file

@ -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 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; static GstElementClass *parent_class = NULL;
@ -645,29 +646,29 @@ gst_vorbis_tag_chain (GstPad * pad, GstBuffer * buffer)
return GST_FLOW_OK; return GST_FLOW_OK;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_vorbis_tag_change_state (GstElement * element) gst_vorbis_tag_change_state (GstElement * element, GstStateChange transition)
{ {
GstVorbisTag *tag; GstVorbisTag *tag;
tag = GST_VORBIS_TAG (element); tag = GST_VORBIS_TAG (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* do something to get out of the chain function faster */ /* do something to get out of the chain function faster */
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
tag->output = OUTPUT_UNKNOWN; tag->output = OUTPUT_UNKNOWN;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
} }
return parent_class->change_state (element); return parent_class->change_state (element, transition);
} }

View file

@ -87,7 +87,8 @@ static void gst_adder_init (GstAdder * adder);
static GstPad *gst_adder_request_new_pad (GstElement * element, static GstPad *gst_adder_request_new_pad (GstElement * element,
GstPadTemplate * temp, const gchar * unused); 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); static gboolean gst_adder_setcaps (GstPad * pad, GstCaps * caps);
@ -400,34 +401,32 @@ not_negotiated:
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_adder_change_state (GstElement * element) gst_adder_change_state (GstElement * element, GstStateChange transition)
{ {
GstAdder *adder; GstAdder *adder;
GstElementStateReturn ret; GstStateChangeReturn ret;
gint transition;
adder = GST_ADDER (element); adder = GST_ADDER (element);
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
adder->timestamp = 0; adder->timestamp = 0;
adder->offset = 0; adder->offset = 0;
gst_collectpads_start (adder->collect); gst_collectpads_start (adder->collect);
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collectpads_stop (adder->collect); gst_collectpads_stop (adder->collect);
break; break;
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
return ret; return ret;
} }

View file

@ -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_base_init (BufferFramesConvertClass * klass);
static void buffer_frames_convert_init (BufferFramesConvert * this); static void buffer_frames_convert_init (BufferFramesConvert * this);
static GstElementStateReturn buffer_frames_convert_change_state (GstElement * static GstStateChangeReturn buffer_frames_convert_change_state (GstElement *
element); element, GstStateChange transition);
static GstCaps *buffer_frames_convert_getcaps (GstPad * pad); static GstCaps *buffer_frames_convert_getcaps (GstPad * pad);
static gboolean buffer_frames_convert_setcaps (GstPad * pad, GstCaps * caps); 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; this->samples_out_remaining = 0;
} }
static GstElementStateReturn static GstStateChangeReturn
buffer_frames_convert_change_state (GstElement * element) buffer_frames_convert_change_state (GstElement * element,
GstStateChange transition)
{ {
BufferFramesConvert *this = (BufferFramesConvert *) element; BufferFramesConvert *this = (BufferFramesConvert *) element;
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
this->offset = 0; this->offset = 0;
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
if (this->buf_out) if (this->buf_out)
gst_buffer_unref (this->buf_out); gst_buffer_unref (this->buf_out);
this->buf_out = NULL; this->buf_out = NULL;
@ -193,8 +194,8 @@ buffer_frames_convert_change_state (GstElement * element)
} }
if (parent_class->change_state) 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 GstCaps * static GstCaps *

View file

@ -110,7 +110,8 @@ static void gst_audiorate_set_property (GObject * object,
static void gst_audiorate_get_property (GObject * object, static void gst_audiorate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); 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; static GstElementClass *parent_class = NULL;
@ -379,15 +380,15 @@ gst_audiorate_get_property (GObject * object,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_audiorate_change_state (GstElement * element) gst_audiorate_change_state (GstElement * element, GstStateChange transition)
{ {
GstAudiorate *audiorate = GST_AUDIORATE (element); GstAudiorate *audiorate = GST_AUDIORATE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
audiorate->next_offset = 0; audiorate->next_offset = 0;
break; break;
default: default:
@ -395,9 +396,9 @@ gst_audiorate_change_state (GstElement * element)
} }
if (parent_class->change_state) 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 static gboolean

View file

@ -110,7 +110,8 @@ static void gst_audioscale_init (Audioscale * audioscale);
static void gst_audioscale_dispose (GObject * object); static void gst_audioscale_dispose (GObject * object);
static void gst_audioscale_chain (GstPad * pad, GstData * _data); 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, static void gst_audioscale_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
@ -654,20 +655,20 @@ gst_audioscale_chain (GstPad * pad, GstData * _data)
} }
static GstElementStateReturn static GstStateChangeReturn
gst_audioscale_change_state (GstElement * element) gst_audioscale_change_state (GstElement * element, GstStateChange transition)
{ {
Audioscale *audioscale = GST_AUDIOSCALE (element); Audioscale *audioscale = GST_AUDIOSCALE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
audioscale->gst_resample_offset = 0; audioscale->gst_resample_offset = 0;
break; break;
default: default:
break; break;
} }
return parent_class->change_state (element); return parent_class->change_state (element, transition);
} }
static void static void

View file

@ -24,7 +24,7 @@ main (gint argc, gchar * argv[])
GstElement *decoder; GstElement *decoder;
GstElement *source; GstElement *source;
GstElement *pipeline; GstElement *pipeline;
GstElementStateReturn res; GstStateChangeReturn res;
gst_init (&argc, &argv); gst_init (&argc, &argv);
@ -43,7 +43,7 @@ main (gint argc, gchar * argv[])
gst_element_link_pads (source, "src", decoder, "sink"); gst_element_link_pads (source, "src", decoder, "sink");
res = gst_element_set_state (pipeline, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }

View file

@ -119,7 +119,8 @@ static void gst_decode_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * spec); const GValue * value, GParamSpec * spec);
static void gst_decode_bin_get_property (GObject * object, guint prop_id, static void gst_decode_bin_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * spec); 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, static void type_found (GstElement * typefind, guint probability,
GstCaps * caps, GstDecodeBin * decode_bin); GstCaps * caps, GstDecodeBin * decode_bin);
@ -1041,36 +1042,34 @@ gst_decode_bin_get_property (GObject * object, guint prop_id, GValue * value,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_decode_bin_change_state (GstElement * element) gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
{ {
GstElementStateReturn ret; GstStateChangeReturn ret;
GstDecodeBin *decode_bin; GstDecodeBin *decode_bin;
GList *dyns; GList *dyns;
gint transition;
decode_bin = GST_DECODE_BIN (element); decode_bin = GST_DECODE_BIN (element);
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
decode_bin->numpads = 0; decode_bin->numpads = 0;
decode_bin->dynamics = NULL; decode_bin->dynamics = NULL;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; 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)) { for (dyns = decode_bin->dynamics; dyns; dyns = g_list_next (dyns)) {
GstDynamic *dynamic = (GstDynamic *) dyns->data; GstDynamic *dynamic = (GstDynamic *) dyns->data;

View file

@ -63,8 +63,8 @@ static void gst_play_base_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * spec); const GValue * value, GParamSpec * spec);
static void gst_play_base_bin_get_property (GObject * object, guint prop_id, static void gst_play_base_bin_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * spec); GValue * value, GParamSpec * spec);
static GstElementStateReturn gst_play_base_bin_change_state (GstElement * static GstStateChangeReturn gst_play_base_bin_change_state (GstElement *
element); element, GstStateChange transition);
const GList *gst_play_base_bin_get_streaminfo (GstPlayBaseBin * play_base_bin); const GList *gst_play_base_bin_get_streaminfo (GstPlayBaseBin * play_base_bin);
static gboolean prepare_output (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); g_mutex_lock (play_base_bin->group_lock);
if (gst_element_set_state (subbin, GST_STATE_PLAYING) == if (gst_element_set_state (subbin, GST_STATE_PLAYING) ==
GST_STATE_SUCCESS) { GST_STATE_CHANGE_SUCCESS) {
GST_DEBUG ("waiting for first group..."); GST_DEBUG ("waiting for first group...");
sig6 = g_signal_connect (G_OBJECT (subbin), sig6 = g_signal_connect (G_OBJECT (subbin),
"state-changed", G_CALLBACK (state_change), play_base_bin); "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 static GstStateChangeReturn
gst_play_base_bin_change_state (GstElement * element) gst_play_base_bin_change_state (GstElement * element, GstStateChange transition)
{ {
GstElementStateReturn ret; GstStateChangeReturn ret;
GstPlayBaseBin *play_base_bin; GstPlayBaseBin *play_base_bin;
gint transition = GST_STATE_TRANSITION (element);
gchar *new_location = NULL; gchar *new_location = NULL;
play_base_bin = GST_PLAY_BASE_BIN (element); play_base_bin = GST_PLAY_BASE_BIN (element);
switch (transition) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (!setup_source (play_base_bin, &new_location)) if (!setup_source (play_base_bin, &new_location))
goto source_failed; goto source_failed;
break; break;
@ -1669,11 +1668,11 @@ gst_play_base_bin_change_state (GstElement * element)
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (ret == GST_STATE_SUCCESS) { if (ret == GST_STATE_CHANGE_SUCCESS) {
finish_source (play_base_bin); finish_source (play_base_bin);
} else { } else {
/* clean up leftover groups */ /* clean up leftover groups */
@ -1681,7 +1680,7 @@ gst_play_base_bin_change_state (GstElement * element)
play_base_bin->need_rebuild = TRUE; play_base_bin->need_rebuild = TRUE;
} }
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
play_base_bin->need_rebuild = TRUE; play_base_bin->need_rebuild = TRUE;
remove_groups (play_base_bin); remove_groups (play_base_bin);
break; break;
@ -1695,7 +1694,7 @@ source_failed:
{ {
play_base_bin->need_rebuild = TRUE; play_base_bin->need_rebuild = TRUE;
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
} }

View file

@ -101,7 +101,8 @@ static void gst_play_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * spec); const GValue * value, GParamSpec * spec);
static void gst_play_bin_get_property (GObject * object, guint prop_id, static void gst_play_bin_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * spec); 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; static GstElementClass *parent_class;
@ -842,19 +843,17 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_play_bin_change_state (GstElement * element) gst_play_bin_change_state (GstElement * element, GstStateChange transition)
{ {
GstElementStateReturn ret; GstStateChangeReturn ret;
GstPlayBin *play_bin; GstPlayBin *play_bin;
int transition;
play_bin = GST_PLAY_BIN (element); play_bin = GST_PLAY_BIN (element);
transition = GST_STATE_TRANSITION (element);
switch (transition) { 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 /* this really is the easiest way to make the state change return
* ASYNC until we added the sinks */ * ASYNC until we added the sinks */
if (!play_bin->fakesink) { if (!play_bin->fakesink) {
@ -866,12 +865,12 @@ gst_play_bin_change_state (GstElement * element)
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_FAILURE) if (ret == GST_STATE_CHANGE_FAILURE)
return ret; return ret;
switch (transition) { 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, /* Set audio sink state to NULL to release the sound device,
* but only if we own it (else we might be in chain-transition). */ * but only if we own it (else we might be in chain-transition). */
//if (play_bin->audio_sink != NULL && //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); // gst_element_set_state (play_bin->audio_sink, GST_STATE_NULL);
//} //}
break; 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 /* 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 * gst_bin_dispose which is called by gst_play_bin_dispose, and in that
* case, we don't want to run remove_sinks. * case, we don't want to run remove_sinks.

View file

@ -67,7 +67,7 @@ gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
{ {
GstElement *player; GstElement *player;
GstElementStateReturn res; GstStateChangeReturn res;
gint streams; gint streams;
GList *streaminfo; GList *streaminfo;
GList *s; GList *s;
@ -80,7 +80,7 @@ main (gint argc, gchar * argv[])
g_object_set (G_OBJECT (player), "uri", argv[1], NULL); g_object_set (G_OBJECT (player), "uri", argv[1], NULL);
res = gst_element_set_state (player, GST_STATE_PAUSED); 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"); g_print ("could not pause\n");
return -1; return -1;
} }
@ -126,7 +126,7 @@ main (gint argc, gchar * argv[])
/* set effects sinks */ /* set effects sinks */
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }

View file

@ -22,7 +22,7 @@ gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
{ {
GstElement *player; GstElement *player;
GstElementStateReturn res; GstStateChangeReturn res;
gst_init (&argc, &argv); gst_init (&argc, &argv);
@ -32,7 +32,7 @@ main (gint argc, gchar * argv[])
g_object_set (G_OBJECT (player), "uri", argv[1], NULL); g_object_set (G_OBJECT (player), "uri", argv[1], NULL);
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }

View file

@ -38,7 +38,7 @@ gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
{ {
GstElement *player; GstElement *player;
GstElementStateReturn res; GstStateChangeReturn res;
gst_init (&argc, &argv); gst_init (&argc, &argv);
@ -48,7 +48,7 @@ main (gint argc, gchar * argv[])
g_object_set (G_OBJECT (player), "uri", argv[1], NULL); g_object_set (G_OBJECT (player), "uri", argv[1], NULL);
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }

View file

@ -24,7 +24,7 @@ gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
{ {
GstElement *player; GstElement *player;
GstElementStateReturn res; GstStateChangeReturn res;
gst_init (&argc, &argv); gst_init (&argc, &argv);
@ -40,7 +40,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n"); g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }
@ -50,7 +50,7 @@ main (gint argc, gchar * argv[])
g_print ("pause...\n"); g_print ("pause...\n");
res = gst_element_set_state (player, GST_STATE_PAUSED); 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"); g_print ("could not play\n");
return -1; return -1;
} }
@ -60,7 +60,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n"); g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }
@ -70,7 +70,7 @@ main (gint argc, gchar * argv[])
g_print ("ready...\n"); g_print ("ready...\n");
res = gst_element_set_state (player, GST_STATE_READY); 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"); g_print ("could not play\n");
return -1; return -1;
} }
@ -80,7 +80,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n"); g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING); 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"); g_print ("could not play\n");
return -1; return -1;
} }

View file

@ -54,7 +54,8 @@ static const GstEventMask *gst_subparse_src_eventmask (GstPad * pad);
#endif #endif
static gboolean gst_subparse_src_event (GstPad * pad, GstEvent * event); 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 #if 0
static void gst_subparse_loop (GstPad * sinkpad); static void gst_subparse_loop (GstPad * sinkpad);
@ -630,17 +631,17 @@ gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf)
return ret; return ret;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_subparse_change_state (GstElement * element) gst_subparse_change_state (GstElement * element, GstStateChange transition)
{ {
GstSubparse *self = GST_SUBPARSE (element); GstSubparse *self = GST_SUBPARSE (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
parser_state_dispose (&self->state); parser_state_dispose (&self->state);
self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN; self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
/* format detection will init the parser state */ /* format detection will init the parser state */
self->offset = self->next_offset = 0; self->offset = self->next_offset = 0;
self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN; self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN;
@ -649,7 +650,7 @@ gst_subparse_change_state (GstElement * element)
break; break;
} }
return parent_class->change_state (element); return parent_class->change_state (element, transition);
} }
#if 0 #if 0

View file

@ -230,8 +230,8 @@ static void gst_multifdsink_remove_client_link (GstMultiFdSink * sink,
static GstFlowReturn gst_multifdsink_render (GstBaseSink * bsink, static GstFlowReturn gst_multifdsink_render (GstBaseSink * bsink,
GstBuffer * buf); GstBuffer * buf);
static GstElementStateReturn gst_multifdsink_change_state (GstElement * static GstStateChangeReturn gst_multifdsink_change_state (GstElement *
element); element, GstStateChange transition);
static void gst_multifdsink_set_property (GObject * object, guint prop_id, static void gst_multifdsink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
@ -1771,50 +1771,50 @@ gst_multifdsink_stop (GstBaseSink * bsink)
return TRUE; return TRUE;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_multifdsink_change_state (GstElement * element) gst_multifdsink_change_state (GstElement * element, GstStateChange transition)
{ {
GstMultiFdSink *sink; GstMultiFdSink *sink;
gint transition; GstStateChangeReturn ret;
GstElementStateReturn ret;
sink = GST_MULTIFDSINK (element); sink = GST_MULTIFDSINK (element);
/* we disallow changing the state from the streaming thread */ /* we disallow changing the state from the streaming thread */
if (g_thread_self () == sink->thread) if (g_thread_self () == sink->thread)
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_multifdsink_start (GST_BASE_SINK (sink))) if (!gst_multifdsink_start (GST_BASE_SINK (sink)))
goto start_failed; goto start_failed;
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default: default:
break; break;
} }
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_multifdsink_stop (GST_BASE_SINK (sink)); gst_multifdsink_stop (GST_BASE_SINK (sink));
break; break;
default:
break;
} }
return ret; return ret;
/* ERRORS */ /* ERRORS */
start_failed: start_failed:
{ {
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
} }

View file

@ -61,8 +61,8 @@ static void gst_tcpclientsink_finalize (GObject * gobject);
static gboolean gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps); static gboolean gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps);
static GstFlowReturn gst_tcpclientsink_render (GstBaseSink * bsink, static GstFlowReturn gst_tcpclientsink_render (GstBaseSink * bsink,
GstBuffer * buf); GstBuffer * buf);
static GstElementStateReturn gst_tcpclientsink_change_state (GstElement * static GstStateChangeReturn gst_tcpclientsink_change_state (GstElement *
element); element, GstStateChange transition);
static void gst_tcpclientsink_set_property (GObject * object, guint prop_id, static void gst_tcpclientsink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
@ -403,29 +403,27 @@ gst_tcpclientsink_stop (GstTCPClientSink * this)
return TRUE; return TRUE;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_tcpclientsink_change_state (GstElement * element) gst_tcpclientsink_change_state (GstElement * element, GstStateChange transition)
{ {
GstTCPClientSink *sink; GstTCPClientSink *sink;
gint transition; GstStateChangeReturn res;
GstElementStateReturn res;
sink = GST_TCPCLIENTSINK (element); sink = GST_TCPCLIENTSINK (element);
transition = GST_STATE_TRANSITION (element);
switch (transition) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (!gst_tcpclientsink_start (GST_TCPCLIENTSINK (element))) if (!gst_tcpclientsink_start (GST_TCPCLIENTSINK (element)))
goto start_failure; goto start_failure;
break; break;
default: default:
break; break;
} }
res = GST_ELEMENT_CLASS (parent_class)->change_state (element); res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
gst_tcpclientsink_stop (GST_TCPCLIENTSINK (element)); gst_tcpclientsink_stop (GST_TCPCLIENTSINK (element));
default: default:
break; break;
@ -434,6 +432,6 @@ gst_tcpclientsink_change_state (GstElement * element)
start_failure: start_failure:
{ {
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
} }

View file

@ -116,7 +116,8 @@ static void gst_videorate_set_property (GObject * object,
static void gst_videorate_get_property (GObject * object, static void gst_videorate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); 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; static GstElementClass *parent_class = NULL;
@ -572,25 +573,23 @@ gst_videorate_get_property (GObject * object,
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_videorate_change_state (GstElement * element) gst_videorate_change_state (GstElement * element, GstStateChange transition)
{ {
GstElementStateReturn ret; GstStateChangeReturn ret;
GstVideorate *videorate; GstVideorate *videorate;
gint transition;
videorate = GST_VIDEORATE (element); videorate = GST_VIDEORATE (element);
transition = GST_STATE_TRANSITION (videorate);
switch (transition) { switch (transition) {
default: default:
break; break;
} }
ret = parent_class->change_state (element); ret = parent_class->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_videorate_blank_data (videorate); gst_videorate_blank_data (videorate);
break; break;
default: default:

View file

@ -72,7 +72,7 @@ static void gst_v4lmjpegsink_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_v4lmjpegsink_get_property (GObject * object, static void gst_v4lmjpegsink_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
static GstElementStateReturn gst_v4lmjpegsink_change_state (GstElement * static GstStateChangeReturn gst_v4lmjpegsink_change_state (GstElement *
element); element);
static void gst_v4lmjpegsink_set_clock (GstElement * element, GstClock * clock); static void gst_v4lmjpegsink_set_clock (GstElement * element, GstClock * clock);
@ -387,46 +387,48 @@ gst_v4lmjpegsink_get_property (GObject * object,
} }
static GstElementStateReturn static GstStateChangeReturn
gst_v4lmjpegsink_change_state (GstElement * element) gst_v4lmjpegsink_change_state (GstElement * element, GstStateChange transition)
{ {
GstV4lMjpegSink *v4lmjpegsink; 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); v4lmjpegsink = GST_V4LMJPEGSINK (element);
/* set up change state */ /* set up change state */
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
/* we used to do buffer setup here, but that's now done /* we used to do buffer setup here, but that's now done
* right after capsnego */ * right after capsnego */
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* start */ /* start */
if (!gst_v4lmjpegsink_playback_start (v4lmjpegsink)) if (!gst_v4lmjpegsink_playback_start (v4lmjpegsink))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
/* de-queue all queued buffers */ /* de-queue all queued buffers */
if (!gst_v4lmjpegsink_playback_stop (v4lmjpegsink)) if (!gst_v4lmjpegsink_playback_stop (v4lmjpegsink))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
/* stop playback, unmap all buffers */ /* stop playback, unmap all buffers */
if (!gst_v4lmjpegsink_playback_deinit (v4lmjpegsink)) if (!gst_v4lmjpegsink_playback_deinit (v4lmjpegsink))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) { 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 { } else {
parent_value = GST_STATE_FAILURE; parent_value = GST_STATE_CHANGE_FAILURE;
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) if (GST_ELEMENT_CLASS (parent_class)->change_state)
return parent_value; return parent_value;
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }

View file

@ -99,8 +99,7 @@ static void gst_v4lmjpegsrc_get_property (GObject * object,
static void gst_v4lmjpegsrc_set_clock (GstElement * element, GstClock * clock); static void gst_v4lmjpegsrc_set_clock (GstElement * element, GstClock * clock);
/* state handling */ /* state handling */
static GstElementStateReturn gst_v4lmjpegsrc_change_state (GstElement * static GstStateChangeReturn gst_v4lmjpegsrc_change_state (GstElement * element);
element);
/* requeue buffer after use */ /* requeue buffer after use */
static void gst_v4lmjpegsrc_buffer_free (GstBuffer * buffer); static void gst_v4lmjpegsrc_buffer_free (GstBuffer * buffer);
@ -736,18 +735,18 @@ gst_v4lmjpegsrc_get_property (GObject * object,
} }
static GstElementStateReturn static GstStateChangeReturn
gst_v4lmjpegsrc_change_state (GstElement * element) gst_v4lmjpegsrc_change_state (GstElement * element, GstStateChange transition)
{ {
GstV4lMjpegSrc *v4lmjpegsrc; GstV4lMjpegSrc *v4lmjpegsrc;
GTimeVal time; 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); v4lmjpegsrc = GST_V4LMJPEGSRC (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
/* actual buffer set-up used to be done here - but I moved /* actual buffer set-up used to be done here - but I moved
* it to capsnego itself */ * it to capsnego itself */
v4lmjpegsrc->handled = 0; v4lmjpegsrc->handled = 0;
@ -755,37 +754,37 @@ gst_v4lmjpegsrc_change_state (GstElement * element)
v4lmjpegsrc->last_frame = 0; v4lmjpegsrc->last_frame = 0;
v4lmjpegsrc->substract_time = 0; v4lmjpegsrc->substract_time = 0;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* queue all buffer, start streaming capture */ /* queue all buffer, start streaming capture */
if (GST_V4LELEMENT (v4lmjpegsrc)->buffer && if (GST_V4LELEMENT (v4lmjpegsrc)->buffer &&
!gst_v4lmjpegsrc_capture_start (v4lmjpegsrc)) !gst_v4lmjpegsrc_capture_start (v4lmjpegsrc))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
g_get_current_time (&time); g_get_current_time (&time);
v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) - v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) -
v4lmjpegsrc->substract_time; v4lmjpegsrc->substract_time;
v4lmjpegsrc->last_seq = 0; v4lmjpegsrc->last_seq = 0;
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
g_get_current_time (&time); g_get_current_time (&time);
v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) - v4lmjpegsrc->substract_time = GST_TIMEVAL_TO_TIME (time) -
v4lmjpegsrc->substract_time; v4lmjpegsrc->substract_time;
/* de-queue all queued buffers */ /* de-queue all queued buffers */
if (v4lmjpegsrc->is_capturing && if (v4lmjpegsrc->is_capturing &&
!gst_v4lmjpegsrc_capture_stop (v4lmjpegsrc)) !gst_v4lmjpegsrc_capture_stop (v4lmjpegsrc))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
/* stop capturing, unmap all buffers */ /* stop capturing, unmap all buffers */
if (GST_V4LELEMENT (v4lmjpegsrc)->buffer && if (GST_V4LELEMENT (v4lmjpegsrc)->buffer &&
!gst_v4lmjpegsrc_capture_deinit (v4lmjpegsrc)) !gst_v4lmjpegsrc_capture_deinit (v4lmjpegsrc))
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
break; break;
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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;
} }

View file

@ -1115,20 +1115,20 @@ wrong_aspect:
} }
} }
static GstElementStateReturn static GstStateChangeReturn
gst_ximagesink_change_state (GstElement * element) gst_ximagesink_change_state (GstElement * element, GstStateChange transition)
{ {
GstXImageSink *ximagesink; GstXImageSink *ximagesink;
ximagesink = GST_XIMAGESINK (element); ximagesink = GST_XIMAGESINK (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
/* Initializing the XContext */ /* Initializing the XContext */
if (!ximagesink->xcontext) if (!ximagesink->xcontext)
ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink); ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink);
if (!ximagesink->xcontext) if (!ximagesink->xcontext)
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
/* call XSynchronize with the current value of synchronous */ /* call XSynchronize with the current value of synchronous */
GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s", GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s",
ximagesink->synchronous ? "TRUE" : "FALSE"); ximagesink->synchronous ? "TRUE" : "FALSE");
@ -1136,14 +1136,14 @@ gst_ximagesink_change_state (GstElement * element)
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous); XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
g_mutex_unlock (ximagesink->x_lock); g_mutex_unlock (ximagesink->x_lock);
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
ximagesink->time = 0; ximagesink->time = 0;
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
g_mutex_lock (ximagesink->stream_lock); g_mutex_lock (ximagesink->stream_lock);
if (ximagesink->xwindow) if (ximagesink->xwindow)
gst_ximagesink_xwindow_clear (ximagesink, 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; GST_VIDEO_SINK_HEIGHT (ximagesink) = 0;
g_mutex_unlock (ximagesink->stream_lock); g_mutex_unlock (ximagesink->stream_lock);
break; 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 /* 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 but the interface can be called to set a window from a different thread
and that would crash */ and that would crash */
@ -1180,9 +1180,9 @@ gst_ximagesink_change_state (GstElement * element)
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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 static void

View file

@ -1424,19 +1424,19 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
return TRUE; return TRUE;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_xvimagesink_change_state (GstElement * element) gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
{ {
GstXvImageSink *xvimagesink; GstXvImageSink *xvimagesink;
xvimagesink = GST_XVIMAGESINK (element); xvimagesink = GST_XVIMAGESINK (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
/* Initializing the XContext */ /* Initializing the XContext */
if (!xvimagesink->xcontext && if (!xvimagesink->xcontext &&
!(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink))) !(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 */ /* update object's par with calculated one if not set yet */
if (!xvimagesink->par) { if (!xvimagesink->par) {
xvimagesink->par = g_new0 (GValue, 1); xvimagesink->par = g_new0 (GValue, 1);
@ -1449,20 +1449,20 @@ gst_xvimagesink_change_state (GstElement * element)
XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous); XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous);
gst_xvimagesink_update_colorbalance (xvimagesink); gst_xvimagesink_update_colorbalance (xvimagesink);
break; break;
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (xvimagesink->xwindow) if (xvimagesink->xwindow)
gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow); gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow);
break; break;
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
xvimagesink->framerate = 0; xvimagesink->framerate = 0;
GST_VIDEO_SINK_WIDTH (xvimagesink) = 0; GST_VIDEO_SINK_WIDTH (xvimagesink) = 0;
GST_VIDEO_SINK_HEIGHT (xvimagesink) = 0; GST_VIDEO_SINK_HEIGHT (xvimagesink) = 0;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
if (xvimagesink->xvimage) { if (xvimagesink->xvimage) {
gst_xvimage_buffer_free (xvimagesink->xvimage); gst_xvimage_buffer_free (xvimagesink->xvimage);
xvimagesink->xvimage = NULL; xvimagesink->xvimage = NULL;
@ -1483,7 +1483,7 @@ gst_xvimagesink_change_state (GstElement * element)
break; break;
} }
return GST_ELEMENT_CLASS (parent_class)->change_state (element); return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
} }
static void static void

View file

@ -143,7 +143,8 @@ verify_convert (GstElement * audioconvert, void *in, int inlength, void *out,
GstBuffer *inbuffer, *outbuffer; GstBuffer *inbuffer, *outbuffer;
fail_unless (gst_element_set_state (audioconvert, 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); GST_DEBUG ("Creating buffer of %d bytes", inlength);
inbuffer = gst_buffer_new_and_alloc (inlength); inbuffer = gst_buffer_new_and_alloc (inlength);

View file

@ -151,7 +151,8 @@ test_perfect_stream_instance (int inrate, int outrate, int samples,
fail_unless (gst_caps_is_fixed (caps)); fail_unless (gst_caps_is_fixed (caps));
fail_unless (gst_element_set_state (audioresample, 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) { for (j = 1; j <= numbuffers; ++j) {

View file

@ -109,7 +109,8 @@ GST_START_TEST (test_unity)
volume = setup_volume (); volume = setup_volume ();
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -142,7 +143,8 @@ GST_START_TEST (test_half)
volume = setup_volume (); volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 0.5, NULL); g_object_set (G_OBJECT (volume), "volume", 0.5, NULL);
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -181,7 +183,8 @@ GST_START_TEST (test_double)
volume = setup_volume (); volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 2.0, NULL); g_object_set (G_OBJECT (volume), "volume", 2.0, NULL);
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps)
bus = gst_bus_new (); bus = gst_bus_new ();
fail_unless (gst_element_set_state (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); inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4); memcpy (GST_BUFFER_DATA (inbuffer), in, 4);

View file

@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header)
vorbisdec = setup_vorbisdec (); vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (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 (); bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30); inbuffer = gst_buffer_new_and_alloc (30);
@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header)
bus = gst_bus_new (); bus = gst_bus_new ();
fail_unless (gst_element_set_state (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");
inbuffer = gst_buffer_new_and_alloc (0); inbuffer = gst_buffer_new_and_alloc (0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header)
vorbisdec = setup_vorbisdec (); vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (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 (); bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30); inbuffer = gst_buffer_new_and_alloc (30);

View file

@ -1083,7 +1083,7 @@ stop_seek (GtkWidget * widget, gpointer user_data)
static void static void
play_cb (GtkButton * button, gpointer data) play_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PLAYING) { if (state != GST_STATE_PLAYING) {
@ -1097,7 +1097,7 @@ play_cb (GtkButton * button, gpointer data)
static void static void
pause_cb (GtkButton * button, gpointer data) pause_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PAUSED) { if (state != GST_STATE_PAUSED) {
@ -1110,7 +1110,7 @@ pause_cb (GtkButton * button, gpointer data)
static void static void
stop_cb (GtkButton * button, gpointer data) stop_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_READY) { if (state != GST_STATE_READY) {

View file

@ -189,7 +189,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
static void static void
play_cb (GtkButton * button, gpointer data) play_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PLAYING) { if (state != GST_STATE_PLAYING) {
@ -202,7 +202,7 @@ play_cb (GtkButton * button, gpointer data)
static void static void
pause_cb (GtkButton * button, gpointer data) pause_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_PAUSED) { if (state != GST_STATE_PAUSED) {
@ -214,7 +214,7 @@ pause_cb (GtkButton * button, gpointer data)
static void static void
stop_cb (GtkButton * button, gpointer data) stop_cb (GtkButton * button, gpointer data)
{ {
GstElementState state; GstState state;
gst_element_get_state (pipeline, &state, NULL, NULL); gst_element_get_state (pipeline, &state, NULL, NULL);
if (state != GST_STATE_READY) { if (state != GST_STATE_READY) {

View file

@ -59,7 +59,8 @@ main (gint argc, gchar * argv[])
dec_sink = gst_element_get_pad (decoder, "sink"); dec_sink = gst_element_get_pad (decoder, "sink");
enc_src = gst_element_get_pad (encoder, "src"); 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"); g_print ("pipeline doesn't want to play\n");
return -1; return -1;
} }

View file

@ -47,7 +47,8 @@ static void sinesrc_init (SineSrc * src);
static void sinesrc_class_init (SineSrcClass * klass); static void sinesrc_class_init (SineSrcClass * klass);
static GstData *sinesrc_get (GstPad * pad); static GstData *sinesrc_get (GstPad * pad);
static GstElementStateReturn sinesrc_change_state (GstElement * element); static GstStateChangeReturn sinesrc_change_state (GstElement * element,
GstStateChange transition);
GType GType
@ -318,31 +319,31 @@ sinesrc_set_pre_get_func (SineSrc * src, PreGetFunc func)
src->pre_get_func = func; src->pre_get_func = func;
} }
static GstElementStateReturn static GstStateChangeReturn
sinesrc_change_state (GstElement * element) sinesrc_change_state (GstElement * element, GstStateChange transition)
{ {
SineSrc *sinesrc; SineSrc *sinesrc;
g_return_val_if_fail (element != NULL, FALSE); g_return_val_if_fail (element != NULL, FALSE);
sinesrc = SINESRC (element); sinesrc = SINESRC (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
sinesrc->newcaps = TRUE; sinesrc->newcaps = TRUE;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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;
} }

View file

@ -22,9 +22,9 @@
GstElement *pipeline; GstElement *pipeline;
static void 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...", g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state), gst_element_state_get_name (old_state),

View file

@ -23,9 +23,9 @@
GstElement *pipeline; GstElement *pipeline;
static void 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...", g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state), gst_element_state_get_name (old_state),

View file

@ -47,7 +47,8 @@ static void sinesrc_init (SineSrc * src);
static void sinesrc_class_init (SineSrcClass * klass); static void sinesrc_class_init (SineSrcClass * klass);
static GstData *sinesrc_get (GstPad * pad); static GstData *sinesrc_get (GstPad * pad);
static GstElementStateReturn sinesrc_change_state (GstElement * element); static GstStateChangeReturn sinesrc_change_state (GstElement * element,
GstStateChange transition);
GType GType
@ -318,31 +319,31 @@ sinesrc_set_pre_get_func (SineSrc * src, PreGetFunc func)
src->pre_get_func = func; src->pre_get_func = func;
} }
static GstElementStateReturn static GstStateChangeReturn
sinesrc_change_state (GstElement * element) sinesrc_change_state (GstElement * element, GstStateChange transition)
{ {
SineSrc *sinesrc; SineSrc *sinesrc;
g_return_val_if_fail (element != NULL, FALSE); g_return_val_if_fail (element != NULL, FALSE);
sinesrc = SINESRC (element); sinesrc = SINESRC (element);
switch (GST_STATE_TRANSITION (element)) { switch (transition) {
case GST_STATE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
case GST_STATE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
case GST_STATE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
sinesrc->newcaps = TRUE; sinesrc->newcaps = TRUE;
break; break;
case GST_STATE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
break; break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
if (GST_ELEMENT_CLASS (parent_class)->change_state) 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;
} }

View file

@ -22,9 +22,9 @@
GstElement *pipeline; GstElement *pipeline;
static void 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...", g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state), gst_element_state_get_name (old_state),

View file

@ -23,9 +23,9 @@
GstElement *pipeline; GstElement *pipeline;
static void 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...", g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state), gst_element_state_get_name (old_state),