Issues with removing ghost pads from bins.

Stirling Westrup swestrup at gmail.com
Fri Jan 4 14:27:24 PST 2013


Finally managed to track down a pernicious bug today, and it turned
out to be an issue with removing ghost pads from bins.
Although the gstreamer docs talk a lot about adding ghost pads, they
don't say anything about removing them again.

I ended up using gst_element_remove_pad to remove the ghost pads,
although that is documented as intended for internal element use, as
there did not appear to be *any* other option.

Well it seems that when the removed pad is automatically freed, it
leaves traces behind. In particular the target pad of the ghost pad
still claims to be linked, even though any attempt to access the
linked pad results in a 'Not a Gst_Pad' assertion error.

In the end I found I had to request the target of the pad, unlink it
from its peer, and *then* remove the ghost pad from the bin, in order
to cleanly remove the pad.

Since this was quite unobvious, and took me some time to find, I
thought I would mention it here, unless the issue bites someone else.

--
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup


More information about the gstreamer-devel mailing list