mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 13:36:39 +00:00
discoverer: Consider parent/child streams the same if they have caps with the same name
Child streams could have more accurate width/height or various other information added. If they have the same name, they are likely to be the same streams. https://bugzilla.gnome.org/show_bug.cgi?id=782697
This commit is contained in:
parent
efbda07cfa
commit
478b7a8eb4
1 changed files with 7 additions and 19 deletions
|
@ -1052,33 +1052,21 @@ find_stream_for_node (GstDiscoverer * dc, const GstStructure * topology)
|
||||||
/* this can fail due to {framed,parsed}={TRUE,FALSE} differences, thus we filter
|
/* this can fail due to {framed,parsed}={TRUE,FALSE} differences, thus we filter
|
||||||
* the parent */
|
* the parent */
|
||||||
static gboolean
|
static gboolean
|
||||||
child_is_same_stream (const GstCaps * _parent, const GstCaps * child)
|
child_is_same_stream (const GstCaps * parent, const GstCaps * child)
|
||||||
{
|
{
|
||||||
GstCaps *parent;
|
const GstStructure *s1, *s2;
|
||||||
guint i, size;
|
|
||||||
gboolean res;
|
|
||||||
|
|
||||||
if (_parent == child)
|
if (parent == child)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (!_parent)
|
if (!parent)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!child)
|
if (!child)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
parent = gst_caps_copy (_parent);
|
s1 = gst_caps_get_structure (parent, 0);
|
||||||
size = gst_caps_get_size (parent);
|
s2 = gst_caps_get_structure (child, 0);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
return gst_structure_has_name (s1, gst_structure_get_name (s2));
|
||||||
gst_structure_remove_field (gst_caps_get_structure (parent, i), "parsed");
|
|
||||||
gst_structure_remove_field (gst_caps_get_structure (parent, i), "framed");
|
|
||||||
gst_structure_remove_field (gst_caps_get_structure (parent, i),
|
|
||||||
"stream-format");
|
|
||||||
gst_structure_remove_field (gst_caps_get_structure (parent, i),
|
|
||||||
"alignment");
|
|
||||||
}
|
|
||||||
res = gst_caps_can_intersect (parent, child);
|
|
||||||
gst_caps_unref (parent);
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue