gst: Add getters for Stream and FrameBuffer

This adds getters on pad/pool/allocator so that we can retrieve the
Stream or FrameBuffer.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Nicolas Dufresne 2020-01-27 17:41:08 -05:00 committed by Laurent Pinchart
parent 6d0cf98bb1
commit db50b1072a
6 changed files with 50 additions and 0 deletions

View file

@ -243,3 +243,11 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self,
return pool->length;
}
FrameBuffer *
gst_libcamera_memory_get_frame_buffer(GstMemory *mem)
{
auto *frame = reinterpret_cast<FrameWrap *>(gst_mini_object_get_qdata(GST_MINI_OBJECT_CAST(mem),
FrameWrap::getQuark()));
return frame->buffer_;
}