summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-04-04 13:58:00 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-04-04 14:30:44 +0200
commitf1d13d1e08148b694caa08353105d4252d239f06 (patch)
tree2268707501071817bbf94f0e0a0098f0b53307e7
parente54671d4b3ca5cfb0e282db33b9c3d7b5aa955d6 (diff)
libs: bufferproxy: remove GstMemory reference
Since bufferproxy and surface are not referenced circularly, there's no need to keep, in the buffer proxy, a reference to the GstMemory where it is held. This patch removes that handling.
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy.c40
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy.h6
-rw-r--r--gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h1
3 files changed, 0 insertions, 47 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.c b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
index 41533cd8..492053a5 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy.c
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.c
@@ -85,11 +85,6 @@ gst_vaapi_buffer_proxy_finalize (GstVaapiBufferProxy * proxy)
{
gst_vaapi_buffer_proxy_release_handle (proxy);
- if (proxy->mem) {
- gst_memory_unref (proxy->mem);
- proxy->mem = NULL;
- }
-
/* Notify the user function that the object is now destroyed */
if (proxy->destroy_func)
proxy->destroy_func (proxy->destroy_data);
@@ -130,7 +125,6 @@ gst_vaapi_buffer_proxy_new (guintptr handle, guint type, gsize size,
proxy->va_info.type = VAImageBufferType;
proxy->va_info.mem_type = from_GstVaapiBufferMemoryType (proxy->type);
proxy->va_info.mem_size = size;
- proxy->mem = NULL;
if (!proxy->va_info.mem_type)
goto error_unsupported_mem_type;
return proxy;
@@ -162,7 +156,6 @@ gst_vaapi_buffer_proxy_new_from_surface (GstMiniObject * surface,
proxy->destroy_data = data;
proxy->type = type;
proxy->va_buf = buf_id;
- proxy->mem = NULL;
memset (&proxy->va_info, 0, sizeof (proxy->va_info));
proxy->va_info.mem_type = from_GstVaapiBufferMemoryType (proxy->type);
if (!proxy->va_info.mem_type)
@@ -303,36 +296,3 @@ gst_vaapi_buffer_proxy_release_data (GstVaapiBufferProxy * proxy)
proxy->destroy_data = NULL;
}
}
-
-/**
- * gst_vaapi_buffer_proxy_set_mem:
- * @proxy: a #GstVaapiBufferProxy
- * @mem: a #GstMemory
- *
- * Relates @mem with @proxy, hence we later will know which memory
- * correspond to processed surface.
- *
- * This is useful when a dmabuf-based memory is instantiated and
- * associated with a surface.
- **/
-void
-gst_vaapi_buffer_proxy_set_mem (GstVaapiBufferProxy * proxy, GstMemory * mem)
-{
- gst_mini_object_replace ((GstMiniObject **) & proxy->mem,
- GST_MINI_OBJECT (mem));
-}
-
-/**
- * gst_vaapi_buffer_proxy_peek_mem:
- * @proxy: a #GstVaapiBufferProxy
- *
- * This is useful when a dmabuf-based memory is instantiated and
- * associated with a surface.
- *
- * Returns: (transfer none): the assigned #GstMemory to the @proxy.
- **/
-GstMemory *
-gst_vaapi_buffer_proxy_peek_mem (GstVaapiBufferProxy * proxy)
-{
- return proxy->mem;
-}
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy.h b/gst-libs/gst/vaapi/gstvaapibufferproxy.h
index bb80abf4..4b1cebec 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy.h
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy.h
@@ -101,12 +101,6 @@ gst_vaapi_buffer_proxy_get_size (GstVaapiBufferProxy * proxy);
void
gst_vaapi_buffer_proxy_release_data (GstVaapiBufferProxy * proxy);
-void
-gst_vaapi_buffer_proxy_set_mem (GstVaapiBufferProxy * proxy, GstMemory * mem);
-
-GstMemory *
-gst_vaapi_buffer_proxy_peek_mem (GstVaapiBufferProxy * proxy);
-
G_END_DECLS
#endif /* GST_VAAPI_BUFFER_PROXY_H */
diff --git a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
index ac929c30..d9f51885 100644
--- a/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
+++ b/gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h
@@ -69,7 +69,6 @@ struct _GstVaapiBufferProxy {
guint type;
VABufferID va_buf;
VABufferInfo va_info;
- GstMemory *mem;
};
G_GNUC_INTERNAL