[simplify] Make GStreamer encoder/decoder synchronous
Run GStreamer in PA's IO thread, without extra threads, semaphores and buffer copies.
As outlined in #1115 synchronization primitives might incur overhead - not to speak of all the extra code/maintenance overhead.
Unfortunately it seems GStreamer isn't built to support fully synchronous behaviour; I really want to map
WRITEONLY in GStreamer and somehow shove that into the
src pad of the transcoder
GstBin before or during pad chaining, but haven't found the right API for that. Is it possible?
At the same time this quick-and-dirty implementation will break when the codec emits little to no data one frame, and more (two?) frames in the next; the
appsink likely gives us all data back which we can't handle. That needs to be looked into as well. If we can provide a buffer for
src to write in, that might at the same time prevent the codec from reading too much data from the underlying native codec library (unless the native library is in charge of output buffer size).
Finally there are some interesting warnings showing up for every element at startup:
(pulseaudio:1259038): GStreamer-WARNING **: 23:50:06.434: ../gstreamer/gst/gstpad.c:4363:gst_pad_chain_data_unchecked:<aptx_enc_bin:sink> Got data flow before stream-start event (pulseaudio:1259038): GStreamer-WARNING **: 23:50:06.434: ../gstreamer/gst/gstpad.c:4368:gst_pad_chain_data_unchecked:<aptx_enc_bin:sink> Got data flow before segment event
Despite all codecs working fine (enc/dec) this should be cleaned up.