From 93e9ac34a1058caab1ef680071874d620a10d132 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 13 Jan 2002 22:27:25 +0000 Subject: 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... --- gst/smooth/gstsmooth.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'gst/smooth') 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; -- cgit v1.2.1