summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-04-03 18:43:52 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-04-04 14:22:04 +0200
commitc80668c337408114a9bc715f13bcea44223a1d8c (patch)
treefa888f88aae5f2c7037e7c2b7601ae0a69bb430a /gst-libs/gst/vaapi
parentce3bf2c2aef123d2d57e3a99fa532fd960acf499 (diff)
libs: bufferproxy: rename parent memeber as surface
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy.c20
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h4
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurface_drm.c2
3 files changed, 12 insertions, 14 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
index c8fe234b..14dc5b49 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
@@ -41,11 +41,10 @@ gst_vaapi_buffer_proxy_acquire_handle (GstVaapiBufferProxy * proxy)
if (proxy->va_info.handle)
return TRUE;
- if (!proxy->parent || proxy->va_buf == VA_INVALID_ID)
+ if (!proxy->surface || proxy->va_buf == VA_INVALID_ID)
return FALSE;
- /* @XXX(victor): parent might be not a surface */
- display = GST_VAAPI_SURFACE_DISPLAY (GST_VAAPI_SURFACE (proxy->parent));
+ display = GST_VAAPI_SURFACE_DISPLAY (GST_VAAPI_SURFACE (proxy->surface));
GST_VAAPI_DISPLAY_LOCK (display);
va_status = vaAcquireBufferHandle (GST_VAAPI_DISPLAY_VADISPLAY (display),
@@ -67,11 +66,10 @@ gst_vaapi_buffer_proxy_release_handle (GstVaapiBufferProxy * proxy)
if (!proxy->va_info.handle)
return TRUE;
- if (!proxy->parent || proxy->va_buf == VA_INVALID_ID)
+ if (!proxy->surface || proxy->va_buf == VA_INVALID_ID)
return FALSE;
- /* @XXX(victor): parent might be not a surface */
- display = GST_VAAPI_SURFACE_DISPLAY (GST_VAAPI_SURFACE (proxy->parent));
+ display = GST_VAAPI_SURFACE_DISPLAY (GST_VAAPI_SURFACE (proxy->surface));
GST_VAAPI_DISPLAY_LOCK (display);
va_status = vaReleaseBufferHandle (GST_VAAPI_DISPLAY_VADISPLAY (display),
@@ -96,7 +94,7 @@ gst_vaapi_buffer_proxy_finalize (GstVaapiBufferProxy * proxy)
if (proxy->destroy_func)
proxy->destroy_func (proxy->destroy_data);
- gst_mini_object_replace ((GstMiniObject **) & proxy->parent, NULL);
+ gst_mini_object_replace ((GstMiniObject **) & proxy->surface, NULL);
}
static inline const GstVaapiMiniObjectClass *
@@ -123,7 +121,7 @@ gst_vaapi_buffer_proxy_new (guintptr handle, guint type, gsize size,
if (!proxy)
return NULL;
- proxy->parent = NULL;
+ proxy->surface = NULL;
proxy->destroy_func = destroy_func;
proxy->destroy_data = user_data;
proxy->type = type;
@@ -147,19 +145,19 @@ error_unsupported_mem_type:
}
GstVaapiBufferProxy *
-gst_vaapi_buffer_proxy_new_from_object (GstMiniObject * object,
+gst_vaapi_buffer_proxy_new_from_surface (GstMiniObject * surface,
VABufferID buf_id, guint type, GDestroyNotify destroy_func, gpointer data)
{
GstVaapiBufferProxy *proxy;
- g_return_val_if_fail (object != NULL, NULL);
+ g_return_val_if_fail (surface != NULL, NULL);
proxy = (GstVaapiBufferProxy *)
gst_vaapi_mini_object_new (gst_vaapi_buffer_proxy_class ());
if (!proxy)
return NULL;
- proxy->parent = gst_mini_object_ref (object);
+ proxy->surface = gst_mini_object_ref (surface);
proxy->destroy_func = destroy_func;
proxy->destroy_data = data;
proxy->type = type;
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
index 66bfeb4d..ac929c30 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
@@ -62,7 +62,7 @@ G_BEGIN_DECLS
struct _GstVaapiBufferProxy {
/*< private >*/
GstVaapiMiniObject parent_instance;
- GstMiniObject *parent;
+ GstMiniObject *surface;
GDestroyNotify destroy_func;
gpointer destroy_data;
@@ -74,7 +74,7 @@ struct _GstVaapiBufferProxy {
G_GNUC_INTERNAL
GstVaapiBufferProxy *
-gst_vaapi_buffer_proxy_new_from_object (GstMiniObject * object,
+gst_vaapi_buffer_proxy_new_from_surface (GstMiniObject * surface,
VABufferID buf_id, guint type, GDestroyNotify destroy_func, gpointer data);
G_GNUC_INTERNAL
diff --git a/gst-libs/gst/vaapi/gstvaapisurface_drm.c b/gst-libs/gst/vaapi/gstvaapisurface_drm.c
index 7587553a..cbf12c67 100644
--- a/gst-libs/gst/vaapi/gstvaapisurface_drm.c
+++ b/gst-libs/gst/vaapi/gstvaapisurface_drm.c
@@ -38,7 +38,7 @@ gst_vaapi_surface_get_drm_buf_handle (GstVaapiSurface * surface, guint type)
/* The proxy takes ownership if the image, even creation failure. */
proxy =
- gst_vaapi_buffer_proxy_new_from_object (GST_MINI_OBJECT_CAST (surface),
+ gst_vaapi_buffer_proxy_new_from_surface (GST_MINI_OBJECT_CAST (surface),
image->internal_image.buf, type, (GDestroyNotify) gst_vaapi_image_unref,
image);
if (!proxy)