mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
plugins: check for caps in query earlier
Check for caps as soon gst_query_parse_allocation() returns.
This commit is contained in:
parent
f0d385ea4e
commit
1f5ba28bd0
2 changed files with 6 additions and 8 deletions
|
@ -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,
|
||||
|
|
|
@ -597,10 +597,10 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
|
|||
gboolean need_pool;
|
||||
|
||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
||||
if (!caps)
|
||||
goto error_no_caps;
|
||||
|
||||
if (need_pool) {
|
||||
if (!caps)
|
||||
goto error_no_caps;
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue