mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-16 17:05:08 +03:00
gstreamer: gstlibcameraallocator: Use offset in creating a buffer
The plane length is the length of the plane size. The buffer length to be allocated for a plane is the offset and the length of FrameBuffer::Plane. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
1d2263dd3d
commit
e5e7cdf701
1 changed files with 3 additions and 1 deletions
|
@ -52,8 +52,10 @@ FrameWrap::FrameWrap(GstAllocator *allocator, FrameBuffer *buffer,
|
|||
outstandingPlanes_(0)
|
||||
{
|
||||
for (const FrameBuffer::Plane &plane : buffer->planes()) {
|
||||
GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(), plane.length,
|
||||
GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(),
|
||||
plane.offset + plane.length,
|
||||
GST_FD_MEMORY_FLAG_DONT_CLOSE);
|
||||
gst_memory_resize(mem, plane.offset, plane.length);
|
||||
gst_mini_object_set_qdata(GST_MINI_OBJECT(mem), getQuark(), this, nullptr);
|
||||
GST_MINI_OBJECT(mem)->dispose = gst_libcamera_allocator_release;
|
||||
g_object_unref(mem->allocator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue