diff options
author | Julien Isorce <j.isorce@samsung.com> | 2016-10-19 15:09:34 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2017-02-02 20:33:36 +0100 |
commit | 4f037a036bf138607df201e73ff3ff0f8fa449b4 (patch) | |
tree | 06986e2f1356beb5ab8c9f6a119bc3830167f3db /gst-libs | |
parent | 7fc1b70ff65bc5a78181e1faa23b4e5e510f8c3b (diff) |
libs: surface: add gst_vaapi_surface_{set,peek}_buffer_proxy()
These functions are useful when a dmabuf-based memory is instantiated in
order to relate the generated buffer @proxy with the processed @surface.
https://bugzilla.gnome.org/show_bug.cgi?id=755072
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.c | 33 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapisurface.h | 7 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 64add345..4c4bbeeb 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 b176a2cd..eaed6f8e 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 */ |