appsrc/sink: Add query support
The query has been left for future additions in appsrc/sink API. The core idea of appsrc/sink is to allow inserting and receiving data from a pipeline without running on the streaming thread. For this, everthing that is communicated through queues. The best option to handle queries would be to wrap the queries into a mini-object wrapper. When the wrapper gets it's final unref, the streaming thread, waiting for a reply will be notified and the flow will continue. Of course, flushing and downward state transition would need to cancel the wait, but it's not very problematic, as all that will happen is that there will be no one to be notified.
The following discussion from !1046 (merged) should be addressed: