mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
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:
parent
7c92ed0bd0
commit
f8b732563b
1 changed files with 15 additions and 10 deletions
|
@ -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:{
|
||||
|
|
Loading…
Reference in a new issue