bluez5: report latency to rendering when in A2DP sink role

Now that BlueZ supports delay reporting in A2DP sink role, implement
that.

Report value that gives the total latency between packet reception and
audio rendering.

Also make Latency parameter in media-source to be not just a dummy
value.
This commit is contained in:
Pauli Virtanen 2024-11-29 19:44:31 +02:00
parent 7bc84305e6
commit 2847d90b4b
4 changed files with 159 additions and 17 deletions

View file

@ -616,6 +616,7 @@ struct spa_bt_transport_implementation {
int (*acquire) (void *data, bool optional);
int (*release) (void *data);
int (*set_volume) (void *data, int id, float volume);
int (*set_delay) (void *data, int64_t delay_nsec);
int (*destroy) (void *data);
};
@ -721,6 +722,7 @@ int spa_bt_transport_ensure_sco_io(struct spa_bt_transport *t, struct spa_loop *
#define spa_bt_transport_destroy(t) spa_bt_transport_impl(t, destroy, 0)
#define spa_bt_transport_set_volume(t,...) spa_bt_transport_impl(t, set_volume, 0, __VA_ARGS__)
#define spa_bt_transport_set_delay(t,...) spa_bt_transport_impl(t, set_delay, 0, __VA_ARGS__)
static inline enum spa_bt_transport_state spa_bt_transport_state_from_string(const char *value)
{