From 346474c25db324bb3c6931cdc881750dab10b22e Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 5 Sep 2017 16:20:44 -0400 Subject: [PATCH] Request minimum buffer even if need_pool is FALSE When tee is used, it will not request a pool, but still it wants to know how many buffers are required. https://bugzilla.gnome.org/show_bug.cgi?id=730758 --- ext/qt/gstqtsink.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ext/qt/gstqtsink.cc b/ext/qt/gstqtsink.cc index 31495feca5..2a4ad7ccc6 100644 --- a/ext/qt/gstqtsink.cc +++ b/ext/qt/gstqtsink.cc @@ -421,6 +421,7 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) if (caps == NULL) goto no_caps; + /* FIXME re-using buffer pool breaks renegotiation */ if ((pool = qt_sink->pool)) gst_object_ref (pool); @@ -439,30 +440,31 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) pool = NULL; } gst_structure_free (config); - } - - if (pool == NULL && need_pool) { + } else { GstVideoInfo info; if (!gst_video_info_from_caps (&info, caps)) goto invalid_caps; - GST_DEBUG_OBJECT (qt_sink, "create new pool"); - pool = gst_gl_buffer_pool_new (qt_sink->context); - /* the normal size of a frame */ size = info.size; + } + + if (pool == NULL && need_pool) { + + GST_DEBUG_OBJECT (qt_sink, "create new pool"); + pool = gst_gl_buffer_pool_new (qt_sink->context); config = gst_buffer_pool_get_config (pool); gst_buffer_pool_config_set_params (config, caps, size, 0, 0); if (!gst_buffer_pool_set_config (pool, config)) goto config_failed; } + /* we need at least 2 buffer because we hold on to the last one */ - if (pool) { - gst_query_add_allocation_pool (query, pool, size, 2, 0); + gst_query_add_allocation_pool (query, pool, size, 2, 0); + if (pool) gst_object_unref (pool); - } /* we also support various metadata */ gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);