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.
This commit is contained in:
Wim Taymans 2005-06-02 10:03:23 +00:00
parent 6db639089a
commit d014bb6f43

View file

@ -294,18 +294,12 @@ gst_videofilter_chain (GstPad * pad, GstBuffer * buf)
guchar *data;
gulong size;
GstBuffer *outbuf;
GstFlowReturn ret;
GST_DEBUG ("gst_videofilter_chain");
g_return_val_if_fail (pad != NULL, GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
videofilter = GST_VIDEOFILTER (GST_PAD_PARENT (pad));
data = GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf);
if (videofilter->passthru) {
return gst_pad_push (videofilter->srcpad, buf);
}
@ -314,6 +308,9 @@ gst_videofilter_chain (GstPad * pad, GstBuffer * buf)
return GST_FLOW_NOT_NEGOTIATED;
}
data = GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf);
GST_DEBUG ("gst_videofilter_chain: got buffer of %ld bytes in '%s'", size,
GST_OBJECT_NAME (videofilter));
@ -330,8 +327,11 @@ gst_videofilter_chain (GstPad * pad, GstBuffer * buf)
return GST_FLOW_ERROR;
}
outbuf = gst_pad_alloc_buffer (videofilter->srcpad, GST_BUFFER_OFFSET_NONE,
videofilter->to_buf_size, GST_RPAD_CAPS (videofilter->srcpad));
ret = gst_pad_alloc_buffer (videofilter->srcpad, GST_BUFFER_OFFSET_NONE,
videofilter->to_buf_size, GST_PAD_CAPS (videofilter->srcpad), &outbuf);
if (ret != GST_FLOW_OK)
goto no_buffer;
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
@ -343,15 +343,19 @@ gst_videofilter_chain (GstPad * pad, GstBuffer * buf)
videofilter->format->filter_func (videofilter, GST_BUFFER_DATA (outbuf),
data);
gst_buffer_unref (buf);
GST_DEBUG ("gst_videofilter_chain: pushing buffer of %d bytes in '%s'",
GST_BUFFER_SIZE (outbuf), GST_OBJECT_NAME (videofilter));
gst_pad_push (videofilter->srcpad, outbuf);
ret = gst_pad_push (videofilter->srcpad, outbuf);
gst_buffer_unref (buf);
return ret;
return GST_FLOW_OK;
no_buffer:
{
return ret;
}
}
static void