summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2015-06-12 20:14:37 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-06-12 20:14:37 -0400
commitc72213ff8b73d5bafbc83fd87e8273647607e967 (patch)
treec69812774af91e8f02e009db25ffb58a4604041a
parent10a2c33a7f04b1278ae975b65d7f2cbb390981c9 (diff)
glimagesink: Don't do pool caching
We now know that pool caching can cause renegotiation issues when an element in the pipeline change from passthrough to not passthrough. As it's not needed, don't cache existing pools. https://bugzilla.gnome.org/show_bug.cgi?id=748344
-rw-r--r--ext/gl/gstglimagesink.c41
-rw-r--r--ext/gl/gstglimagesink.h2
2 files changed, 8 insertions, 35 deletions
diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
index d79494e76..0893dca49 100644
--- a/ext/gl/gstglimagesink.c
+++ b/ext/gl/gstglimagesink.c
@@ -488,7 +488,6 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)
glimage_sink->keep_aspect_ratio = TRUE;
glimage_sink->par_n = 0;
glimage_sink->par_d = 1;
- glimage_sink->pool = NULL;
glimage_sink->stored_buffer = NULL;
glimage_sink->redisplay_texture = 0;
glimage_sink->handle_events = TRUE;
@@ -877,12 +876,6 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
glimage_sink->caps = NULL;
}
- /* we're losing the context, this pool is no use anymore */
- if (glimage_sink->pool) {
- gst_object_unref (glimage_sink->pool);
- glimage_sink->pool = NULL;
- }
-
if (glimage_sink->context) {
GstGLWindow *window = gst_gl_context_get_window (glimage_sink->context);
@@ -1263,6 +1256,7 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
goto no_caps;
if (need_pool) {
+ GstBufferPool *pool;
GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps))
@@ -1271,36 +1265,17 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
/* the normal size of a frame */
size = info.size;
- if (glimage_sink->pool) {
- GstCaps *pcaps;
-
- /* we had a pool, check caps */
- GST_DEBUG_OBJECT (glimage_sink, "check existing pool caps");
- config = gst_buffer_pool_get_config (glimage_sink->pool);
- gst_buffer_pool_config_get_params (config, &pcaps, &size, NULL, NULL);
-
- if (!gst_caps_is_equal (caps, pcaps)) {
- GST_DEBUG_OBJECT (glimage_sink, "pool has different caps");
- /* different caps, we can't use this pool */
- gst_object_unref (glimage_sink->pool);
- glimage_sink->pool = NULL;
- }
- gst_structure_free (config);
- }
+ GST_DEBUG_OBJECT (glimage_sink, "create new pool");
- if (glimage_sink->pool == NULL) {
- GST_DEBUG_OBJECT (glimage_sink, "create new pool");
+ pool = gst_gl_buffer_pool_new (glimage_sink->context);
+ config = gst_buffer_pool_get_config (pool);
+ gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
- glimage_sink->pool = gst_gl_buffer_pool_new (glimage_sink->context);
- config = gst_buffer_pool_get_config (glimage_sink->pool);
- gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
-
- if (!gst_buffer_pool_set_config (glimage_sink->pool, config))
- goto config_failed;
- }
+ 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, glimage_sink->pool, size, 2, 0);
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
}
if (glimage_sink->context->gl_vtable->FenceSync)
diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h
index 03e81365c..b8c256ba1 100644
--- a/ext/gl/gstglimagesink.h
+++ b/ext/gl/gstglimagesink.h
@@ -80,8 +80,6 @@ struct _GstGLImageSink
gboolean keep_aspect_ratio;
gint par_n, par_d;
- GstBufferPool *pool;
-
/* avoid replacing the stored_buffer while drawing */
GMutex drawing_lock;
GstBuffer *stored_buffer;