Fix up all the state change functions.

Original commit message from CVS:
Fix up all the state change functions.
This commit is contained in:
Jan Schmidt 2005-09-05 17:20:29 +00:00 committed by Tim-Philipp Müller
parent 567ac42d7e
commit 473a76d221
2 changed files with 26 additions and 19 deletions

View file

@ -76,7 +76,8 @@ static GstPadTemplate *gst_jack_src_request_pad_factory ();
static GstPadTemplate *gst_jack_sink_request_pad_factory (); static GstPadTemplate *gst_jack_sink_request_pad_factory ();
static GstPad *gst_jack_request_new_pad (GstElement * element, static GstPad *gst_jack_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name); GstPadTemplate * templ, const gchar * name);
static GstElementStateReturn gst_jack_change_state (GstElement * element); static GstStateChangeReturn gst_jack_change_state (GstElement * element,
GstStateChange transition);
static GstPadLinkReturn gst_jack_link (GstPad * pad, const GstCaps * caps); static GstPadLinkReturn gst_jack_link (GstPad * pad, const GstCaps * caps);
static void gst_jack_loop (GstElement * element); static void gst_jack_loop (GstElement * element);
@ -360,8 +361,8 @@ gst_jack_request_new_pad (GstElement * element, GstPadTemplate * templ,
return pad->pad; return pad->pad;
} }
static GstElementStateReturn static GstStateChangeReturn
gst_jack_change_state (GstElement * element) gst_jack_change_state (GstElement * element, GstStateChange transition)
{ {
GstJack *this; GstJack *this;
GList *l = NULL, **pads; GList *l = NULL, **pads;
@ -386,7 +387,7 @@ gst_jack_change_state (GstElement * element)
this->bin = NULL; this->bin = NULL;
g_warning ("jack element %s needs to be contained in a jack bin.", g_warning ("jack element %s needs to be contained in a jack bin.",
GST_OBJECT_NAME (element)); GST_OBJECT_NAME (element));
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
/* fixme: verify that all names are unique */ /* fixme: verify that all names are unique */
@ -417,7 +418,7 @@ gst_jack_change_state (GstElement * element)
"rate", G_TYPE_INT, (int) this->bin->rate, "rate", G_TYPE_INT, (int) this->bin->rate,
"buffer-frames", G_TYPE_INT, (gint) this->bin->nframes, NULL); "buffer-frames", G_TYPE_INT, (gint) this->bin->nframes, NULL);
if (gst_pad_try_set_caps (pad->pad, caps) <= 0) if (gst_pad_try_set_caps (pad->pad, caps) <= 0)
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
l = g_list_next (l); l = g_list_next (l);
} }
} }
@ -430,9 +431,9 @@ gst_jack_change_state (GstElement * element)
JACK_DEBUG ("%s: state change finished", GST_OBJECT_NAME (this)); JACK_DEBUG ("%s: state change finished", GST_OBJECT_NAME (this));
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 GstPadLinkReturn static GstPadLinkReturn

View file

@ -32,7 +32,8 @@ static GstBinClass *parent_class = NULL;
static void gst_jack_bin_init (GstJackBin * this); static void gst_jack_bin_init (GstJackBin * this);
static void gst_jack_bin_class_init (GstJackBinClass * klass); static void gst_jack_bin_class_init (GstJackBinClass * klass);
static GstElementStateReturn gst_jack_bin_change_state (GstElement * element); static GstStateChangeReturn gst_jack_bin_change_state (GstElement * element,
GstStateChange transition);
/* jack callbacks */ /* jack callbacks */
static int process (jack_nframes_t nframes, void *arg); static int process (jack_nframes_t nframes, void *arg);
@ -98,8 +99,8 @@ gst_jack_bin_init (GstJackBin * this)
gst_scheduler_factory_make (NULL, GST_ELEMENT (this)); gst_scheduler_factory_make (NULL, GST_ELEMENT (this));
} }
static GstElementStateReturn static GstStateChangeReturn
gst_jack_bin_change_state (GstElement * element) gst_jack_bin_change_state (GstElement * element, GstStateChange transition)
{ {
GstJackBin *this; GstJackBin *this;
GList *l = NULL; GList *l = NULL;
@ -122,7 +123,8 @@ gst_jack_bin_change_state (GstElement * element)
_jackbin = NULL; _jackbin = NULL;
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);
break; break;
case GST_STATE_READY: case GST_STATE_READY:
@ -134,7 +136,7 @@ gst_jack_bin_change_state (GstElement * element)
if (!this->client) { if (!this->client) {
if (!(this->client = jack_client_new ("gst-jack"))) { if (!(this->client = jack_client_new ("gst-jack"))) {
g_warning ("jack server not running?"); g_warning ("jack server not running?");
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
gst_scheduler_setup (GST_ELEMENT_SCHED (this)); gst_scheduler_setup (GST_ELEMENT_SCHED (this));
@ -171,7 +173,8 @@ gst_jack_bin_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);
break; break;
case GST_STATE_PAUSED: case GST_STATE_PAUSED:
@ -216,7 +219,7 @@ gst_jack_bin_change_state (GstElement * element)
jack_port_name (pad->port))) { jack_port_name (pad->port))) {
g_warning ("jackbin: could not connect %s and %s", pad->peer_name, g_warning ("jackbin: could not connect %s and %s", pad->peer_name,
jack_port_name (pad->port)); jack_port_name (pad->port));
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
l = g_list_next (l); l = g_list_next (l);
} }
@ -229,7 +232,7 @@ gst_jack_bin_change_state (GstElement * element)
pad->peer_name)) { pad->peer_name)) {
g_warning ("jackbin: could not connect %s and %s", pad->peer_name, g_warning ("jackbin: could not connect %s and %s", pad->peer_name,
jack_port_name (pad->port)); jack_port_name (pad->port));
return GST_STATE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
l = g_list_next (l); l = g_list_next (l);
} }
@ -238,10 +241,12 @@ gst_jack_bin_change_state (GstElement * element)
GST_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN); GST_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN);
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);
} else { } else {
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);
} }
break; break;
@ -249,13 +254,14 @@ gst_jack_bin_change_state (GstElement * element)
JACK_DEBUG ("jackbin: PLAYING"); JACK_DEBUG ("jackbin: PLAYING");
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);
break; break;
} }
JACK_DEBUG ("jackbin: state change finished"); JACK_DEBUG ("jackbin: state change finished");
return GST_STATE_SUCCESS; return GST_STATE_CHANGE_SUCCESS;
} }
/* jack callbacks */ /* jack callbacks */