From 9cc325828029d5d746c1d13a0ea729900a7d3ef4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 Jun 2005 10:03:23 +0000 Subject: gst/: Bufferalloc changes. Original commit message from CVS: * gst/effectv/gstquark.c: (gst_quarktv_chain): * gst/goom/gstgoom.c: (gst_goom_chain): * gst/videobox/Makefile.am: * gst/videobox/gstvideobox.c: (gst_video_box_class_init), (gst_video_box_init), (gst_video_box_sink_setcaps), (gst_video_box_chain): * gst/videofilter/gstvideofilter.c: (gst_videofilter_chain): * gst/videorate/gstvideorate.c: (gst_videorate_class_init), (gst_videorate_getcaps), (gst_videorate_setcaps), (gst_videorate_init), (gst_videorate_event), (gst_videorate_chain), (gst_videorate_change_state): Bufferalloc changes. --- gst/effectv/gstquark.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gst/effectv') diff --git a/gst/effectv/gstquark.c b/gst/effectv/gstquark.c index fa15e8ad..e5df61be 100644 --- a/gst/effectv/gstquark.c +++ b/gst/effectv/gstquark.c @@ -237,6 +237,7 @@ gst_quarktv_chain (GstPad * pad, GstBuffer * buf) guint32 *src, *dest; GstBuffer *outbuf; gint area; + GstFlowReturn ret; filter = GST_QUARKTV (gst_pad_get_parent (pad)); @@ -244,7 +245,12 @@ gst_quarktv_chain (GstPad * pad, GstBuffer * buf) area = filter->area; - outbuf = gst_pad_alloc_buffer (filter->srcpad, 0, area, GST_PAD_CAPS (pad)); + ret = + gst_pad_alloc_buffer (filter->srcpad, 0, area, GST_PAD_CAPS (pad), + &outbuf); + if (ret != GST_FLOW_OK) + goto no_buffer; + dest = (guint32 *) GST_BUFFER_DATA (outbuf); GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); @@ -264,14 +270,18 @@ gst_quarktv_chain (GstPad * pad, GstBuffer * buf) dest[area] = (rand ? ((guint32 *) GST_BUFFER_DATA (rand))[area] : 0); } - gst_pad_push (filter->srcpad, outbuf); + ret = gst_pad_push (filter->srcpad, outbuf); filter->current_plane--; - if (filter->current_plane < 0) filter->current_plane = filter->planes - 1; - return GST_FLOW_OK; + return ret; + +no_buffer: + { + return ret; + } } static GstElementStateReturn -- cgit