mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +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;
|
GstCaps *caps = NULL;
|
||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, NULL);
|
gst_query_parse_allocation (query, &caps, NULL);
|
||||||
|
|
||||||
decode->has_texture_upload_meta = FALSE;
|
|
||||||
|
|
||||||
if (!caps)
|
if (!caps)
|
||||||
goto error_no_caps;
|
goto error_no_caps;
|
||||||
|
|
||||||
|
decode->has_texture_upload_meta = FALSE;
|
||||||
|
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (USE_GLX || USE_EGL)
|
||||||
decode->has_texture_upload_meta =
|
decode->has_texture_upload_meta =
|
||||||
gst_query_find_allocation_meta (query,
|
gst_query_find_allocation_meta (query,
|
||||||
|
|
|
@ -597,10 +597,10 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
gst_query_parse_allocation (query, &caps, &need_pool);
|
||||||
|
if (!caps)
|
||||||
|
goto error_no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
if (need_pool) {
|
||||||
if (!caps)
|
|
||||||
goto error_no_caps;
|
|
||||||
if (!ensure_sinkpad_buffer_pool (plugin, caps))
|
if (!ensure_sinkpad_buffer_pool (plugin, caps))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
gst_query_add_allocation_pool (query, plugin->sinkpad_buffer_pool,
|
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);
|
g_return_val_if_fail (plugin->display != NULL, FALSE);
|
||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, NULL);
|
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
|
/* We don't need any GL context beyond this point if not requested
|
||||||
so explicitly through GstVideoGLTextureUploadMeta */
|
so explicitly through GstVideoGLTextureUploadMeta */
|
||||||
gst_object_replace (&plugin->gl_context, NULL);
|
gst_object_replace (&plugin->gl_context, NULL);
|
||||||
|
|
||||||
if (!caps)
|
|
||||||
goto error_no_caps;
|
|
||||||
|
|
||||||
has_video_meta = gst_query_find_allocation_meta (query,
|
has_video_meta = gst_query_find_allocation_meta (query,
|
||||||
GST_VIDEO_META_API_TYPE, NULL);
|
GST_VIDEO_META_API_TYPE, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue