bluez5: add delay adjustment property + fallback value for a2dp-sink

Not all devices report their A2DP delay. In those cases, use a fallback
value of 150ms by default.

Make the delay adjustable with a SPA_Prop, and expose it as a part of
the route. Implement the corresponding parts in media-session.
This commit is contained in:
Pauli Virtanen 2021-02-13 22:59:04 +02:00 committed by Wim Taymans
parent df1dbee687
commit d75a79babc
6 changed files with 116 additions and 8 deletions

View file

@ -143,6 +143,8 @@ extern "C" {
#define A2DP_SINK_ENDPOINT A2DP_OBJECT_MANAGER_PATH "/A2DPSink"
#define A2DP_SOURCE_ENDPOINT A2DP_OBJECT_MANAGER_PATH "/A2DPSource"
#define SPA_BT_UNKNOWN_DELAY 0
/* HFP uses SBC encoding with precisely defined parameters. Hence, the size
* of the input (number of PCM samples) and output is known up front. */
#define MSBC_DECODED_SIZE 240
@ -481,6 +483,7 @@ struct spa_bt_transport *spa_bt_transport_find(struct spa_bt_monitor *monitor, c
struct spa_bt_transport *spa_bt_transport_find_full(struct spa_bt_monitor *monitor,
bool (*callback) (struct spa_bt_transport *t, const void *data),
const void *data);
int64_t spa_bt_transport_get_delay_nsec(struct spa_bt_transport *t);
int spa_bt_transport_acquire(struct spa_bt_transport *t, bool optional);
int spa_bt_transport_release(struct spa_bt_transport *t);