summaryrefslogtreecommitdiffstats
path: root/gst/goom
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2003-03-04 21:46:59 +0000
committerWim Taymans <wim.taymans@gmail.com>2003-03-04 21:46:59 +0000
commit2ce9feebb71583f0fd0a6cc8311b1311c537818a (patch)
treeae7457b5335546166b03435d46f36b789cd5af15 /gst/goom
parent83fc370be37904e8fc6b4c60980f70c4112f0642 (diff)
Added state change function to clear some state in READY
Original commit message from CVS: Added state change function to clear some state in READY
Diffstat (limited to 'gst/goom')
-rw-r--r--gst/goom/gstgoom.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c
index ce12d044..8af75570 100644
--- a/gst/goom/gstgoom.c
+++ b/gst/goom/gstgoom.c
@@ -123,6 +123,9 @@ GST_PAD_TEMPLATE_FACTORY (sink_template,
static void gst_goom_class_init (GstGOOMClass *klass);
static void gst_goom_init (GstGOOM *goom);
+static GstElementStateReturn
+ gst_goom_change_state (GstElement *element);
+
static void gst_goom_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gst_goom_get_property (GObject *object, guint prop_id,
@@ -180,6 +183,8 @@ gst_goom_class_init(GstGOOMClass *klass)
gobject_class->set_property = gst_goom_set_property;
gobject_class->get_property = gst_goom_get_property;
+
+ gstelement_class->change_state = gst_goom_change_state;
}
static void
@@ -196,15 +201,9 @@ gst_goom_init (GstGOOM *goom)
gst_pad_set_chain_function (goom->sinkpad, gst_goom_chain);
gst_pad_set_link_function (goom->sinkpad, gst_goom_sinkconnect);
- goom->next_time = 0;
- goom->peerpool = NULL;
-
- /* reset the initial video state */
- goom->first_buffer = TRUE;
goom->width = 320;
goom->height = 200;
goom->fps = 25; /* desired frame rate */
-
}
static GstPadLinkReturn
@@ -292,6 +291,34 @@ gst_goom_chain (GstPad *pad, GstBuffer *bufin)
}
+static GstElementStateReturn
+gst_goom_change_state (GstElement *element)
+{
+ GstGOOM *goom = GST_GOOM (element);
+
+ switch (GST_STATE_TRANSITION (element)) {
+ case GST_STATE_NULL_TO_READY:
+ break;
+ case GST_STATE_READY_TO_NULL:
+ break;
+ case GST_STATE_READY_TO_PAUSED:
+ goom->next_time = 0;
+ goom->peerpool = NULL;
+ /* reset the initial video state */
+ goom->first_buffer = TRUE;
+ break;
+ case GST_STATE_PAUSED_TO_READY:
+ break;
+ default:
+ break;
+ }
+
+ if (GST_ELEMENT_CLASS (parent_class)->change_state)
+ return GST_ELEMENT_CLASS (parent_class)->change_state (element);
+
+ return GST_STATE_SUCCESS;
+}
+
static void
gst_goom_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{