mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
sysmem: Only copy the requested part of memory instead of the complete source memory
https://bugzilla.gnome.org/show_bug.cgi?id=705678
This commit is contained in:
parent
104db59706
commit
5d26d67ba7
1 changed files with 3 additions and 6 deletions
|
@ -458,13 +458,10 @@ _sysmem_copy (GstMemorySystem * mem, gssize offset, gsize size)
|
||||||
if (size == -1)
|
if (size == -1)
|
||||||
size = mem->mem.size > offset ? mem->mem.size - offset : 0;
|
size = mem->mem.size > offset ? mem->mem.size - offset : 0;
|
||||||
|
|
||||||
copy =
|
copy = _sysmem_new_block (0, size, mem->mem.align, 0, size);
|
||||||
_sysmem_new_block (0, mem->mem.maxsize, mem->mem.align,
|
|
||||||
mem->mem.offset + offset, size);
|
|
||||||
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
|
GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
|
||||||
"memcpy %" G_GSIZE_FORMAT " memory %p -> %p", mem->mem.maxsize, mem,
|
"memcpy %" G_GSIZE_FORMAT " memory %p -> %p", size, mem, copy);
|
||||||
copy);
|
memcpy (copy->data, mem->data + mem->mem.offset + offset, size);
|
||||||
memcpy (copy->data, mem->data, mem->mem.maxsize);
|
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue