mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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.
This commit is contained in:
parent
36b6204811
commit
5cd35d6386
2 changed files with 10 additions and 2 deletions
|
@ -271,6 +271,7 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src,
|
||||||
{
|
{
|
||||||
GstMetaItem *walk;
|
GstMetaItem *walk;
|
||||||
gsize bufsize;
|
gsize bufsize;
|
||||||
|
gboolean region = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (dest != NULL);
|
g_return_if_fail (dest != NULL);
|
||||||
g_return_if_fail (src != 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);
|
bufsize = gst_buffer_get_size (src);
|
||||||
g_return_if_fail (bufsize >= offset);
|
g_return_if_fail (bufsize >= offset);
|
||||||
|
if (offset > 0)
|
||||||
|
region = TRUE;
|
||||||
if (size == -1)
|
if (size == -1)
|
||||||
size = bufsize - offset;
|
size = bufsize - offset;
|
||||||
|
if (size < bufsize)
|
||||||
|
region = TRUE;
|
||||||
g_return_if_fail (bufsize >= offset + size);
|
g_return_if_fail (bufsize >= offset + size);
|
||||||
|
|
||||||
GST_CAT_LOG (GST_CAT_BUFFER, "copy %p to %p, offset %" G_GSIZE_FORMAT
|
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) {
|
if (info->transform_func) {
|
||||||
GstMetaTransformCopy copy_data;
|
GstMetaTransformCopy copy_data;
|
||||||
|
|
||||||
|
copy_data.region = region;
|
||||||
copy_data.offset = offset;
|
copy_data.offset = offset;
|
||||||
copy_data.size = size;
|
copy_data.size = size;
|
||||||
|
|
||||||
|
|
|
@ -123,12 +123,14 @@ GST_EXPORT GQuark _gst_meta_transform_copy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstMetaTransformCopy:
|
* GstMetaTransformCopy:
|
||||||
* @offset: the offset to copy
|
* @region: %TRUE if only region is copied
|
||||||
* @size: the size to copy
|
* @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.
|
* Extra data passed to a "gst-copy" transform #GstMetaTransformFunction.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
gboolean region;
|
||||||
gsize offset;
|
gsize offset;
|
||||||
gsize size;
|
gsize size;
|
||||||
} GstMetaTransformCopy;
|
} GstMetaTransformCopy;
|
||||||
|
|
Loading…
Reference in a new issue