diff options
author | Christian Schaller <uraeus@gnome.org> | 2005-05-06 11:04:30 +0000 |
---|---|---|
committer | Christian Schaller <uraeus@gnome.org> | 2005-05-06 11:04:30 +0000 |
commit | 0751f737336db408d0de424c2032b421d558dbbd (patch) | |
tree | 8c2bc5772f29b7a285e1a35eec0420c188d6668f /gst/effectv | |
parent | 08616b7531b685ab582a212ed84f0967e27a7d00 (diff) |
ported mad and effectv plugins
Original commit message from CVS:
ported mad and effectv plugins
Diffstat (limited to 'gst/effectv')
-rw-r--r-- | gst/effectv/gstaging.c | 6 | ||||
-rw-r--r-- | gst/effectv/gstdice.c | 6 | ||||
-rw-r--r-- | gst/effectv/gstquark.c | 57 | ||||
-rw-r--r-- | gst/effectv/gstrev.c | 6 | ||||
-rw-r--r-- | gst/effectv/gstvertigo.c | 6 | ||||
-rw-r--r-- | gst/effectv/gstwarp.c | 6 |
6 files changed, 36 insertions, 51 deletions
diff --git a/gst/effectv/gstaging.c b/gst/effectv/gstaging.c index e5ebed55..886517cc 100644 --- a/gst/effectv/gstaging.c +++ b/gst/effectv/gstaging.c @@ -172,15 +172,15 @@ gst_agingtv_class_init (gpointer g_class, gpointer class_data) gobject_class = G_OBJECT_CLASS (g_class); videofilter_class = GST_VIDEOFILTER_CLASS (g_class); + gobject_class->set_property = gst_agingtv_set_property; + gobject_class->get_property = gst_agingtv_get_property; + #if 0 g_object_class_install_property (gobject_class, ARG_METHOD, g_param_spec_enum ("method", "method", "method", GST_TYPE_AGINGTV_METHOD, GST_AGINGTV_METHOD_1, G_PARAM_READWRITE)); #endif - gobject_class->set_property = gst_agingtv_set_property; - gobject_class->get_property = gst_agingtv_get_property; - videofilter_class->setup = gst_agingtv_setup; } diff --git a/gst/effectv/gstdice.c b/gst/effectv/gstdice.c index 3a376eb4..75c33772 100644 --- a/gst/effectv/gstdice.c +++ b/gst/effectv/gstdice.c @@ -173,13 +173,13 @@ gst_dicetv_class_init (gpointer g_class, gpointer class_data) dicetv_class->reset = gst_dicetv_reset_handler; + gobject_class->set_property = gst_dicetv_set_property; + gobject_class->get_property = gst_dicetv_get_property; + g_object_class_install_property (gobject_class, ARG_CUBE_BITS, g_param_spec_int ("square_bits", "Square Bits", "The size of the Squares", MIN_CUBE_BITS, MAX_CUBE_BITS, DEFAULT_CUBE_BITS, G_PARAM_READWRITE)); - gobject_class->set_property = gst_dicetv_set_property; - gobject_class->get_property = gst_dicetv_get_property; - videofilter_class->setup = gst_dicetv_setup; } diff --git a/gst/effectv/gstquark.c b/gst/effectv/gstquark.c index 76d53a09..fa15e8ad 100644 --- a/gst/effectv/gstquark.c +++ b/gst/effectv/gstquark.c @@ -94,9 +94,8 @@ static void gst_quarktv_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_quarktv_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_quarktv_dispose (GObject * object); -static void gst_quarktv_chain (GstPad * pad, GstData * _data); +static GstFlowReturn gst_quarktv_chain (GstPad * pad, GstBuffer * buffer); static GstElementClass *parent_class = NULL; @@ -159,31 +158,32 @@ gst_quarktv_class_init (GstQuarkTVClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); + gobject_class->set_property = gst_quarktv_set_property; + gobject_class->get_property = gst_quarktv_get_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PLANES, g_param_spec_int ("planes", "Planes", "Number of frames in the buffer", 1, 32, PLANES, G_PARAM_READWRITE)); - gobject_class->set_property = gst_quarktv_set_property; - gobject_class->get_property = gst_quarktv_get_property; - gobject_class->dispose = gst_quarktv_dispose; - gstelement_class->change_state = gst_quarktv_change_state; } static GstPadLinkReturn -gst_quarktv_link (GstPad * pad, const GstCaps * caps) +gst_quarktv_link (GstPad * pad, GstPad * peer) { GstQuarkTV *filter; GstPad *otherpad; - gint i; - GstStructure *structure; - GstPadLinkReturn res; + + //gint i; + //GstStructure *structure; + //GstPadLinkReturn res; filter = GST_QUARKTV (gst_pad_get_parent (pad)); g_return_val_if_fail (GST_IS_QUARKTV (filter), GST_PAD_LINK_REFUSED); otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad); +#if 0 res = gst_pad_try_set_caps (otherpad, caps); if (GST_PAD_LINK_FAILED (res)) return res; @@ -200,6 +200,7 @@ gst_quarktv_link (GstPad * pad, const GstCaps * caps) gst_buffer_unref (filter->planetable[i]); filter->planetable[i] = NULL; } +#endif return GST_PAD_LINK_OK; } @@ -210,7 +211,7 @@ gst_quarktv_init (GstQuarkTV * filter) filter->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get (&gst_effectv_sink_template), "sink"); - gst_pad_set_getcaps_function (filter->sinkpad, gst_pad_proxy_getcaps); + //gst_pad_set_getcaps_function (filter->sinkpad, gst_pad_proxy_getcaps); gst_pad_set_chain_function (filter->sinkpad, gst_quarktv_chain); gst_pad_set_link_function (filter->sinkpad, gst_quarktv_link); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); @@ -218,7 +219,7 @@ gst_quarktv_init (GstQuarkTV * filter) filter->srcpad = gst_pad_new_from_template (gst_static_pad_template_get (&gst_effectv_src_template), "src"); - gst_pad_set_getcaps_function (filter->srcpad, gst_pad_proxy_getcaps); + //gst_pad_set_getcaps_function (filter->srcpad, gst_pad_proxy_getcaps); gst_pad_set_link_function (filter->srcpad, gst_quarktv_link); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); @@ -229,10 +230,9 @@ gst_quarktv_init (GstQuarkTV * filter) memset (filter->planetable, 0, filter->planes * sizeof (GstBuffer *)); } -static void -gst_quarktv_chain (GstPad * pad, GstData * _data) +static GstFlowReturn +gst_quarktv_chain (GstPad * pad, GstBuffer * buf) { - GstBuffer *buf = GST_BUFFER (_data); GstQuarkTV *filter; guint32 *src, *dest; GstBuffer *outbuf; @@ -244,9 +244,7 @@ gst_quarktv_chain (GstPad * pad, GstData * _data) area = filter->area; - outbuf = gst_buffer_new (); - GST_BUFFER_SIZE (outbuf) = area * sizeof (guint32); - GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (outbuf)); + outbuf = gst_pad_alloc_buffer (filter->srcpad, 0, area, GST_PAD_CAPS (pad)); dest = (guint32 *) GST_BUFFER_DATA (outbuf); GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); @@ -266,12 +264,14 @@ gst_quarktv_chain (GstPad * pad, GstData * _data) dest[area] = (rand ? ((guint32 *) GST_BUFFER_DATA (rand))[area] : 0); } - gst_pad_push (filter->srcpad, GST_DATA (outbuf)); + gst_pad_push (filter->srcpad, outbuf); filter->current_plane--; if (filter->current_plane < 0) filter->current_plane = filter->planes - 1; + + return GST_FLOW_OK; } static GstElementStateReturn @@ -289,6 +289,8 @@ gst_quarktv_change_state (GstElement * element) gst_buffer_unref (filter->planetable[i]); filter->planetable[i] = NULL; } + g_free (filter->planetable); + filter->planetable = NULL; break; } default: @@ -362,20 +364,3 @@ gst_quarktv_get_property (GObject * object, guint prop_id, GValue * value, break; } } - -static void -gst_quarktv_dispose (GObject * object) -{ - GstQuarkTV *filter = GST_QUARKTV (object); - gint i; - - for (i = 0; i < filter->planes; i++) { - if (filter->planetable[i]) - gst_buffer_unref (filter->planetable[i]); - filter->planetable[i] = NULL; - } - g_free (filter->planetable); - filter->planetable = NULL; - - G_OBJECT_CLASS (parent_class)->dispose (object); -} diff --git a/gst/effectv/gstrev.c b/gst/effectv/gstrev.c index c385a058..a7f5dd42 100644 --- a/gst/effectv/gstrev.c +++ b/gst/effectv/gstrev.c @@ -171,6 +171,9 @@ gst_revtv_class_init (gpointer klass, gpointer class_data) gobject_class = G_OBJECT_CLASS (klass); videofilter_class = GST_VIDEOFILTER_CLASS (klass); + gobject_class->set_property = gst_revtv_set_property; + gobject_class->get_property = gst_revtv_get_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DELAY, g_param_spec_int ("delay", "Delay", "Delay in frames between updates", 1, 100, 1, G_PARAM_READWRITE)); @@ -181,9 +184,6 @@ gst_revtv_class_init (gpointer klass, gpointer class_data) g_param_spec_int ("gain", "Gain", "Control gain", 1, 200, 50, G_PARAM_READWRITE)); - gobject_class->set_property = gst_revtv_set_property; - gobject_class->get_property = gst_revtv_get_property; - videofilter_class->setup = gst_revtv_setup; } diff --git a/gst/effectv/gstvertigo.c b/gst/effectv/gstvertigo.c index e622eb57..cc3ed947 100644 --- a/gst/effectv/gstvertigo.c +++ b/gst/effectv/gstvertigo.c @@ -169,6 +169,9 @@ gst_vertigotv_class_init (GstVertigoTVClass * klass, gpointer class_data) klass->reset = gst_vertigotv_reset_handler; + gobject_class->set_property = gst_vertigotv_set_property; + gobject_class->get_property = gst_vertigotv_get_property; + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SPEED, g_param_spec_float ("speed", "Speed", "Control the speed of movement", 0.01, 100.0, 0.02, G_PARAM_READWRITE)); @@ -176,9 +179,6 @@ gst_vertigotv_class_init (GstVertigoTVClass * klass, gpointer class_data) g_param_spec_float ("zoom_speed", "Zoom Speed", "Control the rate of zooming", 1.01, 1.1, 1.01, G_PARAM_READWRITE)); - gobject_class->set_property = gst_vertigotv_set_property; - gobject_class->get_property = gst_vertigotv_get_property; - videofilter_class->setup = gst_vertigotv_setup; } diff --git a/gst/effectv/gstwarp.c b/gst/effectv/gstwarp.c index e54e7520..00bd7d00 100644 --- a/gst/effectv/gstwarp.c +++ b/gst/effectv/gstwarp.c @@ -173,15 +173,15 @@ gst_warptv_class_init (gpointer g_class, gpointer class_data) gobject_class = G_OBJECT_CLASS (g_class); videofilter_class = GST_VIDEOFILTER_CLASS (g_class); + gobject_class->set_property = gst_warptv_set_property; + gobject_class->get_property = gst_warptv_get_property; + #if 0 g_object_class_install_property (gobject_class, ARG_METHOD, g_param_spec_enum ("method", "method", "method", GST_TYPE_WARPTV_METHOD, GST_WARPTV_METHOD_1, G_PARAM_READWRITE)); #endif - gobject_class->set_property = gst_warptv_set_property; - gobject_class->get_property = gst_warptv_get_property; - videofilter_class->setup = gst_warptv_setup; } |