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;
fail_unless (gst_element_set_state (audioconvert,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
GST_DEBUG ("Creating buffer of %d bytes", inlength);
inbuffer = gst_buffer_new_and_alloc (inlength);

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_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) {

View file

@ -109,7 +109,8 @@ GST_START_TEST (test_unity)
volume = setup_volume ();
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -142,7 +143,8 @@ GST_START_TEST (test_half)
volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 0.5, NULL);
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -181,7 +183,8 @@ GST_START_TEST (test_double)
volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 2.0, NULL);
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps)
bus = gst_bus_new ();
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);

View file

@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header)
vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30);
@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header)
bus = gst_bus_new ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header)
vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30);

View file

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

View file

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

View file

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

View file

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

View file

@ -59,7 +59,8 @@ main (gint argc, gchar * argv[])
dec_sink = gst_element_get_pad (decoder, "sink");
enc_src = gst_element_get_pad (encoder, "src");
if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) {
if (gst_element_set_state (pipeline,
GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) {
g_print ("pipeline doesn't want to play\n");
return -1;
}

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

View file

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

View file

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

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

View file

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

View file

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

View file

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

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

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

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

View file

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

View file

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

View file

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

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

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

View file

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

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

View file

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

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@ main (gint argc, gchar * argv[])
GstElement *decoder;
GstElement *source;
GstElement *pipeline;
GstElementStateReturn res;
GstStateChangeReturn res;
gst_init (&argc, &argv);
@ -43,7 +43,7 @@ main (gint argc, gchar * argv[])
gst_element_link_pads (source, "src", decoder, "sink");
res = gst_element_set_state (pipeline, GST_STATE_PLAYING);
if (res != GST_STATE_SUCCESS) {
if (res != GST_STATE_CHANGE_SUCCESS) {
g_print ("could not play\n");
return -1;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -143,7 +143,8 @@ verify_convert (GstElement * audioconvert, void *in, int inlength, void *out,
GstBuffer *inbuffer, *outbuffer;
fail_unless (gst_element_set_state (audioconvert,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
GST_DEBUG ("Creating buffer of %d bytes", inlength);
inbuffer = gst_buffer_new_and_alloc (inlength);

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_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) {

View file

@ -109,7 +109,8 @@ GST_START_TEST (test_unity)
volume = setup_volume ();
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -142,7 +143,8 @@ GST_START_TEST (test_half)
volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 0.5, NULL);
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -181,7 +183,8 @@ GST_START_TEST (test_double)
volume = setup_volume ();
g_object_set (G_OBJECT (volume), "volume", 2.0, NULL);
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);
@ -221,7 +224,8 @@ GST_START_TEST (test_wrong_caps)
bus = gst_bus_new ();
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (4);
memcpy (GST_BUFFER_DATA (inbuffer), in, 4);

View file

@ -97,7 +97,8 @@ GST_START_TEST (test_wrong_channels_identification_header)
vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30);
@ -139,7 +140,8 @@ GST_START_TEST (test_empty_identification_header)
bus = gst_bus_new ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -175,7 +177,8 @@ GST_START_TEST (test_identification_header)
vorbisdec = setup_vorbisdec ();
fail_unless (gst_element_set_state (vorbisdec,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
bus = gst_bus_new ();
inbuffer = gst_buffer_new_and_alloc (30);

View file

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

View file

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

View file

@ -59,7 +59,8 @@ main (gint argc, gchar * argv[])
dec_sink = gst_element_get_pad (decoder, "sink");
enc_src = gst_element_get_pad (encoder, "src");
if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) {
if (gst_element_set_state (pipeline,
GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) {
g_print ("pipeline doesn't want to play\n");
return -1;
}

View file

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

View file

@ -22,9 +22,9 @@
GstElement *pipeline;
static void
set_state (GstElementState state)
set_state (GstState state)
{
GstElementState old_state = gst_element_get_state (pipeline);
GstState old_state = gst_element_get_state (pipeline);
g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state),

View file

@ -23,9 +23,9 @@
GstElement *pipeline;
static void
set_state (GstElementState state)
set_state (GstState state)
{
GstElementState old_state = gst_element_get_state (pipeline);
GstState old_state = gst_element_get_state (pipeline);
g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state),

View file

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

View file

@ -22,9 +22,9 @@
GstElement *pipeline;
static void
set_state (GstElementState state)
set_state (GstState state)
{
GstElementState old_state = gst_element_get_state (pipeline);
GstState old_state = gst_element_get_state (pipeline);
g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state),

View file

@ -23,9 +23,9 @@
GstElement *pipeline;
static void
set_state (GstElementState state)
set_state (GstState state)
{
GstElementState old_state = gst_element_get_state (pipeline);
GstState old_state = gst_element_get_state (pipeline);
g_print ("Setting state from %s to %s...",
gst_element_state_get_name (old_state),