diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-08-25 16:20:21 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-08-25 16:20:21 +0200 |
commit | b5ef693e88c38ddec313be6776cc561f8b12c529 (patch) | |
tree | a58dda0f5e76663823a3f6a47d6873a1f16f8daa /libs | |
parent | 96ecd616186c2cee67be77e2a8b0151363c2e129 (diff) |
buffer: always copy all buffer flags when asked
Don't try to be smart and copy only a subset of buffer flag
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstbasetransform.c | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 2f6ee964a..e33801e0f 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1457,48 +1457,24 @@ static gboolean default_copy_metadata (GstBaseTransform * trans, GstBuffer * inbuf, GstBuffer * outbuf) { - GstBaseTransformPrivate *priv; - gboolean copymeta; - guint mask; - - priv = trans->priv; + GstBaseTransformPrivate *priv = trans->priv; /* now copy the metadata */ - mask = GST_BUFFER_FLAG_LIVE | GST_BUFFER_FLAG_IN_CAPS | - GST_BUFFER_FLAG_DELTA_UNIT | GST_BUFFER_FLAG_DISCONT | - GST_BUFFER_FLAG_GAP | GST_BUFFER_FLAG_MEDIA1 | - GST_BUFFER_FLAG_MEDIA2 | GST_BUFFER_FLAG_MEDIA3; - - /* see if the flags and timestamps match */ - copymeta = - (GST_MINI_OBJECT_FLAGS (outbuf) & mask) != - (GST_MINI_OBJECT_FLAGS (inbuf) & mask); - copymeta |= - GST_BUFFER_TIMESTAMP (outbuf) != GST_BUFFER_TIMESTAMP (inbuf) || - GST_BUFFER_DURATION (outbuf) != GST_BUFFER_DURATION (inbuf) || - GST_BUFFER_OFFSET (outbuf) != GST_BUFFER_OFFSET (inbuf) || - GST_BUFFER_OFFSET_END (outbuf) != GST_BUFFER_OFFSET_END (inbuf); - /* we need to modify the metadata when the element is not gap aware, - * passthrough is not used and the gap flag is set */ - copymeta |= !priv->gap_aware && !trans->passthrough - && (GST_MINI_OBJECT_FLAGS (outbuf) & GST_BUFFER_FLAG_GAP); - - if (copymeta) { - GST_DEBUG_OBJECT (trans, "copying metadata"); - - /* this should not happen, buffers allocated from a pool or with - * new_allocate should always be writable. */ - if (!gst_buffer_is_writable (outbuf)) - goto not_writable; - - /* when we get here, the metadata should be writable */ - gst_buffer_copy_into (outbuf, inbuf, - GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1); - - /* clear the GAP flag when the subclass does not understand it */ - if (!priv->gap_aware) - GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_GAP); - } + GST_DEBUG_OBJECT (trans, "copying metadata"); + + /* this should not happen, buffers allocated from a pool or with + * new_allocate should always be writable. */ + if (!gst_buffer_is_writable (outbuf)) + goto not_writable; + + /* when we get here, the metadata should be writable */ + gst_buffer_copy_into (outbuf, inbuf, + GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1); + + /* clear the GAP flag when the subclass does not understand it */ + if (!priv->gap_aware) + GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_GAP); + return TRUE; /* ERRORS */ |