summaryrefslogtreecommitdiff
path: root/src/modules/bluetooth/a2dp-codec-gst.c
diff options
context:
space:
mode:
authorSanchayan Maity <sanchayan@asymptotic.io>2021-01-01 19:32:37 +0530
committerSanchayan Maity <sanchayan@asymptotic.io>2021-01-19 13:43:42 +0530
commitd61493640e8ec82a188d33f6ae07a8dbe46c34c1 (patch)
treec51c3e2436df1f13386003008b28e29fcb6278dd /src/modules/bluetooth/a2dp-codec-gst.c
parent60441697631d73e52499e5015a122cd08b2842f9 (diff)
downloadpulseaudio-d61493640e8ec82a188d33f6ae07a8dbe46c34c1.tar.gz
bluetooth: Introduce a can_be_supported API for A2DP codecs
This API internally checks if a requested codec can be supported on the system. This is especially required for codecs supported via GStreamer where the availability of a plugin decides if the said codec can be supported. This will be used to prevent registration of a codec which the remote endpoint device might be able to support, but, PulseAudio can't as the codec is not available on the system due to the absence of a plugin. We can also prevent listing or switching to an unavailable codec. Note that the codec negotiation happens with the bluez stack even before a device is connected. Because of this, we need to make sure that gst_init is called before checking for the availability of a plugin. Since module-bluez5-device gets loaded only after a connection to the device has been established, doing the gst_init in that or one of the bluetooth modules is not feasible. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/440>
Diffstat (limited to 'src/modules/bluetooth/a2dp-codec-gst.c')
-rw-r--r--src/modules/bluetooth/a2dp-codec-gst.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/modules/bluetooth/a2dp-codec-gst.c b/src/modules/bluetooth/a2dp-codec-gst.c
index c714c1d34..958f6ec20 100644
--- a/src/modules/bluetooth/a2dp-codec-gst.c
+++ b/src/modules/bluetooth/a2dp-codec-gst.c
@@ -575,15 +575,8 @@ fail:
void *gst_codec_init(enum a2dp_codec_type codec_type, const uint8_t *config_buffer, uint8_t config_size, pa_sample_spec *ss) {
struct gst_info *info = NULL;
- GError *error = NULL;
bool ret;
- if (!gst_init_check(NULL, NULL, &error)) {
- pa_log_error("Could not initialise GStreamer: %s", error->message);
- g_error_free(error);
- goto fail;
- }
-
info = pa_xnew0(struct gst_info, 1);
pa_assert(info);