mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
capsfilter: Properly reset the capsfilter when setting caps ANY.
This commit is contained in:
parent
013f4a58d5
commit
69b8a22ffa
1 changed files with 22 additions and 16 deletions
|
@ -165,15 +165,20 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
|
|||
GST_OBJECT_LOCK (GST_BASE_TRANSFORM_SINK_PAD (object));
|
||||
nego = GST_PAD_CAPS (GST_BASE_TRANSFORM_SINK_PAD (object));
|
||||
if (nego) {
|
||||
GST_DEBUG_OBJECT (capsfilter, "we had negotiated caps %" GST_PTR_FORMAT,
|
||||
nego);
|
||||
|
||||
if (G_UNLIKELY (gst_caps_is_any (new_caps))) {
|
||||
GST_DEBUG_OBJECT (capsfilter, "not settings any suggestion");
|
||||
|
||||
suggest = NULL;
|
||||
} else {
|
||||
GstStructure *s1, *s2;
|
||||
|
||||
/* first check if the name is the same */
|
||||
s1 = gst_caps_get_structure (nego, 0);
|
||||
s2 = gst_caps_get_structure (new_caps, 0);
|
||||
|
||||
GST_DEBUG_OBJECT (capsfilter, "we had negotiated caps %" GST_PTR_FORMAT,
|
||||
nego);
|
||||
|
||||
if (gst_structure_get_name_id (s1) == gst_structure_get_name_id (s2)) {
|
||||
/* same name, copy all fields from the new caps into the previously
|
||||
* negotiated caps */
|
||||
|
@ -186,6 +191,7 @@ gst_capsfilter_set_property (GObject * object, guint prop_id,
|
|||
/* different names, we can only suggest the complete caps */
|
||||
suggest = gst_caps_copy (new_caps);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (capsfilter, "no negotiated caps");
|
||||
/* no previous caps, the getcaps function will be used to find suitable
|
||||
|
|
Loading…
Reference in a new issue