diff options
author | Marijn Suijten <marijns95@gmail.com> | 2021-01-21 11:25:07 +0100 |
---|---|---|
committer | Arun Raghavan <arun@asymptotic.io> | 2022-02-21 12:31:32 -0500 |
commit | 201dc6542b8e0e720aa04edec2615f2be1f9e98c (patch) | |
tree | c8660f83a4ec2783f5d233566eac3e2c8dfc9b27 /src/modules/bluetooth/a2dp-codec-gst.h | |
parent | 62deab21a3b0e0043b17f8a217ae1a2f23da9afb (diff) | |
download | pulseaudio-201dc6542b8e0e720aa04edec2615f2be1f9e98c.tar.gz |
bluetooth/gst: Use GStreamer synchronously within PA's IO thread
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>
Diffstat (limited to 'src/modules/bluetooth/a2dp-codec-gst.h')
-rw-r--r-- | src/modules/bluetooth/a2dp-codec-gst.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/bluetooth/a2dp-codec-gst.h b/src/modules/bluetooth/a2dp-codec-gst.h index 75a0ad712..dfc784546 100644 --- a/src/modules/bluetooth/a2dp-codec-gst.h +++ b/src/modules/bluetooth/a2dp-codec-gst.h @@ -43,11 +43,12 @@ struct gst_info { const a2dp_ldac_t *ldac_config; } a2dp_codec_t; - GstElement *app_src, *app_sink; - GstElement *pipeline; + /* The appsink element that accumulates encoded/decoded buffers */ + GstElement *app_sink; + GstElement *bin; GstAdapter *sink_adapter; - - pa_fdsem *sample_ready_fdsem; + /* The sink pad to push to-be-encoded/decoded buffers into */ + GstPad *pad_sink; uint16_t seq_num; }; |