summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-09-05 17:20:29 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-09-05 17:20:29 +0000
commit012dfb8b33969b582f9132ac9f95402b3098ff43 (patch)
treeacff4df23e44c9d15abab2b9877c3f72032da286 /sys
parent390621f8de27467709897c92e5fec4605d96be75 (diff)
downloadgst-plugins-bad-012dfb8b33969b582f9132ac9f95402b3098ff43.tar.gz
gst-plugins-bad-012dfb8b33969b582f9132ac9f95402b3098ff43.tar.bz2
gst-plugins-bad-012dfb8b33969b582f9132ac9f95402b3098ff43.zip
Fix up all the state change functions.
Original commit message from CVS: Fix up all the state change functions.
Diffstat (limited to 'sys')
-rw-r--r--sys/cdrom/gstcdplayer.c27
-rw-r--r--sys/dxr3/dxr3audiosink.c16
-rw-r--r--sys/dxr3/dxr3spusink.c29
-rw-r--r--sys/dxr3/dxr3videosink.c30
-rw-r--r--sys/glsink/glimagesink.c24
-rw-r--r--sys/qcam/gstqcamsrc.c19
-rw-r--r--sys/sunaudio/gstsunaudio.c26
-rw-r--r--sys/sunaudio/gstsunaudiosrc.c25
-rw-r--r--sys/sunaudio/gstsunelement.c19
-rw-r--r--sys/v4l2/gstv4l2element.c24
-rw-r--r--sys/v4l2/gstv4l2src.c39
-rw-r--r--sys/vcd/vcdsrc.c21
12 files changed, 154 insertions, 145 deletions
diff --git a/sys/cdrom/gstcdplayer.c b/sys/cdrom/gstcdplayer.c
index bf3b37b5..b67362df 100644
--- a/sys/cdrom/gstcdplayer.c
+++ b/sys/cdrom/gstcdplayer.c
@@ -52,7 +52,8 @@ static void cdplayer_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * spec);
static gboolean cdplayer_iterate (GstBin * bin);
-static GstElementStateReturn cdplayer_change_state (GstElement * element);
+static GstStateChangeReturn cdplayer_change_state (GstElement * element,
+ GstStateChange transition);
static GstElementClass *parent_class;
static guint cdplayer_signals[LAST_SIGNAL] = { 0 };
@@ -285,14 +286,14 @@ cdplayer_iterate (GstBin * bin)
}
-static GstElementStateReturn
-cdplayer_change_state (GstElement * element)
+static GstStateChangeReturn
+cdplayer_change_state (GstElement * element, GstStateChange transition)
{
CDPlayer *cdp;
- GstElementState state = GST_STATE (element);
- GstElementState pending = GST_STATE_PENDING (element);
+ GstState state = GST_STATE (element);
+ GstState pending = GST_STATE_PENDING (element);
- g_return_val_if_fail (GST_IS_CDPLAYER (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_CDPLAYER (element), GST_STATE_CHANGE_FAILURE);
cdp = CDPLAYER (element);
@@ -300,7 +301,7 @@ cdplayer_change_state (GstElement * element)
case GST_STATE_READY:
if (state != GST_STATE_PAUSED) {
if (cd_init (CDPLAYER_CD (cdp), cdp->device) == FALSE) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
cdp->num_tracks = cdp->cd.num_tracks;
cdp->cddb_discid = cd_cddb_discid (CDPLAYER_CD (cdp));
@@ -310,7 +311,7 @@ cdplayer_change_state (GstElement * element)
/* ready->paused is not useful */
if (state != GST_STATE_READY) {
if (cd_pause (CDPLAYER_CD (cdp)) == FALSE) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
cdp->paused = TRUE;
@@ -320,14 +321,14 @@ cdplayer_change_state (GstElement * element)
case GST_STATE_PLAYING:
if (cdp->paused == TRUE) {
if (cd_resume (CDPLAYER_CD (cdp)) == FALSE) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
cdp->paused = FALSE;
} else {
if (cd_start (CDPLAYER_CD (cdp), cdp->start_track,
cdp->end_track) == FALSE) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
}
@@ -336,7 +337,7 @@ cdplayer_change_state (GstElement * element)
/* stop & close fd */
if (cd_stop (CDPLAYER_CD (cdp)) == FALSE
|| cd_close (CDPLAYER_CD (cdp)) == FALSE) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
break;
@@ -345,10 +346,10 @@ cdplayer_change_state (GstElement * element)
}
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
- GST_ELEMENT_CLASS (parent_class)->change_state (element);
+ GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
}
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
diff --git a/sys/dxr3/dxr3audiosink.c b/sys/dxr3/dxr3audiosink.c
index 144e50c1..2e7026f9 100644
--- a/sys/dxr3/dxr3audiosink.c
+++ b/sys/dxr3/dxr3audiosink.c
@@ -118,7 +118,8 @@ static void dxr3audiosink_chain_ac3 (GstPad * pad, GstData * buf);
/* static int dxr3audiosink_mvcommand (Dxr3AudioSink *sink, */
/* int command); */
-static GstElementStateReturn dxr3audiosink_change_state (GstElement * element);
+static GstStateChangeReturn dxr3audiosink_change_state (GstElement * element,
+ GstStateChange transition);
static void dxr3audiosink_flushed (Dxr3AudioSink * sink);
@@ -701,10 +702,11 @@ dxr3audiosink_mvcommand (Dxr3AudioSink * sink, int command)
}
#endif
-static GstElementStateReturn
-dxr3audiosink_change_state (GstElement * element)
+static GstStateChangeReturn
+dxr3audiosink_change_state (GstElement * element, GstStateChange transition)
{
- g_return_val_if_fail (GST_IS_DXR3AUDIOSINK (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_DXR3AUDIOSINK (element),
+ GST_STATE_CHANGE_FAILURE);
if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET (element, DXR3AUDIOSINK_OPEN)) {
@@ -713,16 +715,16 @@ dxr3audiosink_change_state (GstElement * element)
} else {
if (!GST_FLAG_IS_SET (element, DXR3AUDIOSINK_OPEN)) {
if (!dxr3audiosink_open (DXR3AUDIOSINK (element))) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
}
}
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
- return GST_ELEMENT_CLASS (parent_class)->change_state (element);
+ return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
}
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
diff --git a/sys/dxr3/dxr3spusink.c b/sys/dxr3/dxr3spusink.c
index 023631d2..badc2e41 100644
--- a/sys/dxr3/dxr3spusink.c
+++ b/sys/dxr3/dxr3spusink.c
@@ -87,7 +87,8 @@ static void dxr3spusink_set_clock (GstElement * element, GstClock * clock);
static gboolean dxr3spusink_handle_event (GstPad * pad, GstEvent * event);
static void dxr3spusink_chain (GstPad * pad, GstData * _data);
-static GstElementStateReturn dxr3spusink_change_state (GstElement * element);
+static GstStateChangeReturn dxr3spusink_change_state (GstElement * element,
+ GstStateChange transition);
/* static void dxr3spusink_wait (Dxr3SpuSink *sink, */
/* GstClockTime time); */
@@ -397,28 +398,28 @@ dxr3spusink_chain (GstPad * pad, GstData * _data)
}
-static GstElementStateReturn
-dxr3spusink_change_state (GstElement * element)
+static GstStateChangeReturn
+dxr3spusink_change_state (GstElement * element, GstStateChange transition)
{
- g_return_val_if_fail (GST_IS_DXR3SPUSINK (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_DXR3SPUSINK (element), GST_STATE_CHANGE_FAILURE);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!GST_FLAG_IS_SET (element, DXR3SPUSINK_OPEN)) {
if (!dxr3spusink_open (DXR3SPUSINK (element))) {
- 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;
- 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:
if (GST_FLAG_IS_SET (element, DXR3SPUSINK_OPEN)) {
dxr3spusink_close (DXR3SPUSINK (element));
}
@@ -426,10 +427,10 @@ dxr3spusink_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;
}
#if 0
diff --git a/sys/dxr3/dxr3videosink.c b/sys/dxr3/dxr3videosink.c
index 37e28192..c2222e85 100644
--- a/sys/dxr3/dxr3videosink.c
+++ b/sys/dxr3/dxr3videosink.c
@@ -117,7 +117,8 @@ static void dxr3videosink_parse_data (Dxr3VideoSink * sink);
static gboolean dxr3videosink_handle_event (GstPad * pad, GstEvent * event);
static void dxr3videosink_chain (GstPad * pad, GstData * _data);
-static GstElementStateReturn dxr3videosink_change_state (GstElement * element);
+static GstStateChangeReturn dxr3videosink_change_state (GstElement * element,
+ GstStateChange transition);
/* static void dxr3videosink_wait (Dxr3VideoSink *sink, */
/* GstClockTime time); */
@@ -633,32 +634,33 @@ dxr3videosink_chain (GstPad * pad, GstData * _data)
}
-static GstElementStateReturn
-dxr3videosink_change_state (GstElement * element)
+static GstStateChangeReturn
+dxr3videosink_change_state (GstElement * element, GstStateChange transition)
{
- g_return_val_if_fail (GST_IS_DXR3VIDEOSINK (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_DXR3VIDEOSINK (element),
+ GST_STATE_CHANGE_FAILURE);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!GST_FLAG_IS_SET (element, DXR3VIDEOSINK_OPEN)) {
if (!dxr3videosink_open (DXR3VIDEOSINK (element))) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
}
break;
- case GST_STATE_READY_TO_PAUSED:
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
dxr3videosink_mvcommand (DXR3VIDEOSINK (element), MVCOMMAND_PAUSE);
break;
- case GST_STATE_PAUSED_TO_PLAYING:
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
dxr3videosink_mvcommand (DXR3VIDEOSINK (element), MVCOMMAND_START);
break;
- case GST_STATE_PLAYING_TO_PAUSED:
+ case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
dxr3videosink_mvcommand (DXR3VIDEOSINK (element), MVCOMMAND_PAUSE);
break;
- case GST_STATE_PAUSED_TO_READY:
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
dxr3videosink_mvcommand (DXR3VIDEOSINK (element), MVCOMMAND_STOP);
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
if (GST_FLAG_IS_SET (element, DXR3VIDEOSINK_OPEN)) {
dxr3videosink_close (DXR3VIDEOSINK (element));
}
@@ -666,10 +668,10 @@ dxr3videosink_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;
}
#if 0
diff --git a/sys/glsink/glimagesink.c b/sys/glsink/glimagesink.c
index e94bf1ae..01018b5e 100644
--- a/sys/glsink/glimagesink.c
+++ b/sys/glsink/glimagesink.c
@@ -935,8 +935,8 @@ gst_glimagesink_sink_link (GstPad * pad, const GstCaps * caps)
return GST_PAD_LINK_OK;
}
-static GstElementStateReturn
-gst_glimagesink_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_glimagesink_change_state (GstElement * element, GstStateChange transition)
{
GstGLImageSink *glimagesink;
@@ -944,32 +944,32 @@ gst_glimagesink_change_state (GstElement * element)
glimagesink = GST_GLIMAGESINK (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 (!glimagesink->xcontext) {
glimagesink->xcontext = gst_glimagesink_xcontext_get (glimagesink);
if (!glimagesink->xcontext)
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
printf ("null to ready done\n");
break;
- case GST_STATE_READY_TO_PAUSED:
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
printf ("ready to paused\n");
//if (glimagesink->window) // not needed with OpenGL
// gst_glimagesink_xwindow_clear (glimagesink, glimagesink->window);
glimagesink->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:
glimagesink->framerate = 0;
GST_VIDEOSINK_WIDTH (glimagesink) = 0;
GST_VIDEOSINK_HEIGHT (glimagesink) = 0;
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
if (glimagesink->glimage) {
gst_glimagesink_ximage_destroy (glimagesink, glimagesink->glimage);
glimagesink->glimage = NULL;
@@ -991,9 +991,9 @@ gst_glimagesink_change_state (GstElement * element)
}
if (GST_ELEMENT_CLASS (parent_class)->change_state)
- return GST_ELEMENT_CLASS (parent_class)->change_state (element);
+ return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
static void
diff --git a/sys/qcam/gstqcamsrc.c b/sys/qcam/gstqcamsrc.c
index 2fab71d9..e34a589e 100644
--- a/sys/qcam/gstqcamsrc.c
+++ b/sys/qcam/gstqcamsrc.c
@@ -113,7 +113,8 @@ static void gst_qcamsrc_set_property (GObject * object, guint prop_id,
static void gst_qcamsrc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_qcamsrc_change_state (GstElement * element);
+static GstStateChangeReturn gst_qcamsrc_change_state (GstElement * element,
+ GstStateChange transition);
static void gst_qcamsrc_close (GstQCamSrc * src);
static gboolean gst_qcamsrc_open (GstQCamSrc * src);
@@ -381,22 +382,22 @@ gst_qcamsrc_get_property (GObject * object, guint prop_id, GValue * value,
}
}
-static GstElementStateReturn
-gst_qcamsrc_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_qcamsrc_change_state (GstElement * element, GstStateChange transition)
{
g_return_val_if_fail (GST_IS_QCAMSRC (element), FALSE);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_READY_TO_NULL:
+ switch (transition) {
+ case GST_STATE_CHANGE_READY_TO_NULL:
if (GST_FLAG_IS_SET (element, GST_QCAMSRC_OPEN))
gst_qcamsrc_close (GST_QCAMSRC (element));
break;
- case GST_STATE_NULL_TO_READY:
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!GST_FLAG_IS_SET (element, GST_QCAMSRC_OPEN)) {
GST_DEBUG ("opening");
if (!gst_qcamsrc_open (GST_QCAMSRC (element))) {
GST_DEBUG ("open failed");
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
}
break;
@@ -405,9 +406,9 @@ gst_qcamsrc_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 gboolean
diff --git a/sys/sunaudio/gstsunaudio.c b/sys/sunaudio/gstsunaudio.c
index 432fc635..945d797d 100644
--- a/sys/sunaudio/gstsunaudio.c
+++ b/sys/sunaudio/gstsunaudio.c
@@ -120,7 +120,7 @@ static void gst_sunaudiosink_get_property (GObject * object, guint prop_id,
static gboolean gst_sunaudiosink_setparams (GstSunAudioSink * sunaudiosink);
static void gst_sunaudiosink_chain (GstPad * pad, GstData * _data);
-static GstElementStateReturn gst_sunaudiosink_change_state (GstElement *
+static GstStateChangeReturn gst_sunaudiosink_change_state (GstElement *
element);
static GstElementClass *parent_class = NULL;
@@ -357,34 +357,34 @@ gst_sunaudiosink_close (GstSunAudioSink * sunaudiosink)
close (sunaudiosink->fd);
}
-static GstElementStateReturn
-gst_sunaudiosink_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_sunaudiosink_change_state (GstElement * element, GstStateChange transition)
{
GstSunAudioSink *sunaudiosink = GST_SUNAUDIOSINK (element);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_sunaudiosink_open (sunaudiosink)) {
- 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;
- 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_sunaudiosink_close (sunaudiosink);
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;
}
static void
diff --git a/sys/sunaudio/gstsunaudiosrc.c b/sys/sunaudio/gstsunaudiosrc.c
index ff9e236d..6a54d2dc 100644
--- a/sys/sunaudio/gstsunaudiosrc.c
+++ b/sys/sunaudio/gstsunaudiosrc.c
@@ -67,8 +67,7 @@ static void gst_sunaudiosrc_set_property (GObject * object, guint prop_id,
static void gst_sunaudiosrc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_sunaudiosrc_change_state (GstElement *
- element);
+static GstStateChangeReturn gst_sunaudiosrc_change_state (GstElement * element);
static gboolean gst_sunaudiosrc_setparams (GstSunAudioSrc * sunaudiosrc);
static GstData *gst_sunaudiosrc_get (GstPad * pad);
@@ -210,30 +209,30 @@ gst_sunaudiosrc_get_property (GObject * object, guint prop_id,
}
}
-static GstElementStateReturn
-gst_sunaudiosrc_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_sunaudiosrc_change_state (GstElement * element, GstStateChange transition)
{
GstSunAudioSrc *sunaudiosrc = GST_SUNAUDIOSRC (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:
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:
break;
}
if (GST_ELEMENT_CLASS (parent_class)->change_state)
- return GST_ELEMENT_CLASS (parent_class)->change_state (element);
+ return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
diff --git a/sys/sunaudio/gstsunelement.c b/sys/sunaudio/gstsunelement.c
index 64184041..fbbd3e8e 100644
--- a/sys/sunaudio/gstsunelement.c
+++ b/sys/sunaudio/gstsunelement.c
@@ -65,7 +65,7 @@ static void gst_sunaudioelement_set_property (GObject * object,
static void gst_sunaudioelement_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_sunaudioelement_change_state (GstElement *
+static GstStateChangeReturn gst_sunaudioelement_change_state (GstElement *
element);
static GstElementClass *parent_class = NULL;
@@ -417,19 +417,20 @@ gst_sunaudioelement_dispose (GObject * object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
-static GstElementStateReturn
-gst_sunaudioelement_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_sunaudioelement_change_state (GstElement * element,
+ GstStateChange transition)
{
GstSunAudioElement *sunaudio = GST_SUNAUDIOELEMENT (element);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_sunaudioelement_open_audio (sunaudio)) {
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
GST_INFO ("opened sound device");
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
gst_sunaudioelement_close_audio (sunaudio);
gst_sunaudioelement_reset (sunaudio);
GST_INFO ("closed sound device");
@@ -439,9 +440,9 @@ gst_sunaudioelement_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 gboolean
diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c
index 18c0abd9..139378b3 100644
--- a/sys/v4l2/gstv4l2element.c
+++ b/sys/v4l2/gstv4l2element.c
@@ -72,8 +72,8 @@ static void gst_v4l2element_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_v4l2element_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static GstElementStateReturn
-gst_v4l2element_change_state (GstElement * element);
+static GstStateChangeReturn
+gst_v4l2element_change_state (GstElement * element, GstStateChange transition);
static GstElementClass *parent_class = NULL;
@@ -562,22 +562,22 @@ gst_v4l2element_get_property (GObject * object,
}
-static GstElementStateReturn
-gst_v4l2element_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_v4l2element_change_state (GstElement * element, GstStateChange transition)
{
GstV4l2Element *v4l2element;
- g_return_val_if_fail (GST_IS_V4L2ELEMENT (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_V4L2ELEMENT (element), GST_STATE_CHANGE_FAILURE);
v4l2element = GST_V4L2ELEMENT (element);
/* if going down into NULL state, close the device if it's open
* if going to READY, open the device (and set some options)
*/
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_v4l2_open (v4l2element))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
#ifdef HAVE_XVIDEO
gst_v4l2_xoverlay_open (v4l2element);
@@ -587,13 +587,13 @@ gst_v4l2element_change_state (GstElement * element)
g_signal_emit (G_OBJECT (v4l2element),
gst_v4l2element_signals[SIGNAL_OPEN], 0, v4l2element->device);
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
#ifdef HAVE_XVIDEO
gst_v4l2_xoverlay_close (v4l2element);
#endif
if (!gst_v4l2_close (v4l2element))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
/* emit yet another signal! wheehee! */
g_signal_emit (G_OBJECT (v4l2element),
@@ -602,7 +602,7 @@ gst_v4l2element_change_state (GstElement * element)
}
if (GST_ELEMENT_CLASS (parent_class)->change_state)
- return GST_ELEMENT_CLASS (parent_class)->change_state (element);
+ return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 45b60bde..b273781d 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -123,7 +123,8 @@ static void gst_v4l2src_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
/* state handling */
-static GstElementStateReturn gst_v4l2src_change_state (GstElement * element);
+static GstStateChangeReturn gst_v4l2src_change_state (GstElement * element,
+ GstStateChange transition);
/* set_clock function for A/V sync */
static void gst_v4l2src_set_clock (GstElement * element, GstClock * clock);
@@ -1014,63 +1015,63 @@ gst_v4l2src_get_property (GObject * object,
}
-static GstElementStateReturn
-gst_v4l2src_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_v4l2src_change_state (GstElement * element, GstStateChange transition)
{
GstV4l2Src *v4l2src;
- gint transition = GST_STATE_TRANSITION (element);
- GstElementStateReturn parent_return;
+ GstStateChangeReturn parent_return;
GTimeVal time;
- g_return_val_if_fail (GST_IS_V4L2SRC (element), GST_STATE_FAILURE);
+ g_return_val_if_fail (GST_IS_V4L2SRC (element), GST_STATE_CHANGE_FAILURE);
v4l2src = GST_V4L2SRC (element);
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
- parent_return = GST_ELEMENT_CLASS (parent_class)->change_state (element);
- if (parent_return != GST_STATE_SUCCESS)
+ parent_return =
+ GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+ if (parent_return != GST_STATE_CHANGE_SUCCESS)
return parent_return;
}
switch (transition) {
- case GST_STATE_NULL_TO_READY:
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_v4l2src_get_capture (v4l2src))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
break;
- case GST_STATE_READY_TO_PAUSED:
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
v4l2src->handled = 0;
v4l2src->need_writes = 0;
v4l2src->substract_time = 0;
/* buffer setup moved to capsnego */
break;
- case GST_STATE_PAUSED_TO_PLAYING:
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
/* queue all buffer, start streaming capture */
if (GST_V4L2ELEMENT (v4l2src)->buffer &&
!gst_v4l2src_capture_start (v4l2src))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
g_get_current_time (&time);
v4l2src->substract_time = GST_TIMEVAL_TO_TIME (time) -
v4l2src->substract_time;
v4l2src->last_seq = 0;
break;
- case GST_STATE_PLAYING_TO_PAUSED:
+ case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
g_get_current_time (&time);
v4l2src->substract_time = GST_TIMEVAL_TO_TIME (time) -
v4l2src->substract_time;
/* de-queue all queued buffers */
if (v4l2src->is_capturing && !gst_v4l2src_capture_stop (v4l2src))
- 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_V4L2ELEMENT (v4l2src)->buffer &&
!gst_v4l2src_capture_deinit (v4l2src))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
break;
}
- return GST_STATE_SUCCESS;
+ return GST_STATE_CHANGE_SUCCESS;
}
diff --git a/sys/vcd/vcdsrc.c b/sys/vcd/vcdsrc.c
index 60db1bc1..a6f06b88 100644
--- a/sys/vcd/vcdsrc.c
+++ b/sys/vcd/vcdsrc.c
@@ -78,7 +78,8 @@ static gboolean gst_vcdsrc_srcpad_query (GstPad * pad, GstQueryType type,
GstFormat * format, gint64 * value);
static GstData *gst_vcdsrc_get (GstPad * pad);
-static GstElementStateReturn gst_vcdsrc_change_state (GstElement * element);
+static GstStateChangeReturn gst_vcdsrc_change_state (GstElement * element,
+ GstStateChange transition);
static inline guint64 gst_vcdsrc_msf (GstVCDSrc * vcdsrc, gint track);
static void gst_vcdsrc_recalculate (GstVCDSrc * vcdsrc);
@@ -544,33 +545,33 @@ gst_vcdsrc_close_file (GstVCDSrc * src)
GST_FLAG_UNSET (src, VCDSRC_OPEN);
}
-static GstElementStateReturn
-gst_vcdsrc_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_vcdsrc_change_state (GstElement * element, GstStateChange transition)
{
GstVCDSrc *vcdsrc = GST_VCDSRC (element);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_READY_TO_NULL:
+ switch (transition) {
+ case GST_STATE_CHANGE_READY_TO_NULL:
if (GST_FLAG_IS_SET (element, VCDSRC_OPEN))
gst_vcdsrc_close_file (vcdsrc);
break;
- case GST_STATE_PAUSED_TO_READY:
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
vcdsrc->curoffset = 0;
vcdsrc->discont = vcdsrc->flush = FALSE;
break;
- case GST_STATE_NULL_TO_READY:
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (!GST_FLAG_IS_SET (element, VCDSRC_OPEN))
if (!gst_vcdsrc_open_file (vcdsrc))
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
break;
default:
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;
}
static inline guint64