nlesource: Fix dynamic pad handling
@slomo
Submitted by Sebastian Dröge Link to original bug (#771846)
Description
+++ This bug was initially created as a clone of Bug 771843 +++
Currently all pads must be available when prepare() is called, which is in READY->PAUSED before chaining up to the parent's state change function. This means that elements like uridecodebin (or basically everything with dynamic pads) can't be used easily here.
There is a lot of code in nlesource that is supposed to handle that, but it's not functional due to changes in how nlesource works compared to gnlsource.
What would be needed is to somehow split up prepare() so that if the subclass returns ASYNC on state change, an asynchronous prepared() would happen later where the actual pad is collected. Or something along those lines.
This would not fix other elements though (demuxers), as they don't do an asynchronous state change. So maybe nlesource will have to make the asynchronous state change if no pad is there and there are going to be dynamic pads (basically what uridecodebin and decodebin are also doing).