From: Wim Taymans Date: Fri, 2 Mar 2012 11:45:23 +0000 (+0100) Subject: meta: add boolean to signal a region copy X-Git-Tag: RELEASE-0.11.3~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cd35d63868e6e196a818fcdc8c2e9664d8c7b4b;p=platform%2Fupstream%2Fgstreamer.git meta: add boolean to signal a region copy Add a boolean to the metadata copy transform that signals if a only a region is copied. --- diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 1b1db7e081..ca758b5d38 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -271,6 +271,7 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, { GstMetaItem *walk; gsize bufsize; + gboolean region = FALSE; g_return_if_fail (dest != NULL); g_return_if_fail (src != NULL); @@ -283,8 +284,12 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, bufsize = gst_buffer_get_size (src); g_return_if_fail (bufsize >= offset); + if (offset > 0) + region = TRUE; if (size == -1) size = bufsize - offset; + if (size < bufsize) + region = TRUE; g_return_if_fail (bufsize >= offset + size); GST_CAT_LOG (GST_CAT_BUFFER, "copy %p to %p, offset %" G_GSIZE_FORMAT @@ -362,6 +367,7 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src, if (info->transform_func) { GstMetaTransformCopy copy_data; + copy_data.region = region; copy_data.offset = offset; copy_data.size = size; diff --git a/gst/gstmeta.h b/gst/gstmeta.h index a99dd3cfca..c616a74833 100644 --- a/gst/gstmeta.h +++ b/gst/gstmeta.h @@ -123,12 +123,14 @@ GST_EXPORT GQuark _gst_meta_transform_copy; /** * GstMetaTransformCopy: - * @offset: the offset to copy - * @size: the size to copy + * @region: %TRUE if only region is copied + * @offset: the offset to copy, 0 if @region is %FALSE, otherwise > 0 + * @size: the size to copy, -1 or the buffer size when @region is %FALSE * * Extra data passed to a "gst-copy" transform #GstMetaTransformFunction. */ typedef struct { + gboolean region; gsize offset; gsize size; } GstMetaTransformCopy;