mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 13:25:56 +00:00
utils: improve warning when linking elements without common ancestor
This comes up quite a lot and it's a common mistake, so let's try to improve the warning message a little.
This commit is contained in:
parent
49a4951a0c
commit
a988871074
1 changed files with 18 additions and 2 deletions
|
@ -1446,8 +1446,24 @@ prepare_link_maybe_ghosting (GstPad ** src, GstPad ** sink,
|
|||
/* we need to setup some ghost pads */
|
||||
root = find_common_root (e1, e2);
|
||||
if (!root) {
|
||||
g_warning ("Trying to connect elements that don't share a common "
|
||||
"ancestor: %s and %s", GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (e2));
|
||||
if (GST_OBJECT_PARENT (e1) == NULL)
|
||||
g_warning ("Trying to link elements %s and %s that don't share a common "
|
||||
"ancestor: %s hasn't been added to a bin or pipeline, but %s is in %s",
|
||||
GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (e2),
|
||||
GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (e2),
|
||||
GST_ELEMENT_NAME (GST_OBJECT_PARENT (e2)));
|
||||
else if (GST_OBJECT_PARENT (e2) == NULL)
|
||||
g_warning ("Trying to link elements %s and %s that don't share a common "
|
||||
"ancestor: %s hasn't been added to a bin or pipeline, and %s is in %s",
|
||||
GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (e2),
|
||||
GST_ELEMENT_NAME (e2), GST_ELEMENT_NAME (e1),
|
||||
GST_ELEMENT_NAME (GST_OBJECT_PARENT (e1)));
|
||||
else
|
||||
g_warning ("Trying to link elements %s and %s that don't share a common "
|
||||
"ancestor: %s is in %s, and %s is in %s",
|
||||
GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (e2),
|
||||
GST_ELEMENT_NAME (e1), GST_ELEMENT_NAME (GST_OBJECT_PARENT (e1)),
|
||||
GST_ELEMENT_NAME (e2), GST_ELEMENT_NAME (GST_OBJECT_PARENT (e2)));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue