ProxySink previously blocked on receiving the source pad
of ProxySrc in its ReadyToPaused transition, which meant
ProxySrc had to transition to Ready at the same time.
The usual use case is for the source and sink to reside in
two separate pipelines, and such an arrangement easily led
to deadlocks, as examplified by the new test case.
Instead we now maintain two more global hash maps holding
per-context sink pads and src pads weak references, and
forward events to those when needed.
As ProxySink may not have a source pad context to run
a future on when receiving FlushStart, gst::Element::call_async
is used instead, with a simple oneshot channel used to synchronize
flush start and flush stop handling.
Returning 0 as the max latency in those sources is incorrect,
and may lead to sinks incorrectly complaining about insufficient
buffering elements.
Reproduce with:
gst-launch-1.0 ts-udpsrc port=50000 address=127.0.0.1 \
caps="application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMA, payload=(int)8" ! \
rtppcmadepay ! alawdec ! autoaudiosink
gst-launch-1.0 audiotestsrc do-timestamp=true samplesperbuffer=400 ! \
alawenc ! rtppcmapay max-ptime=50000000 min-ptime=50000000 ! \
udpsink host=127.0.0.1 port=50000
Logs:
Not enough buffering available for the processing deadline of 0:00:00.020000000,
add enough queues to buffer 0:00:00.020000000 additional data.
Shortening processing latency to 0:00:00.000000000.
This then causes glitches, there are many other ways for the problems
to manifest.
Not returning NoPreroll in that transition causes downstream sinks
to wait for preroll forever.
Reproduce with:
gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1 port=50000
gst-launch-1.0 ts-udpsrc address=127.0.0.1 port=50000 ! fakesink
ctrl + C in the receiver pipeline -> hangs forever
Audio decoder element structure is based in `gst-plugin-lewton` (a lewton based Vorbis decoder created by @slomo)
The element assumes correctly parsed input from `flacparse`.
Implementation details:
* Claxon returned frames does not contain audio channels interleaved, the reorganization of the channels is done by the element.
* Claxon output buffers are always Vec<i32>, mapping to the correct type (depending on the audio format) is also done by the element.
Mono s16 and stereo_s32 test are provided.
Complete pipelines to test are:
```
gst-launch-1.0 -v souphttpsrc location=https://archive.org/download/MLKDream/MLKDream.flac ! queue2 ! flacparse ! flacdec ! audioconvert ! autoaudiosink
gst-launch-1.0 -v audiotestsrc ! audio/x-raw, format=S16LE, layout=interleaved, rate=44100, channels=1 ! audioconvert ! flacenc ! flacparse ! claxondec ! autoaudiosink
```
Fixes#71
Now that we can `Context::enter`, it is no longer necessary to spawn
a `Future` to prepare the `UdpSocket` and beneficiate from the
`Context`'s IO driver.
- Use gst-ci's stages instead of our own
- Override GIT_STRATEGY for Rust only builds as gst-ci relies on
gst-build subprojects by default.
First step merging our Rust CI with gst-ci. Once this is merged we'll
enable Rust in gst-ci builds and so will guard gst-plugins-rs MR against
breaking gst-build.
We're always providing a framerate on the output and without this it's
not possible to link the parsers to ccconvert while having it convert to
CEA708 CDP.
Fix race when building from gst-build as we need to be sure that all
these deps have been built before starting building gst-plugins-rs which
will build gstreamer-rs.