The path caps describe the input caps that will select each path, don't
intersect those with the srcpad caps, which could be completely
different. Instead, when querying allowed caps for the srcpad, just
construct the union of all possible output caps from all path srcpads.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2018>
When handling a caps query on the src pad, don't return the union
of input caps. Even when not active, a path element can be queried
for srcpad template caps, or for dropping paths the allowed downstream
caps is anything - as data will be dropped anyway.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2018>
Clean up path objects nicely when shutting down,
first by dropping pointers to elements during dispose,
and then by making sure to drop the ref to the path object
when finalizing the switch bin.
Fixes valgrind checks in the unit test.