summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-07-24 15:14:31 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-08-30 10:59:30 +0200
commit86a6703d918e932ef9bd3d0618fd7d5e52e3a94d (patch)
tree4e2681772083796d457d0a5654edffd10538e041
parent8efa0951ffed6953e52735162f09ab09fb116a3b (diff)
downloadgst-omx-86a6703d918e932ef9bd3d0618fd7d5e52e3a94d.tar.gz
omxbufferpool: reference the OMX component
Now that the pool is responsible of freeing the OMX buffers, we need to ensure that the OMX component stay alive while the pool is as we rely on the component to free the buffers. The GstOMXPort is owned by the component so no need to ref this one. https://bugzilla.gnome.org/show_bug.cgi?id=796918
-rw-r--r--omx/gstomxbufferpool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c
index 995687b..f2e6300 100644
--- a/omx/gstomxbufferpool.c
+++ b/omx/gstomxbufferpool.c
@@ -631,6 +631,8 @@ gst_omx_buffer_pool_finalize (GObject * object)
gst_caps_unref (pool->caps);
pool->caps = NULL;
+ g_clear_pointer (&pool->component, gst_omx_component_unref);
+
G_OBJECT_CLASS (gst_omx_buffer_pool_parent_class)->finalize (object);
}
@@ -667,7 +669,7 @@ gst_omx_buffer_pool_new (GstElement * element, GstOMXComponent * component,
pool = g_object_new (gst_omx_buffer_pool_get_type (), NULL);
pool->element = gst_object_ref (element);
- pool->component = component;
+ pool->component = gst_omx_component_ref (component);
pool->port = port;
pool->output_mode = output_mode;