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 8879b4c3f7..401936f469 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -2127,3 +2127,28 @@ gst_va_buffer_get_aux_surface (GstBuffer * buffer) return surface_buffer->surface; } + +/** + * gst_va_buffer_peek_display: + * @buffer: a #GstBuffer + * + * Returns: (type #GstVaDisplay) (transfer none): the display which this + * @buffer belongs to. The reference of the display is unchanged. + * + * Since: 1.22 + */ +GstVaDisplay * +gst_va_buffer_peek_display (GstBuffer * buffer) +{ + GstMemory *mem; + + if (!buffer) + return NULL; + + mem = gst_buffer_peek_memory (buffer, 0); + /* Buffer without mem, not VA kind memory. */ + if (!mem) + return NULL; + + return gst_va_memory_peek_display (mem); +} 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 b046abf3e8..f0ee50a773 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.h @@ -132,5 +132,7 @@ GST_VA_API gboolean gst_va_buffer_create_aux_surface (GstBuffer * buffer); GST_VA_API VASurfaceID gst_va_buffer_get_aux_surface (GstBuffer * buffer); +GST_VA_API +GstVaDisplay * gst_va_buffer_peek_display (GstBuffer * buffer); G_END_DECLS