summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-05 16:20:44 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-06 14:19:37 -0400
commit6669ccdae5a56c52bf505ddfff49bb3b24b0bda4 (patch)
treeedc104312e5dc7ae2104265159902df542003f2a /ext
parent38b5a9bf3396720c615d63d8ec420e206a70964d (diff)
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
Diffstat (limited to 'ext')
-rw-r--r--ext/gtk/gstgtkglsink.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c
index d9d389b36..4439e85fb 100644
--- a/ext/gtk/gstgtkglsink.c
+++ b/ext/gtk/gstgtkglsink.c
@@ -202,6 +202,7 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
+ GstVideoInfo info;
guint size;
gboolean need_pool;
GstStructure *allocation_meta = NULL;
@@ -215,18 +216,16 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (gtk_sink, "create new pool");
pool = gst_gl_buffer_pool_new (gtk_sink->context);
- /* the normal size of a frame */
- size = info.size;
-
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
gst_buffer_pool_config_add_option (config,
@@ -234,11 +233,12 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
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 */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
GST_OBJECT_LOCK (gtk_sink);
display_width = gtk_sink->display_width;