From 12a3bdbd09abd8535d50a7c6c049e076b0e99be3 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 8 Jul 2014 13:34:28 -0400 Subject: [PATCH] v4l2src: Ensure internal pool activation Before we would hit an assertion "'gst_buffer_pool_is_active (bpool)' failed" if the internal pool was not used to push buffer downstrea, hence not given to the baseclass. https://bugzilla.gnome.org/show_bug.cgi?id=732912 --- sys/v4l2/gstv4l2src.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 1386333e70..e1c0df0354 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -464,7 +464,20 @@ gst_v4l2src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query) if (gst_v4l2_object_decide_allocation (src->v4l2object, query)) ret = GST_BASE_SRC_CLASS (parent_class)->decide_allocation (bsrc, query); + if (ret) { + if (!gst_buffer_pool_set_active (src->v4l2object->pool, TRUE)) + goto activate_failed; + } + return ret; + +activate_failed: + { + GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, + (_("Failed to allocate required memory.")), + ("Buffer pool activation failed")); + return FALSE; + } } static gboolean