glfilter: Don't cache buffer pool

Caching and sharing to multiple element the same pool prevents
renegotiation from passthrough to not passthrough.
This commit is contained in:
Nicolas Dufresne 2015-06-26 15:33:33 -04:00 committed by Tim-Philipp Müller
parent 5229b50125
commit 79d5bbdc35
2 changed files with 19 additions and 41 deletions

View file

@ -159,11 +159,6 @@ static void
gst_gl_filter_reset (GstGLFilter * filter) gst_gl_filter_reset (GstGLFilter * filter)
{ {
gst_caps_replace (&filter->out_caps, NULL); gst_caps_replace (&filter->out_caps, NULL);
if (filter->pool) {
gst_object_unref (filter->pool);
filter->pool = NULL;
}
} }
static gboolean static gboolean
@ -729,7 +724,6 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
{ {
GstGLFilter *filter = GST_GL_FILTER (trans); GstGLFilter *filter = GST_GL_FILTER (trans);
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context; GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
GstStructure *config;
GstCaps *caps; GstCaps *caps;
guint size; guint size;
gboolean need_pool; gboolean need_pool;
@ -740,24 +734,8 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
goto no_caps; goto no_caps;
if (need_pool) { if (need_pool) {
if (filter->pool) { GstBufferPool *pool;
GstCaps *pcaps; GstStructure *config;
/* we had a pool, check caps */
GST_DEBUG_OBJECT (filter, "check existing pool caps");
config = gst_buffer_pool_get_config (filter->pool);
gst_buffer_pool_config_get_params (config, &pcaps, &size, NULL, NULL);
if (!gst_caps_is_equal (caps, pcaps)) {
GST_DEBUG_OBJECT (filter, "pool has different caps");
/* different caps, we can't use this pool */
gst_object_unref (filter->pool);
filter->pool = NULL;
}
gst_structure_free (config);
}
if (filter->pool == NULL) {
GstVideoInfo info; GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps)) if (!gst_video_info_from_caps (&info, caps))
@ -767,16 +745,18 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
size = info.size; size = info.size;
GST_DEBUG_OBJECT (filter, "create new pool"); GST_DEBUG_OBJECT (filter, "create new pool");
filter->pool = gst_gl_buffer_pool_new (context); pool = gst_gl_buffer_pool_new (context);
config = gst_buffer_pool_get_config (filter->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 (filter->pool, config)) if (!gst_buffer_pool_set_config (pool, config)) {
g_object_unref (pool);
goto config_failed; goto config_failed;
} }
gst_query_add_allocation_pool (query, filter->pool, size, 1, 0); gst_query_add_allocation_pool (query, pool, size, 1, 0);
g_object_unref (pool);
} }
if (context->gl_vtable->FenceSync) if (context->gl_vtable->FenceSync)

View file

@ -58,8 +58,6 @@ struct _GstGLFilter
{ {
GstGLBaseFilter parent; GstGLBaseFilter parent;
GstBufferPool *pool;
GstVideoInfo in_info; GstVideoInfo in_info;
GstVideoInfo out_info; GstVideoInfo out_info;