bluez5: split A2DP codecs to separate SPA plugins

Make easier to package A2DP codecs separately, by splitting each to a
separate SPA plugin.  Adjust the code to not use a global variable for
the codec list.

The A2DP SPA interface API is in the bluez5 private headers, and not
exposed in installed SPA headers, as it's too close to the
implementation.
This commit is contained in:
Pauli Virtanen 2021-09-01 00:33:43 +03:00
parent 3115775c02
commit 59d572de09
15 changed files with 911 additions and 469 deletions

View file

@ -34,7 +34,6 @@
#include <freeaptx.h>
#include "defs.h"
#include "rtp.h"
#include "a2dp-codecs.h"
@ -42,6 +41,10 @@
#define APTX_LL_LEVEL2(level) (((level) >> 0) & 0xFF)
#define APTX_LL_LEVEL(level1, level2) ((((level1) & 0xFF) << 8) | (((level2) & 0xFF) << 0))
#define MSBC_DECODED_SIZE 240
#define MSBC_ENCODED_SIZE 60
#define MSBC_PAYLOAD_SIZE 57
/*
* XXX: Bump requested device buffer levels up by 50% from defaults,
* XXX: increasing latency similarly. This seems to be necessary for
@ -723,3 +726,13 @@ const struct a2dp_codec a2dp_codec_aptx_ll_duplex_1 = {
.endpoint_name = "aptx_ll_duplex_1",
.duplex_codec = &aptx_ll_msbc,
};
A2DP_CODEC_EXPORT_DEF(
"aptx",
&a2dp_codec_aptx_hd,
&a2dp_codec_aptx,
&a2dp_codec_aptx_ll_0,
&a2dp_codec_aptx_ll_1,
&a2dp_codec_aptx_ll_duplex_0,
&a2dp_codec_aptx_ll_duplex_1
);