summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2013-06-05 16:32:30 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2013-09-13 16:29:48 +0200
commit90320f1fd91aa6c33e78d57644ca487e3e3c77a9 (patch)
tree6a28d08f272a2187ff286334e468287cda3e8d77
parent6301914bc5eb89878255495b206caa04251bef33 (diff)
downloadgst-plugins-good-90320f1fd91aa6c33e78d57644ca487e3e3c77a9.tar.gz
gst-plugins-good-90320f1fd91aa6c33e78d57644ca487e3e3c77a9.tar.xz
v4l2: make sure the element is not deleted before the pool
The pool accesses data from the v4l2object so it must exist at least as long as the pool. Refcount the element which controls the object live-time. https://bugzilla.gnome.org/show_bug.cgi?id=701650
-rw-r--r--sys/v4l2/gstv4l2bufferpool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index cb6ece5e3..a156ecea5 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -1019,6 +1019,8 @@ gst_v4l2_buffer_pool_finalize (GObject * object)
gst_object_unref (pool->allocator);
g_free (pool->buffers);
+ gst_object_unref (pool->obj->element);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -1072,6 +1074,8 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
gst_buffer_pool_config_set_params (s, caps, obj->sizeimage, 2, 0);
gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pool), s);
+ gst_object_ref (obj->element);
+
return GST_BUFFER_POOL (pool);
/* ERRORS */