summaryrefslogtreecommitdiffstats
path: root/ext/xine
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 /ext/xine
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 'ext/xine')
-rw-r--r--ext/xine/xine.c23
-rw-r--r--ext/xine/xineaudiodec.c28
-rw-r--r--ext/xine/xineaudiosink.c32
-rw-r--r--ext/xine/xineinput.c29
4 files changed, 59 insertions, 53 deletions
diff --git a/ext/xine/xine.c b/ext/xine/xine.c
index 68aebc28..5225f0cf 100644
--- a/ext/xine/xine.c
+++ b/ext/xine/xine.c
@@ -25,7 +25,8 @@
GST_BOILERPLATE (GstXine, gst_xine, GstElement, GST_TYPE_ELEMENT)
- static GstElementStateReturn gst_xine_change_state (GstElement * element);
+ static GstStateChangeReturn gst_xine_change_state (GstElement * element,
+ GstStateChange transition);
static xine_ao_driver_t *_xine_create_audio_driver (GstXine * xine);
static xine_vo_driver_t *_xine_create_video_driver (GstXine * xine);
@@ -54,23 +55,23 @@ gst_xine_init (GstXine * filter, GstXineClass * g_class)
{
}
-static GstElementStateReturn
-gst_xine_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_xine_change_state (GstElement * element, GstStateChange transition)
{
GstXine *xine = GST_XINE (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:
if (xine->stream != NULL)
gst_xine_free_stream (xine);
break;
@@ -80,7 +81,7 @@ gst_xine_change_state (GstElement * element)
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
- (element), GST_STATE_SUCCESS);
+ (element), GST_STATE_CHANGE_SUCCESS);
}
static xine_ao_driver_t *
diff --git a/ext/xine/xineaudiodec.c b/ext/xine/xineaudiodec.c
index ce985086..77200e02 100644
--- a/ext/xine/xineaudiodec.c
+++ b/ext/xine/xineaudiodec.c
@@ -233,8 +233,9 @@ _gst_xine_audio_dec_create_audio_driver (GstXine * xine)
GST_BOILERPLATE (GstXineAudioDec, gst_xine_audio_dec, GstXine, GST_TYPE_XINE)
static void gst_xine_audio_dec_chain (GstPad * pad, GstData * in);
- static GstElementStateReturn
- gst_xine_audio_dec_change_state (GstElement * element);
+ static GstStateChangeReturn
+ gst_xine_audio_dec_change_state (GstElement * element,
+ GstStateChange transition);
/* this function handles the link with other plug-ins */
static GstPadLinkReturn
@@ -401,26 +402,27 @@ _load_decoder (GstXineAudioDec * dec)
return ret;
}
-static GstElementStateReturn
-gst_xine_audio_dec_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_xine_audio_dec_change_state (GstElement * element,
+ GstStateChange transition)
{
GstXineAudioDec *xine = GST_XINE_AUDIO_DEC (element);
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
xine->decoder = _load_decoder (xine);
if (!xine->decoder)
- 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:
xine->setup = FALSE;
_x_free_audio_decoder (gst_xine_get_stream (GST_XINE (xine)),
xine->decoder);
@@ -431,7 +433,7 @@ gst_xine_audio_dec_change_state (GstElement * element)
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
- (element), GST_STATE_SUCCESS);
+ (element), GST_STATE_CHANGE_SUCCESS);
}
/** GstXineAudioDec subclasses ************************************************/
diff --git a/ext/xine/xineaudiosink.c b/ext/xine/xineaudiosink.c
index 165457b1..2073bcfb 100644
--- a/ext/xine/xineaudiosink.c
+++ b/ext/xine/xineaudiosink.c
@@ -62,8 +62,9 @@ struct _GstXineAudioSinkClass
GST_BOILERPLATE (GstXineAudioSink, gst_xine_audio_sink, GstXine, GST_TYPE_XINE)
- static GstElementStateReturn
- gst_xine_audio_sink_change_state (GstElement * element);
+ static GstStateChangeReturn
+ gst_xine_audio_sink_change_state (GstElement * element,
+ GstStateChange transition);
static void gst_xine_audio_sink_base_init (gpointer g_class)
{
@@ -94,46 +95,47 @@ gst_xine_audio_sink_chain (GstPad * pad, GstData * data)
gst_data_unref (GST_DATA (data));
}
-static GstElementStateReturn
-gst_xine_audio_sink_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_xine_audio_sink_change_state (GstElement * element,
+ GstStateChange transition)
{
GstXineAudioSink *xine = GST_XINE_AUDIO_SINK (element);
audio_driver_class_t *driver =
(audio_driver_class_t *) GST_XINE_AUDIO_SINK_GET_CLASS (xine)->
plugin_node->plugin_class;
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
if (driver == NULL) {
xine_audio_port_t *port =
xine_open_audio_driver (GST_XINE_GET_CLASS (xine)->xine,
GST_XINE_AUDIO_SINK_GET_CLASS (xine)->plugin_node->info->id, NULL);
if (!port)
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
port->exit (port);
driver =
(audio_driver_class_t *) GST_XINE_AUDIO_SINK_GET_CLASS (xine)->
plugin_node->plugin_class;
if (driver == NULL)
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
}
xine->driver = driver->open_plugin (driver, NULL);
if (!xine->driver)
- 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:
if (xine->open != 0)
xine->driver->close (xine->driver);
xine->open = 0;
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
xine->driver->exit (xine->driver);
xine->driver = NULL;
break;
@@ -143,7 +145,7 @@ gst_xine_audio_sink_change_state (GstElement * element)
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
- (element), GST_STATE_SUCCESS);
+ (element), GST_STATE_CHANGE_SUCCESS);
}
static GstCaps *
diff --git a/ext/xine/xineinput.c b/ext/xine/xineinput.c
index 705009a1..bdc84195 100644
--- a/ext/xine/xineinput.c
+++ b/ext/xine/xineinput.c
@@ -74,8 +74,9 @@ GST_BOILERPLATE (GstXineInput, gst_xine_input, GstXine, GST_TYPE_XINE)
const GValue * value, GParamSpec * pspec);
static void gst_xine_input_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
- static GstElementStateReturn
- gst_xine_input_change_state (GstElement * element);
+ static GstStateChangeReturn
+ gst_xine_input_change_state (GstElement * element,
+ GstStateChange transition);
static void gst_xine_input_base_init (gpointer g_class)
{
@@ -202,37 +203,37 @@ gst_xine_input_get (GstPad * pad)
return GST_DATA (buf);
}
-static GstElementStateReturn
-gst_xine_input_change_state (GstElement * element)
+static GstStateChangeReturn
+gst_xine_input_change_state (GstElement * element, GstStateChange transition)
{
GstXineInput *xine = GST_XINE_INPUT (element);
input_class_t *input =
(input_class_t *) GST_XINE_INPUT_GET_CLASS (xine)->plugin_node->
plugin_class;
- switch (GST_STATE_TRANSITION (element)) {
- case GST_STATE_NULL_TO_READY:
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
xine->input =
input->get_instance (input, gst_xine_get_stream (GST_XINE (xine)),
xine->location);
if (!xine->input)
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
if (xine->input->open (xine->input) == 0)
- return GST_STATE_FAILURE;
+ return GST_STATE_CHANGE_FAILURE;
xine->blocksize = xine->input->get_blocksize (xine->input);
if (xine->blocksize == 0)
xine->blocksize = BUFFER_SIZE;
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:
/* FIXME: reset stream */
break;
- case GST_STATE_READY_TO_NULL:
+ case GST_STATE_CHANGE_READY_TO_NULL:
xine->input->dispose (xine->input);
xine->input = NULL;
break;
@@ -242,7 +243,7 @@ gst_xine_input_change_state (GstElement * element)
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
- (element), GST_STATE_SUCCESS);
+ (element), GST_STATE_CHANGE_SUCCESS);
}
/** GstXineInput subclasses ************************************************/