diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2002-01-13 22:27:25 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2002-01-13 22:27:25 +0000 |
commit | 93e9ac34a1058caab1ef680071874d620a10d132 (patch) | |
tree | 4c730c821178cc2ea708454dc276a1d36b5bfe1b /gst/smooth | |
parent | e92b7beff5470ec3f1662e2413622295b37f8710 (diff) | |
download | gst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.tar.gz gst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.tar.bz2 gst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.zip |
Bring the plugins in sync with the new core capsnego system.
Original commit message from CVS:
Bring the plugins in sync with the new core capsnego system.
Added some features, enhancements...
Diffstat (limited to 'gst/smooth')
-rw-r--r-- | gst/smooth/gstsmooth.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c index 5f1f507c..ea321940 100644 --- a/gst/smooth/gstsmooth.c +++ b/gst/smooth/gstsmooth.c @@ -80,28 +80,6 @@ static void gst_smooth_get_property (GObject *object, guint prop_id, GValue *val static GstElementClass *parent_class = NULL; //static guint gst_smooth_signals[LAST_SIGNAL] = { 0 }; -static GstPadNegotiateReturn -smooth_negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data) -{ - GstSmooth* filter = GST_SMOOTH (gst_pad_get_parent (pad)); - - if (*caps==NULL) - return GST_PAD_NEGOTIATE_FAIL; - - return gst_pad_negotiate_proxy (pad, filter->sinkpad, caps); -} - -static GstPadNegotiateReturn -smooth_negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data) -{ - GstSmooth* filter = GST_SMOOTH (gst_pad_get_parent (pad)); - - if (*caps==NULL) - return GST_PAD_NEGOTIATE_FAIL; - - return gst_pad_negotiate_proxy (pad, filter->srcpad, caps); -} - GType gst_smooth_get_type (void) { @@ -149,15 +127,20 @@ gst_smooth_class_init (GstSmoothClass *klass) } -static void -gst_smooth_newcaps (GstPad *pad, GstCaps *caps) +static GstPadConnectReturn +gst_smooth_sinkconnect (GstPad *pad, GstCaps *caps) { GstSmooth *filter; filter = GST_SMOOTH (gst_pad_get_parent (pad)); + if (!GST_CAPS_IS_FIXED (caps)) + return GST_PAD_CONNECT_DELAYED; + filter->width = gst_caps_get_int (caps, "width"); filter->height = gst_caps_get_int (caps, "height"); + + return GST_PAD_CONNECT_OK; } static void @@ -165,14 +148,12 @@ gst_smooth_init (GstSmooth *smooth) { smooth->sinkpad = gst_pad_new_from_template ( GST_PADTEMPLATE_GET (smooth_sink_factory), "sink"); - gst_pad_set_negotiate_function (smooth->sinkpad, smooth_negotiate_sink); - gst_pad_set_newcaps_function (smooth->sinkpad, gst_smooth_newcaps); + gst_pad_set_connect_function (smooth->sinkpad, gst_smooth_sinkconnect); gst_pad_set_chain_function (smooth->sinkpad, gst_smooth_chain); gst_element_add_pad (GST_ELEMENT (smooth), smooth->sinkpad); smooth->srcpad = gst_pad_new_from_template ( GST_PADTEMPLATE_GET (smooth_src_factory), "src"); - gst_pad_set_negotiate_function (smooth->srcpad, smooth_negotiate_src); gst_element_add_pad (GST_ELEMENT (smooth), smooth->srcpad); smooth->active = TRUE; |