summaryrefslogtreecommitdiff
path: root/src/modules/bluetooth/a2dp-codec-gst.h
Commit message (Collapse)AuthorAgeFilesLines
* bluetooth/gst: Timestamp encoding buffers according to PA clockv15.99.1Marijn Suijten2022-02-211-1/+1
| | | | | | | | | Commit c6d6ca541 ("bluetooth/gst: Replace buffer accumulation in adapter with direct pull") removed the `timestamp` parameter from GStreamer transcoders due to being unused, but these should instead be propagated to the GStreamer encoding buffers. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
* bluetooth/gst: Replace buffer accumulation in adapter with direct pullMarijn Suijten2022-02-211-1/+0
| | | | | | | | | | Bluetooth codecs should always have fixed in/output and are hence able to have their results directly read from the codec, instead of accumulating in a buffer asynchronously that is subsequently only read in the transcode callback. The Bluetooth backends calling encode/decode also expect these fixed buffer sizes. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
* bluetooth/gst: Use GStreamer synchronously within PA's IO threadMarijn Suijten2022-02-211-4/+5
| | | | | | | | | | | | | | | Handling multiple threads does not come without overhead, especially when the end-goal is to ping-pong them making the whole system run serially. This patch rips out all that thread handling and instead "chains" buffers to be encoded/decoded directly into the pipeline, making them execute their work on the current thread. The resulting buffer can be pulled out from appsink immediately without require extra locking and signalling. While the overhead on modern systems is found to be negligible or unnoticable, code complexity of such locking and signalling systems is prevalent making it the main drive behind this refactor. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/494>
* bluetooth/gst: Unify encoder and decoder pipeline setupMarijn Suijten2021-02-011-10/+6
| | | | | | | | | | | | | | | | | | The encoding and decoding pipeline are essentially identical: both push data in via an appsrc, route it through a codec-specific (opaque) element, and finally pull data out of an appsink. The code already makes it impossible to have an encoding and decoding pipeline simultaneously set up in `gst_info`, and converting `bool for_encoding` to a tri-state (encode, decode, or both) would be messy; particularly when encoding and decoding could possibly differ in format. This change removes a swath of code and removes the possibility of misusing `enc_` or `dec_` in the wrong place (ie. after copying a bit of code and forgetting to rename one or two). When bidirectional codecs come online a second codec instance (`gst_info`) can simply be created and controlled independently. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/487>
* bluetooth/gst: Move common enc/dec initialization back to generic initMarijn Suijten2021-01-221-5/+0
| | | | | | | | Now that codec-specific code only touches its own bin and not any elements (appsink/src) outside of it, make things official by initializng them later in gst_codec_init where they are actually needed. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/484>
* bluetooth: Move codec specific bits to their own respective filesSanchayan Maity2021-01-191-2/+7
| | | | | | | | | | | | | | | | | | We move the codec specific bits to their own respective files and now make the codec specific initialisation use a GstBin, which the generic GStreamer module now uses in the pipeline. It is job of the codec specific function to add elements in the GstBin and link the added elements in the bin. It should also set up the ghost pads as a GstBin has no pads of it's own and without which the bin cannot be linked to the appsrc/appsink. Also, we now only initialise either the encoding or the decoding pipeline and not both. The codec init API already gets passed the for_encoding flag. We pass and use the same to codec specific init functions. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
* bluetooth: Make GStreamer threads realtimeIgor V. Kovalenko2021-01-191-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
* bluetooth: Add a generic GStreamer codec moduleSanchayan Maity2021-01-191-0/+60
This adds a generic gstreamer codec module based on which other bluetooth codecs viz. aptX, aptX-HD, LDAC and AAC can be supported. The GStreamer codec plugins used here themselves depend on the native codec implementation. aptX/aptX-HD -> libopenaptx LDAC -> libldac AAC -> Fraunhofer FDK AAC Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>