Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
branches:nemo:devel:hw:ti:omap4:common
>
gstreamer
> 0011-basetransform-don-t-do-unnecessary-pad_alloc.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0011-basetransform-don-t-do-unnecessary-pad_alloc.patch of Package gstreamer
From 41af019dc6333d1ab8372bd806e0f289899f1ea4 Mon Sep 17 00:00:00 2001 From: Rob Clark <rob@ti.com> Date: Wed, 26 May 2010 14:42:40 -0500 Subject: [PATCH 11/14] basetransform: don't do unnecessary pad_alloc() Don't allocate a buffer in passthrough mode. --- libs/gst/base/gstbasetransform.c | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index ccf0802..e0275dd 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -2260,14 +2260,26 @@ gst_base_transform_handle_buffer (GstBaseTransform * trans, GstBuffer * inbuf, no_qos: - /* first try to allocate an output buffer based on the currently negotiated - * format. While we call pad-alloc we could renegotiate the srcpad format or - * have a new suggestion for upstream buffer-alloc. - * In any case, outbuf will contain a buffer suitable for doing the configured - * transform after this function. */ - ret = gst_base_transform_prepare_output_buffer (trans, inbuf, outbuf); - if (G_UNLIKELY (ret != GST_FLOW_OK)) - goto no_buffer; + if (trans->passthrough) { + /* I'm not yet sure if we should bypass allocating output buffer in case of + * passthrough, or if I should override the prepare_output_buffer vmethod.. + * I think the argument for always doing buffer allocation is to give a + * chance for upstream caps-renegotiation.. except I think the existing + * gst_base_transform_buffer_alloc() which itself does a pad_alloc() should + * be sufficient.. + */ + GST_DEBUG_OBJECT (trans, "reuse input buffer"); + *outbuf = inbuf; + } else { + /* first try to allocate an output buffer based on the currently negotiated + * format. While we call pad-alloc we could renegotiate the srcpad format or + * have a new suggestion for upstream buffer-alloc. + * In any case, outbuf will contain a buffer suitable for doing the configured + * transform after this function. */ + ret = gst_base_transform_prepare_output_buffer (trans, inbuf, outbuf); + if (G_UNLIKELY (ret != GST_FLOW_OK)) + goto no_buffer; + } /* now perform the needed transform */ if (trans->passthrough) { -- 1.7.5.4