diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-06-30 16:24:37 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-06-30 16:24:37 +0000 |
commit | 5593dfebe35ef9532e0dd6acab63d3a7b392419c (patch) | |
tree | adc5e80ab0a2f65039125e144aa91a905619bc39 /gst-plugin | |
parent | a8f4fd9737d14826302124fbf2b0d9f96a8c3541 (diff) |
Fix for GStreamer 0.9.
Original commit message from CVS:
* configure.ac:
* src/gstplugin.c: (gst_plugin_template_set_caps),
(gst_plugin_template_init), (gst_plugin_template_chain):
Fix for GStreamer 0.9.
Diffstat (limited to 'gst-plugin')
-rw-r--r-- | gst-plugin/ChangeLog | 7 | ||||
-rw-r--r-- | gst-plugin/configure.ac | 7 | ||||
-rw-r--r-- | gst-plugin/src/gstplugin.c | 30 |
3 files changed, 20 insertions, 24 deletions
diff --git a/gst-plugin/ChangeLog b/gst-plugin/ChangeLog index 9b34696..cb4f8ec 100644 --- a/gst-plugin/ChangeLog +++ b/gst-plugin/ChangeLog @@ -1,3 +1,10 @@ +2005-06-30 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + + * configure.ac: + * src/gstplugin.c: (gst_plugin_template_set_caps), + (gst_plugin_template_init), (gst_plugin_template_chain): + Fix for GStreamer 0.9. + 2004-04-22 Thomas Vander Stichele <thomas at apestaart dot org> * Makefile.am: diff --git a/gst-plugin/configure.ac b/gst-plugin/configure.ac index 177846d..19b826f 100644 --- a/gst-plugin/configure.ac +++ b/gst-plugin/configure.ac @@ -31,12 +31,11 @@ fi dnl Now we're ready to ask for gstreamer libs and cflags dnl And we can also ask for the right version of gstreamer -GST_REQUIRED=0.8 +GST_REQUIRED=0.9 -GST_MAJORMINOR=0.8 +GST_MAJORMINOR=0.9 PKG_CHECK_MODULES(GST, \ - gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED \ - gstreamer-control-$GST_MAJORMINOR >= $GST_REQUIRED, + gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED, HAVE_GST=yes,HAVE_GST=no) dnl Give error and exit if we don't have gstreamer diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c index afc6ad3..0402716 100644 --- a/gst-plugin/src/gstplugin.c +++ b/gst-plugin/src/gstplugin.c @@ -91,27 +91,21 @@ static void gst_plugin_template_update_plugin(const GValue *value, static void gst_plugin_template_update_mute (const GValue *value, gpointer data); -static void gst_plugin_template_chain (GstPad *pad, GstData *in); +static GstFlowReturn gst_plugin_template_chain (GstPad *pad, GstBuffer *buf); static GstElementClass *parent_class = NULL; /* this function handles the link with other plug-ins */ -static GstPadLinkReturn -gst_plugin_template_link (GstPad *pad, const GstCaps *caps) +static gboolean +gst_plugin_template_set_caps (GstPad *pad, GstCaps *caps) { GstPluginTemplate *filter; GstPad *otherpad; filter = GST_PLUGIN_TEMPLATE (gst_pad_get_parent (pad)); - g_return_val_if_fail (filter != NULL, GST_PAD_LINK_REFUSED); - g_return_val_if_fail (GST_IS_PLUGIN_TEMPLATE (filter), - GST_PAD_LINK_REFUSED); - otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad); - - /* set caps on next or previous element's pad, and see what they - * think. In real cases, we would (after this step) extract - * properties from the caps such as video size or audio samplerat. */ - return gst_pad_try_set_caps (otherpad, caps); + otherpad = (pad == filter->srcpad) ? filter->sinkpad : filter->srcpad; + + return gst_pad_set_caps (pad, caps); } GType @@ -190,12 +184,11 @@ gst_plugin_template_init (GstPluginTemplate *filter) filter->sinkpad = gst_pad_new_from_template ( gst_element_class_get_pad_template (klass, "sink"), "sink"); - gst_pad_set_link_function (filter->sinkpad, gst_plugin_template_link); + gst_pad_set_setcaps_function (filter->sinkpad, gst_plugin_template_set_caps); gst_pad_set_getcaps_function (filter->sinkpad, gst_pad_proxy_getcaps); filter->srcpad = gst_pad_new_from_template ( gst_element_class_get_pad_template (klass, "src"), "src"); - gst_pad_set_link_function (filter->srcpad, gst_plugin_template_link); gst_pad_set_getcaps_function (filter->srcpad, gst_pad_proxy_getcaps); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); @@ -208,13 +201,10 @@ gst_plugin_template_init (GstPluginTemplate *filter) * this function does the actual processing */ -static void -gst_plugin_template_chain (GstPad *pad, GstData *in) +static GstFlowReturn +gst_plugin_template_chain (GstPad *pad, GstBuffer *buf) { GstPluginTemplate *filter; - GstBuffer *out_buf, *buf = GST_BUFFER (in); - gfloat *data; - gint i, num_samples; g_return_if_fail (GST_IS_PAD (pad)); g_return_if_fail (buf != NULL); @@ -226,7 +216,7 @@ gst_plugin_template_chain (GstPad *pad, GstData *in) g_print ("I'm plugged, therefore I'm in.\n"); /* just push out the incoming buffer without touching it */ - gst_pad_push (filter->srcpad, GST_DATA (buf)); + return gst_pad_push (filter->srcpad, buf); } static void |