diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 64add345ba..4c4bbeeb66 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -1039,3 +1039,36 @@ gst_vaapi_surface_set_subpictures_from_composition (GstVaapiSurface * surface, } return TRUE; } + +/** + * gst_vaapi_surface_set_buffer_proxy: + * @surface: a #GstVaapiSurface + * @proxy: an external #GstVaapiBufferProxy + * + * Replaces the external buffer proxy in @surface with @proxy. + * + * This is useful when a dmabuf-based memory is instantiated in order + * to relate the generated buffer @proxy with the processed @surface. + **/ +void +gst_vaapi_surface_set_buffer_proxy (GstVaapiSurface * surface, + GstVaapiBufferProxy * proxy) +{ + gst_vaapi_buffer_proxy_replace (&surface->extbuf_proxy, proxy); +} + +/** + * gst_vaapi_surface_peek_buffer_proxy: + * @surface: a #GstVaapiSurface + * + * This is useful when a dmabuf-based memory is instantiated in order + * to relate the generated buffer @proxy with the processed @surface. + * + * Returns: (transfer none): the associated external + * #GstVaapiBufferProxy + **/ +GstVaapiBufferProxy * +gst_vaapi_surface_peek_buffer_proxy (GstVaapiSurface * surface) +{ + return surface->extbuf_proxy; +} diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h index b176a2cdfe..eaed6f8e60 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.h +++ b/gst-libs/gst/vaapi/gstvaapisurface.h @@ -233,6 +233,13 @@ gboolean gst_vaapi_surface_set_subpictures_from_composition (GstVaapiSurface * surface, GstVideoOverlayComposition * composition, gboolean propagate_context); +void +gst_vaapi_surface_set_buffer_proxy (GstVaapiSurface * surface, + GstVaapiBufferProxy * proxy); + +GstVaapiBufferProxy * +gst_vaapi_surface_peek_buffer_proxy (GstVaapiSurface * surface); + G_END_DECLS #endif /* GST_VAAPI_SURFACE_H */