libs: va: Add API to peek the va memory's display.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
This commit is contained in:
He Junyan 2022-11-04 20:28:34 +08:00
parent b1a98433f8
commit 464650a5d0
2 changed files with 27 additions and 0 deletions

View file

@ -1959,6 +1959,31 @@ gst_va_memory_get_surface (GstMemory * mem)
return surface;
}
/**
* gst_va_memory_peek_display:
* @mem: a #GstMemory
*
* Returns: (type #GstVaDisplay) (transfer none): the display which
* this @mem belongs to. The reference of the display is unchanged.
*
* Since: 1.22
*/
GstVaDisplay *
gst_va_memory_peek_display (GstMemory * mem)
{
GstAllocator *allocator;
if (!mem)
return NULL;
allocator = GST_MEMORY_CAST (mem)->allocator;
/* no allocator, not VA kind memory. */
if (!allocator)
return NULL;
return gst_va_allocator_peek_display (allocator);
}
/**
* gst_va_buffer_get_surface:
* @buffer: a #GstBuffer

View file

@ -124,6 +124,8 @@ GstVaDisplay * gst_va_allocator_peek_display (GstAllocator * alloca
GST_VA_API
VASurfaceID gst_va_memory_get_surface (GstMemory * mem);
GST_VA_API
GstVaDisplay * gst_va_memory_peek_display (GstMemory * mem);
GST_VA_API
VASurfaceID gst_va_buffer_get_surface (GstBuffer * buffer);
GST_VA_API