diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c index a50d420863..8879b4c3f7 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -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 diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h index 780c21da57..b046abf3e8 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h @@ -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