mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-28 09:15:08 +00:00
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
This commit is contained in:
parent
2210ba5d46
commit
ccc410e73c
|
@ -488,7 +488,6 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)
|
||||||
glimage_sink->keep_aspect_ratio = TRUE;
|
glimage_sink->keep_aspect_ratio = TRUE;
|
||||||
glimage_sink->par_n = 0;
|
glimage_sink->par_n = 0;
|
||||||
glimage_sink->par_d = 1;
|
glimage_sink->par_d = 1;
|
||||||
glimage_sink->pool = NULL;
|
|
||||||
glimage_sink->stored_buffer = NULL;
|
glimage_sink->stored_buffer = NULL;
|
||||||
glimage_sink->redisplay_texture = 0;
|
glimage_sink->redisplay_texture = 0;
|
||||||
glimage_sink->handle_events = TRUE;
|
glimage_sink->handle_events = TRUE;
|
||||||
|
@ -877,12 +876,6 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
glimage_sink->caps = NULL;
|
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) {
|
if (glimage_sink->context) {
|
||||||
GstGLWindow *window = gst_gl_context_get_window (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;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
if (need_pool) {
|
||||||
|
GstBufferPool *pool;
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
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 */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
if (glimage_sink->pool) {
|
GST_DEBUG_OBJECT (glimage_sink, "create new pool");
|
||||||
GstCaps *pcaps;
|
|
||||||
|
|
||||||
/* we had a pool, check caps */
|
pool = gst_gl_buffer_pool_new (glimage_sink->context);
|
||||||
GST_DEBUG_OBJECT (glimage_sink, "check existing pool caps");
|
config = gst_buffer_pool_get_config (pool);
|
||||||
config = gst_buffer_pool_get_config (glimage_sink->pool);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
gst_buffer_pool_config_get_params (config, &pcaps, &size, NULL, NULL);
|
|
||||||
|
|
||||||
if (!gst_caps_is_equal (caps, pcaps)) {
|
if (!gst_buffer_pool_set_config (pool, config))
|
||||||
GST_DEBUG_OBJECT (glimage_sink, "pool has different caps");
|
goto config_failed;
|
||||||
/* different caps, we can't use this pool */
|
|
||||||
gst_object_unref (glimage_sink->pool);
|
|
||||||
glimage_sink->pool = NULL;
|
|
||||||
}
|
|
||||||
gst_structure_free (config);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (glimage_sink->pool == NULL) {
|
|
||||||
GST_DEBUG_OBJECT (glimage_sink, "create new pool");
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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 */
|
||||||
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)
|
if (glimage_sink->context->gl_vtable->FenceSync)
|
||||||
|
|
|
@ -80,8 +80,6 @@ struct _GstGLImageSink
|
||||||
gboolean keep_aspect_ratio;
|
gboolean keep_aspect_ratio;
|
||||||
gint par_n, par_d;
|
gint par_n, par_d;
|
||||||
|
|
||||||
GstBufferPool *pool;
|
|
||||||
|
|
||||||
/* avoid replacing the stored_buffer while drawing */
|
/* avoid replacing the stored_buffer while drawing */
|
||||||
GMutex drawing_lock;
|
GMutex drawing_lock;
|
||||||
GstBuffer *stored_buffer;
|
GstBuffer *stored_buffer;
|
||||||
|
|
Loading…
Reference in a new issue