appsrc/appsink: Setting callbacks is not thread-safe
While the setters themselves protect the callbacks with the object lock, all uses are calling them without taking any locks. This can easily cause segfaults and worse when changing the callbacks while the elements are running.
We should either add a new mutex for this, or don't allow changing the callbacks (at all, or at least not in >= READY
).
This causes segfaults every now and then in the gstreamer-rs tests since gstreamer-rs!407 (merged) .
For gstreamer-rs I guess the workaround for now is to store in qdata if callbacks were set before and simply don't allow setting them a second time.