basetrans: remove useless variables from prepare_output_buffer

Remove the caps and size from the prepare_output_buffer function. with
bufferpools and capsnego done differently, we don't need this in most cases and
if we do, we can simply use the transform_size function and get the caps from
the srcpad.
This commit is contained in:
Wim Taymans 2011-07-21 13:56:11 +02:00
parent d23fc81c43
commit e4ee356449
4 changed files with 7 additions and 21 deletions

View file

@ -1409,21 +1409,8 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
} }
if (bclass->prepare_output_buffer) { if (bclass->prepare_output_buffer) {
if (outcaps == NULL) GST_DEBUG_OBJECT (trans, "calling prepare buffer");
outcaps = gst_pad_get_current_caps (trans->srcpad); ret = bclass->prepare_output_buffer (trans, in_buf, out_buf);
GST_DEBUG_OBJECT (trans,
"calling prepare buffer with caps %p %" GST_PTR_FORMAT, outcaps,
outcaps);
ret =
bclass->prepare_output_buffer (trans, in_buf, outsize, outcaps,
out_buf);
/* get a new ref to the srcpad caps, the prepare_output_buffer function can
* update the pad caps if it wants */
if (outcaps)
gst_caps_unref (outcaps);
outcaps = gst_pad_get_current_caps (trans->srcpad);
/* FIXME 0.11: /* FIXME 0.11:
* decrease refcount again if vmethod returned refcounted in_buf. This * decrease refcount again if vmethod returned refcounted in_buf. This

View file

@ -235,7 +235,7 @@ struct _GstBaseTransformClass {
gboolean (*src_event) (GstBaseTransform *trans, GstEvent *event); gboolean (*src_event) (GstBaseTransform *trans, GstEvent *event);
GstFlowReturn (*prepare_output_buffer) (GstBaseTransform * trans, GstFlowReturn (*prepare_output_buffer) (GstBaseTransform * trans,
GstBuffer *input, gint size, GstCaps *caps, GstBuffer **buf); GstBuffer *input, GstBuffer **buf);
void (*before_transform) (GstBaseTransform *trans, GstBuffer *buffer); void (*before_transform) (GstBaseTransform *trans, GstBuffer *buffer);

View file

@ -82,7 +82,7 @@ static gboolean gst_capsfilter_accept_caps (GstBaseTransform * base,
static GstFlowReturn gst_capsfilter_transform_ip (GstBaseTransform * base, static GstFlowReturn gst_capsfilter_transform_ip (GstBaseTransform * base,
GstBuffer * buf); GstBuffer * buf);
static GstFlowReturn gst_capsfilter_prepare_buf (GstBaseTransform * trans, static GstFlowReturn gst_capsfilter_prepare_buf (GstBaseTransform * trans,
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf); GstBuffer * input, GstBuffer ** buf);
static void static void
gst_capsfilter_class_init (GstCapsFilterClass * klass) gst_capsfilter_class_init (GstCapsFilterClass * klass)
@ -326,7 +326,7 @@ gst_capsfilter_transform_ip (GstBaseTransform * base, GstBuffer * buf)
*/ */
static GstFlowReturn static GstFlowReturn
gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input, gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input,
gint size, GstCaps * caps, GstBuffer ** buf) GstBuffer ** buf)
{ {
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;

View file

@ -107,8 +107,7 @@ static gboolean gst_identity_event (GstBaseTransform * trans, GstEvent * event);
static GstFlowReturn gst_identity_transform_ip (GstBaseTransform * trans, static GstFlowReturn gst_identity_transform_ip (GstBaseTransform * trans,
GstBuffer * buf); GstBuffer * buf);
static GstFlowReturn gst_identity_prepare_output_buffer (GstBaseTransform static GstFlowReturn gst_identity_prepare_output_buffer (GstBaseTransform
* trans, GstBuffer * in_buf, gint out_size, GstCaps * out_caps, * trans, GstBuffer * in_buf, GstBuffer ** out_buf);
GstBuffer ** out_buf);
static gboolean gst_identity_start (GstBaseTransform * trans); static gboolean gst_identity_start (GstBaseTransform * trans);
static gboolean gst_identity_stop (GstBaseTransform * trans); static gboolean gst_identity_stop (GstBaseTransform * trans);
@ -382,7 +381,7 @@ gst_identity_event (GstBaseTransform * trans, GstEvent * event)
static GstFlowReturn static GstFlowReturn
gst_identity_prepare_output_buffer (GstBaseTransform * trans, gst_identity_prepare_output_buffer (GstBaseTransform * trans,
GstBuffer * in_buf, gint out_size, GstCaps * out_caps, GstBuffer ** out_buf) GstBuffer * in_buf, GstBuffer ** out_buf)
{ {
GstIdentity *identity = GST_IDENTITY (trans); GstIdentity *identity = GST_IDENTITY (trans);