basesrc: respect FIXED_CAPS flag in caps query implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3590>
This commit is contained in:
Mathieu Duponchelle 2022-12-17 00:36:49 +00:00 committed by GStreamer Marge Bot
parent 7c92ed0bd0
commit f8b732563b

View file

@ -1342,20 +1342,25 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
case GST_QUERY_CAPS:
{
GstBaseSrcClass *bclass;
GstCaps *caps, *filter;
GstCaps *caps = NULL, *filter;
bclass = GST_BASE_SRC_GET_CLASS (src);
if (bclass->get_caps) {
if (GST_PAD_IS_FIXED_CAPS (src->srcpad)) {
caps = gst_pad_get_current_caps (src->srcpad);
}
if (caps == NULL && bclass->get_caps) {
gst_query_parse_caps (query, &filter);
if ((caps = bclass->get_caps (src, filter))) {
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
} else {
res = FALSE;
}
} else
caps = bclass->get_caps (src, filter);
}
if (caps != NULL) {
res = TRUE;
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
} else {
res = FALSE;
}
break;
}
case GST_QUERY_URI:{