d3d11download: Fix decide_allocation

Caps should be parsed in any cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1691>
This commit is contained in:
Seungha Yang 2022-02-13 22:39:46 +09:00 committed by GStreamer Marge Bot
parent 3c713cc16e
commit 27246ebeb0

View file

@ -269,26 +269,24 @@ gst_d3d11_download_decide_allocation (GstBaseTransform * trans,
gboolean has_videometa; gboolean has_videometa;
GstCaps *outcaps = NULL; GstCaps *outcaps = NULL;
gst_query_parse_allocation (query, &outcaps, NULL);
if (!outcaps)
return FALSE;
if (gst_query_get_n_allocation_pools (query) > 0) { if (gst_query_get_n_allocation_pools (query) > 0) {
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
if (!pool)
gst_query_parse_allocation (query, &outcaps, NULL);
update_pool = TRUE; update_pool = TRUE;
} else { } else {
GstVideoInfo vinfo; GstVideoInfo vinfo;
gst_query_parse_allocation (query, &outcaps, NULL);
gst_video_info_from_caps (&vinfo, outcaps); gst_video_info_from_caps (&vinfo, outcaps);
size = vinfo.size; size = vinfo.size;
min = max = 0; min = max = 0;
update_pool = FALSE; update_pool = FALSE;
} }
if (!outcaps)
return FALSE;
has_videometa = gst_query_find_allocation_meta (query, has_videometa = gst_query_find_allocation_meta (query,
GST_VIDEO_META_API_TYPE, nullptr); GST_VIDEO_META_API_TYPE, nullptr);