mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
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
This commit is contained in:
parent
115fb15a40
commit
346474c25d
1 changed files with 11 additions and 9 deletions
|
@ -421,6 +421,7 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
|
/* FIXME re-using buffer pool breaks renegotiation */
|
||||||
if ((pool = qt_sink->pool))
|
if ((pool = qt_sink->pool))
|
||||||
gst_object_ref (pool);
|
gst_object_ref (pool);
|
||||||
|
|
||||||
|
@ -439,30 +440,31 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
pool = NULL;
|
pool = NULL;
|
||||||
}
|
}
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (pool == NULL && need_pool) {
|
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_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 */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
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);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
if (!gst_buffer_pool_set_config (pool, config))
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* 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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
||||||
|
|
Loading…
Reference in a new issue