mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
Fix up all the state change functions.
Original commit message from CVS: Fix up all the state change functions.
This commit is contained in:
parent
567ac42d7e
commit
473a76d221
2 changed files with 26 additions and 19 deletions
|
@ -76,7 +76,8 @@ static GstPadTemplate *gst_jack_src_request_pad_factory ();
|
|||
static GstPadTemplate *gst_jack_sink_request_pad_factory ();
|
||||
static GstPad *gst_jack_request_new_pad (GstElement * element,
|
||||
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 void gst_jack_loop (GstElement * element);
|
||||
|
@ -360,8 +361,8 @@ gst_jack_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
|||
return pad->pad;
|
||||
}
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_jack_change_state (GstElement * element)
|
||||
static GstStateChangeReturn
|
||||
gst_jack_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstJack *this;
|
||||
GList *l = NULL, **pads;
|
||||
|
@ -386,7 +387,7 @@ gst_jack_change_state (GstElement * element)
|
|||
this->bin = NULL;
|
||||
g_warning ("jack element %s needs to be contained in a jack bin.",
|
||||
GST_OBJECT_NAME (element));
|
||||
return GST_STATE_FAILURE;
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
|
||||
/* 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,
|
||||
"buffer-frames", G_TYPE_INT, (gint) this->bin->nframes, NULL);
|
||||
if (gst_pad_try_set_caps (pad->pad, caps) <= 0)
|
||||
return GST_STATE_FAILURE;
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
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));
|
||||
|
||||
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
|
||||
|
|
|
@ -32,7 +32,8 @@ static GstBinClass *parent_class = NULL;
|
|||
static void gst_jack_bin_init (GstJackBin * this);
|
||||
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 */
|
||||
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));
|
||||
}
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_jack_bin_change_state (GstElement * element)
|
||||
static GstStateChangeReturn
|
||||
gst_jack_bin_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstJackBin *this;
|
||||
GList *l = NULL;
|
||||
|
@ -122,7 +123,8 @@ gst_jack_bin_change_state (GstElement * element)
|
|||
_jackbin = NULL;
|
||||
|
||||
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;
|
||||
|
||||
case GST_STATE_READY:
|
||||
|
@ -134,7 +136,7 @@ gst_jack_bin_change_state (GstElement * element)
|
|||
if (!this->client) {
|
||||
if (!(this->client = jack_client_new ("gst-jack"))) {
|
||||
g_warning ("jack server not running?");
|
||||
return GST_STATE_FAILURE;
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
|
||||
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)
|
||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
||||
transition);
|
||||
break;
|
||||
|
||||
case GST_STATE_PAUSED:
|
||||
|
@ -216,7 +219,7 @@ gst_jack_bin_change_state (GstElement * element)
|
|||
jack_port_name (pad->port))) {
|
||||
g_warning ("jackbin: could not connect %s and %s", pad->peer_name,
|
||||
jack_port_name (pad->port));
|
||||
return GST_STATE_FAILURE;
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
l = g_list_next (l);
|
||||
}
|
||||
|
@ -229,7 +232,7 @@ gst_jack_bin_change_state (GstElement * element)
|
|||
pad->peer_name)) {
|
||||
g_warning ("jackbin: could not connect %s and %s", pad->peer_name,
|
||||
jack_port_name (pad->port));
|
||||
return GST_STATE_FAILURE;
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
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);
|
||||
|
||||
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 {
|
||||
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;
|
||||
|
@ -249,13 +254,14 @@ gst_jack_bin_change_state (GstElement * element)
|
|||
JACK_DEBUG ("jackbin: PLAYING");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
JACK_DEBUG ("jackbin: state change finished");
|
||||
|
||||
return GST_STATE_SUCCESS;
|
||||
return GST_STATE_CHANGE_SUCCESS;
|
||||
}
|
||||
|
||||
/* jack callbacks */
|
||||
|
|
Loading…
Reference in a new issue