plugins: check for caps in query earlier

Check for caps as soon gst_query_parse_allocation() returns.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-05-23 22:21:15 +02:00
parent f0d385ea4e
commit 1f5ba28bd0
2 changed files with 6 additions and 8 deletions

View file

@ -732,12 +732,11 @@ gst_vaapidecode_decide_allocation (GstVideoDecoder * vdec, GstQuery * query)
GstCaps *caps = NULL;
gst_query_parse_allocation (query, &caps, NULL);
decode->has_texture_upload_meta = FALSE;
if (!caps)
goto error_no_caps;
decode->has_texture_upload_meta = FALSE;
#if (USE_GLX || USE_EGL)
decode->has_texture_upload_meta =
gst_query_find_allocation_meta (query,

View file

@ -597,10 +597,10 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
gboolean need_pool;
gst_query_parse_allocation (query, &caps, &need_pool);
if (need_pool) {
if (!caps)
goto error_no_caps;
if (need_pool) {
if (!ensure_sinkpad_buffer_pool (plugin, caps))
return FALSE;
gst_query_add_allocation_pool (query, plugin->sinkpad_buffer_pool,
@ -665,14 +665,13 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
g_return_val_if_fail (plugin->display != NULL, FALSE);
gst_query_parse_allocation (query, &caps, NULL);
if (!caps)
goto error_no_caps;
/* We don't need any GL context beyond this point if not requested
so explicitly through GstVideoGLTextureUploadMeta */
gst_object_replace (&plugin->gl_context, NULL);
if (!caps)
goto error_no_caps;
has_video_meta = gst_query_find_allocation_meta (query,
GST_VIDEO_META_API_TYPE, NULL);