gl: avoid adding a NULL pool to propose allocation

This commit is contained in:
Matthew Waters 2014-04-02 22:42:50 +11:00 committed by Tim-Philipp Müller
parent 790f34c7a6
commit 71548893bf
3 changed files with 15 additions and 8 deletions

View file

@ -921,12 +921,14 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
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);
if (pool) {
gst_query_add_allocation_pool (query, pool, size, 2, 0);
gst_object_unref (pool);
}
/* we also support various metadata */
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
gst_object_unref (pool);
gl_apis =
gst_gl_api_to_string (gst_gl_context_get_gl_api (glimage_sink->context));

View file

@ -806,8 +806,10 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
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, 1, 0);
gst_object_unref (pool);
if (pool) {
gst_query_add_allocation_pool (query, pool, size, 1, 0);
gst_object_unref (pool);
}
/* we also support various metadata */
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);

View file

@ -321,7 +321,7 @@ gst_gl_mixer_propose_allocation (GstGLMixer * mix,
GstBufferPool *pool;
GstStructure *config;
GstCaps *caps;
guint size;
guint size = 0;
gboolean need_pool;
GError *error = NULL;
GstStructure *gl_context;
@ -381,8 +381,11 @@ gst_gl_mixer_propose_allocation (GstGLMixer * mix,
if (!gst_buffer_pool_set_config (pool, config))
goto config_failed;
}
gst_query_add_allocation_pool (query, pool, size, 1, 0);
gst_object_unref (pool);
if (pool) {
gst_query_add_allocation_pool (query, pool, size, 1, 0);
gst_object_unref (pool);
}
/* we also support various metadata */
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
@ -1614,7 +1617,7 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
guint out_tex;
guint array_index = 0;
guint i;
gboolean res;
gboolean res = TRUE;
GST_TRACE ("Processing buffers");